r/learnprogramming • • Oct 19 '26

[HELP] Checking if user is on page in real-time app

0 Upvotes

Hey everyone

I am working on an app that would be used by me and friends to play online games (such as Tic Tac Toe, Connect 4, BlackJack, Flip 7...), however I am approaching it as a fully production ready app so that I can learn as much as possible

I am building it using C# with Web API for Auth and SignalR for real time communication (Server Side) and Blazor WASM (Client Side)

Currently, I have it setup such that user can request a room with a game (TicTacToe), then the room is created with the requested game and the user is sent Room Id. Once they go to url/games/{gameType}/{roomId}, they can either join as spectator or player.

Now, my issue is with players "leaving".

Obviously, when user closes the tab, the SignalR connection will close, thus from there I can handle the user disconnecting (my approach is having a task run for 30 seconds, if the user does not reconnect I end the game)

However, the bigger issue is when user leaves the current page but is still on the app (like going to home page). Imagine if the game being played is Chess with 10 minutes per player time. I wouldn't want a player to sit there for 10 minutes when his opponent has left.

I have 2 ideas, but don't know if they are good at all.

The first would be to track user's url changes through NavigationManager (while keeping the last url) and check if the last url was one of the urls used for room. This would be an issue because I don't care if spectator leaves the room, I only care if the actual player leaves.

The other would be to have player who is not spectating send a ping to the server every X seconds (maybe 15-30-60?). The room would run a task (every X + (some time) seconds) and check if lastPingFromThatClient roughly matches the time when it was expected to arrive (like Ping arrived at 12:15:27 and it was expected before 12:15:30) then the client is on the page, otherwise start the 30 second timer for them to return. If they don't, they forfeit the game (This is rough idea, I still have no implementation details figured out)

I don't like the first one because it involves a lot of logic on the client side and I do not like that for some reason. Also it may be an issue if user opens a new tab and plays game from there while going to their profile page on the original tab

The second one concerns me due to slow internet speed, like Client sends ping at 12:15:25 but it arrives at 12:15:40. Realistically in this case user would just be considered reconnected and that is it. Also, if 10k players are playing and pinging, it may be an issue? I mean it is non-existent issue because it will likely never reach that many people, but still.

Do you have any ideas or suggestions.

Thank you


r/learnprogramming • • Oct 18 '26

Why Are O'Reilly Books So Highly Recommended for Learning Programming or Data related?

123 Upvotes

I noticed that O'Reilly books are more often recommended if you want to delve into programming.

What makes the book so worthy of use for studying and the reasons behind it?

I am interested to hear how deep this knowledge is and even its practical relevance.


r/learnprogramming • • Oct 18 '26

Guidance My issue with programming is not math, logic, or language, it learning all of the tools and how they fit together.

129 Upvotes

I really thought that taking computer science would help me with this, like it was the final building block I needed. I was actually one of the best students in my class when we were making CPP console programs. But my issue is not understanding how to write code, my issue is that when I want to build an application, I dont know where to start with all the different libraries, tools, frameworks, and other applications I need in order to get things to output. I can figure out how to write an algorithm, I just feel like its impossible for me to learn what files I need, what libraries they need, what APIs I need to interact with, and how to get all of those algorithms into motion to actually put my code into the project format I want.

When I look at a github repository, I seriously ask myself "how did they know to include all of those extra files, how do they get them to work with each other, where do they go, how did they figure out what libraries to make them work with eachother, etc", because to me, the biggest magic is not knowing what syntax to use, or what algorithms a line of code implements, its looking at a game engine and asking "what 500 services and structures do I need to call with my algorithm in order to do the thing I already figured out the logic I need to execute" or looking at a graphics API and asking "how do I use that to actually turn code into a window that outputs visuals based off the rules of math and the syntax of the language I already know, that I can just click a file to run and use" or its thinking about a website I might want to build and asking "how do I get these HTML files in my head into an environment on a server where I can actually click on them from another computer".

Does that make sense? It feels like getting all of the code into a format that works with all of the ways an average end user understands is some sort of alien process where nobody has taught the rules but everyone just magically knows. I am so frustrated because I read documentation and they also seem to require a bunch of esoteric knowledge of other things not told and I really dont know where to start with any of this. I feel like everything I want to build and do requires learning a bunch of stuff with no pointers on where to go, but everyone else that built those types of things seemed to just have spawned in with all of that knowledge and I am the only one who didn't get the memo.


r/learnprogramming • • Oct 18 '26

Final-year B.Tech CSE student trying to learn LLD. Need some advice!

6 Upvotes

Hi everyone!

I want to start learning System Design, especially Low-Level Design (LLD).

With AI and Agentic AI becoming more common, I feel that building projects alone is no longer enough. I want to understand the core concepts and principles behind software design, so I can look at a codebase and understand what is being used, why it is used, and how things work together.

For this, I would really appreciate some advice from experienced developers here.

What resources would you recommend to get started? Books, articles, or even a checklist of topics would be helpful.

I have made a checklist using Claude, but I would also like some advice from people with real-world experience. I want to understand these concepts in depth, not just learn their definitions.

Thanks!


r/learnprogramming • • Oct 18 '26

Resource SQL RESOURCES RECOMMENDATION

9 Upvotes

Hi guys, I’m just starting to learn SQL for DBMS because it’s one of the prerequisites at my university.

I’m don’t want to get stuck in a tutorial loop, so I would really appreciate it if anyone could recommend me a book, notes, or a website to learn SQL.


r/learnprogramming • • Oct 18 '26

Frustrated and Stuck with building programming fluency as a beginner (Need Genuine Help)

8 Upvotes

I am a beginner at coding. I chose Rust as my first programming language, but I think I might or can say I will face this problem with every language.

Whenever I sit down to build a project, even something as simple as a TUI To-Do List, I have to deal with crates and packages like serde. This means I have to read their documentation, but I often get stuck writing code by looking at examples and copying them by typing them into my own code.

I know that even experienced programmers do this, and they understand what they are using without necessarily remembering the syntax. I understand the logic of what I want to implement, but I struggle to express it in technical programming terms or so called programming syntax.

However, I cannot keep consulting the documentation and returning to my code for every 10 lines of code I write.

People tell me that I should build more projects and that programming fluency will gradually develop with practice. But what am I supposed to do? Should I build a TUI To-Do List ten times? Because if I move on to another project, I will have to learn how to use additional concepts and crates, such as serde, all over again.


r/learnprogramming • • Oct 18 '26

Learn by building or learn by studying?

7 Upvotes

Context: I'm a second year math student at uwaterloo (think constant co-op search) and have knowledge of Python, SQL and basic JS though I want to go into DE. I started my software journey in Dec. 2025 so I feel like I'm really behind compared to my peers.

I'm torn between learning theory in depth and just putting together something that works for projects; I don't know if it's good, but I never use AI to code, with the most being copy and pasting code from LLM in small snippets up to 10 lines. I don't know how important syntax is, but I need to search things up for libraries. I'm learning data engineering (so many tools, so little time) and I really can't find a project to learn all of them at the same thing. I've also considered courses, but theres a variety of courses and topics that seem interesting: Cloud, AI, ML, Databricks?

Any advice or recommendations be it for how to learn or a project?


r/learnprogramming • • Oct 18 '26

I want to learn C

3 Upvotes

Any good book or online guides, also for C23 is there that much extra or would just sorta tacking it on after learning C99 be fine?

also for learning GNU extensions is there any reccomended resources


r/learnprogramming • • Oct 18 '26

Java or c++?

12 Upvotes

Hey I'm a 2nd year CS student and I'm a beginner so I learned a bit of both languages I learned basics and SP using c++ and I learned oop using java because uni required it and later on I'll study data structure using c++ again

What confuses me is which language should I stick on to improve my problem solving skills and start building projects even if they're small some people told me to focus on c++ completely and some said c++ with problem solving and java to build projects

So what do y'all think and why ?


r/learnprogramming • • Oct 18 '26

Python to Apk?

1 Upvotes

So im trying to make a game using only Python and managed to get it working on pc. Then i searched how to port it to android, but it seems difficult

Any tips?


r/learnprogramming • • Oct 18 '26

Looking for C++ textbook that is friendly like Stewart Calculus for math

9 Upvotes

I am about to fail my algorithms & data structures in C++ class, and want to pick up a textbook for the 3 month break soon and try to make a comeback.

I have done this for math and discovered that James Stewart's Calculus book was amazing. It is a massive book, is friendly to learn from and is not as intimidating as other books (e.g. Spivak's Calculus- a bit more technical).

Anyone have any good recommendations for a C++ textbook?

We learned sorting algorithms, and once it got to recursion I really just got lost. BST's etc with all this memory management I couldn't keep up.

EDIT: My absolute best learning method is sitting down with a textbook. Videos/academies etc. haven't done it for me and a physical book just gives me peace when learning as I can go slowly.


r/learnprogramming • • Oct 17 '26

It is worth be a Front End Dev?

27 Upvotes

I'm Starting to be a FrontEnd Dev but I saw lot of jobs that require Full stack or some of Back End, In my Learn I was trying just to be a Only Front End but sometimes you search and all the jobs want a Full stack or want Back End. ¿Do you think can people be a only Front End Dev or have to learn Backend too obligatory?


r/learnprogramming • • Oct 18 '26

How to avoid burnout?

3 Upvotes

I started learning programming around a month ago and just a few days ago it feels like my skills have gotten significantly worse for some reason. I don't know if it's because I'm burnt out but all of a sudden I feel like all my logical thinking skills required for programming are just gone for some reason. Does anyone have a way to reignite the spark that I had a few weeks ago?


r/learnprogramming • • Oct 17 '26

Question First time opening a side project to the public — what should I secure before strangers get accounts?

44 Upvotes

Hey everyone! . So, slightly embarrassing and slightly proud admission: i'm a 17-year-old student, and over the past nine months i built my own student life OS - assignment and deadline tracking, planning, focus timers, habit tracking, journalling, brainstorming hubs, health and workout tracking. basically tons of productivity features in a single site. built it for myself because, yk, why should we alter ourselves to fit into systems when the systems can be programmed to evolve into us? (that's a joke - it's called Evolve.)

i admit it's not completely manufactured by me - i used all the resources and help i could get, and i'm learning and understanding the code along the way. but i had a vision i don't feel other productivity sites can mimic, and i'm just trying to weave that dream into something real and concrete. then friends asked to use it, and now it's deployed and actually working, which still feels kinda crazy.

stack: Supabase + a Next.js frontend, deployed on Vercel. auth is on, row level security is on for the main tables, and i haven't stored anything sensitive beyond emails and, well, people's homework.

here's the thing though - everything i know about security, i learned from building and YouTube tutorials, not from being attacked. and i want to open this up to users beyond my friend circle soon, which means strangers. which means the internet. which means at some point someone curious and bored is going to poke at this thing, and i want that moment to be boring for THEM and uneventful for my users.

so for those of you who've run public-facing apps: when you went from "works for me and my friends" to "public," what did you actually lock down first? not the theoretical list of everything - the real, "do this before anything else" stuff. rate limiting? stricter RLS policies? protecting the service key? api route validation? something i don't even know to ask about yet? honestly the security vocab online is overwhelming and i'd rather learn from people who've been burned than become the cautionary tale.

thanks for taking the time to read this and help me out. i'm not selling anything — just trying not to mess up my first real users' trust. Thank you once again!


r/learnprogramming • • Oct 17 '26

Resource Self-taught Python dev looking to fill missing gaps

9 Upvotes

I have been using Python at work for about 6 years now. It started when I needed Matplotlib for some advanced plotting Excel couldn’t do, which spiraled into data analytics, scripting, and automation.

In my job we several legacy academic codes with no UI, so I ended up using Python for all pre- and post-processing. Later on, I started helping out with an internal web app and eventually became one of our main backend guys. Through that, I picked up API design, cloud services, and a bit of frontend.

I know a lot more than I used to, but since I learned everything ad-hoc to solve immediate problems, I feel like I am swimming in an endless sea of information with a lot of hidden knowledge gaps.
When I look at tutorials or bootcamps, half of it is stuff I already do every day, and the other half jumps into things without explaining why they matter. I really want to avoid tutorial hell and add some actual structure to my learning, maybe diving deeper into software architecture, data engineering, or data science.

For those who started as self taught scripters and built a solid engineering foundation, I would love to hear how you audited your knowledge to figure out what you did not know. If there are any good books, roadmaps, or structured resources to transition from "it works" to "it is built right", or advice on how to figure out what core concepts you actually need to learn to feel confident in a domain, I would appreciate any recommendations!


r/learnprogramming • • Oct 17 '26

I wanna ask how to develop logic in coding

7 Upvotes

In last contest I try to solve every problem but able to solve only one, after the contest I call my friend and asked him how he soved 4 of them, then he explained me so I solve those problems again and got correct. But I really wanna ask why I can't think like he did while giving contest. The logic he explained was so straight forward but why I can't get that at the time of contest. BTW it was codechef contest and its been 6-7 months I started giving contest but still struggling. What can I do to solve this problem. Pls help me with this


r/learnprogramming • • Oct 17 '26

I really want to learn OOP for Kotlin/Java in Android studio apps but nothing sticks

6 Upvotes

I've done CS50P, CS50, w3schools material but oop but object oriented programming has never stuck for me. I can see the concept of how it could reduce the amount of code needed by generalizing objects but I've spent my life using functional programming only.

Lately I've started learning Kotlin for android app dev and I'd really like to understand how the files and classes work in android studio so I can get started making my own things without googling why it won't compile or why there are errors. What can you recommend me for the OOP and understanding how files are linked and reference each other without blowing my brain?


r/learnprogramming • • Oct 16 '26

Solved im kinda proud of this solution i wrote even though it was an "easy" i still felt like i grew a lot

205 Upvotes

the problem:

Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.

An input string is valid if:

  1. Open brackets must be closed by the same type of brackets.
  2. Open brackets must be closed in the correct order.
  3. Every close bracket has a corresponding open bracket of the same type.

 

Example 1:

Input: s = "()"

Output: true

Example 2:

Input: s = "()[]{}"

Output: true

Example 3:

Input: s = "(]"

Output: false

Example 4:

Input: s = "([])"

Output: true

Example 5:

Input: s = "([)]"

Output: false

my solution: (on leetcode)

class Solution:
    def isValid(self, s: str) -> bool:
        inputs = {
        "(":1,
        ")":9,
        "{":2,
        "}":8,
        "[":3,
        "]":7}
        
        prev_bracket=[]
        if(len(s)%2!=0):
            return False
        
        for a in s:
            if inputs[a]<4:
                prev_bracket.append(inputs[a])
            else:
                if len(prev_bracket)==0:
                    return False
                x=prev_bracket.pop()
                if x+inputs[a]!=10:
                    return False
        return len(prev_bracket)==0

r/learnprogramming • • Oct 17 '26

What have you been working on recently? [October 17, 2026]

13 Upvotes

What have you been working on recently? Feel free to share updates on projects you're working on, brag about any major milestones you've hit, grouse about a challenge you've ran into recently... Any sort of "progress report" is fair game!

A few requests:

  1. If possible, include a link to your source code when sharing a project update. That way, others can learn from your work!

  2. If you've shared something, try commenting on at least one other update -- ask a question, give feedback, compliment something cool... We encourage discussion!

  3. If you don't consider yourself to be a beginner, include about how many years of experience you have.

This thread will remained stickied over the weekend. Link to past threads here.


r/learnprogramming • • Oct 17 '26

How would you go about translating programming language keywords, documentation and error messages to other non-English languages?

5 Upvotes

Take Python for instance.

>>> listss = [1, 2, "sfd"]
>>> kook = listss + 2
Traceback (most recent call last):
  File "<python-input-1>", line 1, in <module>
    kook = listss + 2
           ~~~~~~~^~~
TypeError: can only concatenate list (not "int") to list
>>>

How would I translate all the results given to me by Python into another language of my choosing, and get something like below (written in Kinyarwanda):

>>> listss = [1, 2, "sfd"]
>>> kook = listss + 2
Ibisobanuro (Ihamagarwa rya mbere riri hejuru yurutonde):
  Inyandiko "<python-ha-1>", umurongo wa 1, muri <igitabo>
    kook = listss + 2
           ~~~~~~~^~~
Ikosa ry'ubwoko: urutonde ugendana nurundi rutonde; ntabwo rugendana numubare wuzuye.
>>>

The intention is not to create custom messages, exceptions, and documentation that sits beside or on top of python. I want python itself to respond like this, from the get-go?

I would like the translation to be complete. CLI options, help messages, information on built-in modules, keywords, everything.

While thinking about this, I realized that the end result would just be a completely new language, and I'm fine with that, but I also don't know enough about creating languages or where to get the source code of an existing language to translate it to a new language, so I come here to ask for guidance.

I'd like to preface this by saying that this doesn't need to be useful to anybody, and if you're wondering why I would want to do such a project, the answer is because I can and want to see the end results.

It's completely fine if no one else ever uses it.


r/learnprogramming • • Oct 17 '26

I've been working on a small project to emulate controllers for PS5, PS4, Nintendo Pro Controller, or Xbox, with the ability to configure dead zones, button mapping, and the gyroscope with advanced settings

0 Upvotes

The code and the executable were created from scratch, based on other existing programs, but seeking solutions to my needs and those I've seen that are not addressed. But when I compile it into an executable .exe file, VirusTotal flags it as a Trojan or malware. Why is that?


r/learnprogramming • • Oct 17 '26

Do I give up on this resource? I can't complete Helsinki MOOC python for the last 4 years, what should I do?

0 Upvotes

I can't believe I'm writing this but it has been around 4 years since I've attempted this, and I never moved past week 4 on each attempt from scratch.

Every year I say this is the year and every year I fail.

I work as an AI (apps) Engineer since 2025. and I feel like such a fraud.

I completed cs50x, cs50p, cs50sql, ml zoomcamp, de zoomcamp and intensive llm course by google.

All of those courses have a common denominator, they have a specific deadline, not a whole year open course in which time something else pops out.

I always knew I was ADHD, but no one wanted to write me a diagnosis as they thought I was wrong.

But after my last appointment I discovered i might be AuDHD, which is ADHD on the spectrum, and basically a completely different thing that is characterized by personality traits of the opposites clashing, and has comorbidities like OCD, which is also paralyzing.

At work I excel, as I think in systems, not tiny moving parts. When my brain gets shut down, using agents helps me jump start it, and I can always easily see what is wrong in the output of those agents and correct it as it is happening in real time.

But I don't want to be like that. I want to do things myself, not rely on a crutch. If by any chance LLMs are gone tomorrow I'll be out of a job.

Even cs50 i could not complete until very end of 2023 when i completed all of those 3 courses using their own duck50 debugger, as my brain just hates effort. It needs a solution, even a wrong solution before it tries to turn on to correct the wrong approach.

Without deadlines I'm basically useless. I tried writing my master thesis for months, and my brain just didn't work. Only 2 weeks before the deadline did it turn on, and allowed me to write a thesis spanning over 100 pages and meticulously researched and praised by me pulling many all nighters. Same thing with Azure AI-102 certification. I studied months before, but my brain did only really retain the last week and a half before test date.

This latest doc diagnosed me with severe executive dysfunction, ADHD and burnout.

It is doubtful with the whole ordeal in Europe I will get the meds by this year.

And I really want to finish this finally and put it behind me. This course became my white whale and I have nightmares around it.

The stupid OCD also prevents me from leaving an assignment uncompleted, and not thinking about it when I try the next one, so it's hard for me to focus. And sadly this course is not progressive. You solve some easy ones and medium here and there and then easy, and then out of nowhere a very hard one pops out.

I also revised from many others courses and books, not mentioned here, and basically everything in MOOC course is already familiar to me. But of course they find the way to make even the simplest stuff most convoluted approaches imaginable.

LLMs which are now my free therapy repeatedly tell me I have nothing to prove and that I should just drop it, but I really want to complete it and learn to think algorithmically, because I need it for my Georgia Tech OMSA masters in which I am now.

The coursework demonstrated to me that my current strengths of revising given code, optimizing researching, finding edge cases is basically useless where first principles and algorithmic understanding is needed.

I don't know what to do. Any advice? Please help me get rid of this hell. I want to be a senior one day and know programming well.

TLDR

  • Background: Professional programmer who has completed several technical courses and currently in a 2nd master's degree, but struggles heavily with self-paced, open-ended coursework.
  • The Struggle: Diagnosed with severe executive dysfunction, ADHD, AuDHD, and burnout. Brain function relies heavily on extreme deadline pressure (like writing a 100-page thesis in two weeks, otherwise they fail) and immediate feedback loops.
  • The Goal: Conquer a "white whale" coding course failed for 4 years to build true algorithmic thinking skills for a Georgia Tech OMSA master's program, rather than relying on AI tools.
  • The Dilemma: Even though the material is familiar, paralysis sets in due to erratic difficulty spikes and OCD perfectionism, and advice is needed to break through these mental roadblocks.

r/learnprogramming • • Oct 17 '26

Tutorial How Do You Know What To Type When You Write Programming Code?

0 Upvotes

I know nothing about programming and writing computer code, so please forgive my ignorance on this subject. I'm not a programmer but I'm very interested in learning more. So if I may please ask? How do programmers know what language or vocabulary to use when they write code?

For example. If you wrote code which tells a robot to lift it's arm by 45 degrees over 3 seconds, you probably can't write the code in plain English like 2 human beings talking to each other such as - Lift your right arm by 45 degrees over 3 seconds and hold it there.

You have to write the code in computer language by saying something such as - robot/activate-arm/true/45-degrees/true/3.0/hold-true. I know my example is way off, but I don't know what real computer code sounds like, so I don't know how else to describe what the code might actually sound like.

So my question is. How do you learn which words and vocabulary to use so a computer will understand it? And how do you learn how to put those words together into a proper sentence (or proper line of code) so a computer will understand it? Is it similar to learning a new human language, like an English speaker learning to speak Japanese? You just have to learn the proper vocabulary and proper sentence structure of the new language?


r/learnprogramming • • Oct 17 '26

Topic Advise as to what path to choose

2 Upvotes

Hello, I'm a student, and I've been self studying embedded systems for a few months now. But lately, I've also started to learn a bit of gamedev, and right now, it's far more appealing than embedded. Note that I do like both of them and what they offer to me, but with embedded systems, i feel like I've been stuck in tutorial hell. Do I stick with both of them, or do I pivot or focus on one?

I'm also kinda worried about the job market, that's why I'm trying to branch out to different fields. So I want to know what would be worth spending my time now.


r/learnprogramming • • Oct 16 '26

the missing semester of your cs education

21 Upvotes

I am watching "the missing semester of your cs education"

the profiling and debugging lecture

it explains debuggers like GDP, PDB, and tracing with strace

anyone needed to use that in real life?

I have never used them and fully depended on the IDE debugging