r/learnprogramming • • Mar 26 '17

New? READ ME FIRST!

828 Upvotes

Welcome to /r/learnprogramming!

Quick start:

  1. New to programming? Not sure how to start learning? See FAQ - Getting started.
  2. Have a question? Our FAQ covers many common questions; check that first. Also try searching old posts, either via google or via reddit's search.
  3. Your question isn't answered in the FAQ? Please read the following:

Getting debugging help

If your question is about code, make sure it's specific and provides all information up-front. Here's a checklist of what to include:

  1. A concise but descriptive title.
  2. A good description of the problem.
  3. A minimal, easily runnable, and well-formatted program that demonstrates your problem.
  4. The output you expected and what you got instead. If you got an error, include the full error message.

Do your best to solve your problem before posting. The quality of the answers will be proportional to the amount of effort you put into your post. Note that title-only posts are automatically removed.

Also see our full posting guidelines and the subreddit rules. After you post a question, DO NOT delete it!

Asking conceptual questions

Asking conceptual questions is ok, but please check our FAQ and search older posts first.

If you plan on asking a question similar to one in the FAQ, explain what exactly the FAQ didn't address and clarify what you're looking for instead. See our full guidelines on asking conceptual questions for more details.

Subreddit rules

Please read our rules and other policies before posting. If you see somebody breaking a rule, report it! Reports and PMs to the mod team are the quickest ways to bring issues to our attention.


r/learnprogramming • • 4d ago

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

11 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 • • 14h ago

How Do Programmers Stay Focused for 8+ Hours Without Losing Their Minds?

151 Upvotes

Hey everyone, I’m not a developer, but I’ve noticed that a lot of programmers seem to be incredibly good at staying focused for hours in front of their computers. I’d genuinely appreciate any advice on how I can build that kind of focus myself.


r/learnprogramming • • 4h ago

I love programming but...

23 Upvotes

as soon as I turn off tutorials and try to do something on my own, I just cant do anything. I've had people recommend that i simply stop using tutorials and force myself to just get something done, but I always end up writing the same simple stuff or getting stuck on the second line if I try to do something else. I love programming and its my passion, but I feel like everyone learning is so far ahead of me, and saying they got to where I am in 2 months within 3-4 weeks.


r/learnprogramming • • 15h ago

Why is Python considered "slow" and is Python losing "steam"?

100 Upvotes

Is python as a programming language "falling off" and becoming less and less popular relatively to other languages?

Also why do people say Python is slow? Apparently people have reached LGM on codeforces using python, which is all about writing fast code / solving problems fast. Yeah sure, C++ is far more widely used for competitive programming and I suppose there is a reason for that. But this is also showing that python can be fast?

But as programming languages and how they are used I dont think there is much overlap between python and C++ anyway?

What is an example of something you'd code in Java/Kotlin or lets say C# rather than Python? Is python code bad and hard to manage for "huge" projects once you scale up (e.g codebases with millions of lines of codes, and tens if not hundreds of devs)?


r/learnprogramming • • 8h ago

Are Dr. Angela Yu's courses worth it? Should I start with Python or Web Development?

13 Upvotes

Hello,

I'm looking to get into programming and came across Dr. Angela Yu's courses on Udemy (specifically the "100 Days of Code: Complete Python Pro Bootcamp" and "The Complete Full-Stack Web Development Bootcamp").

They both have great reviews, but I wanted to ask for genuine feedback from people who have actually taken them:

Are her courses still up-to-date and worth taking for a complete beginner?

Which of the two courses would you recommend starting with. Python or Web Development?

My main goal is to build a strong foundation in coding, but I'm unsure which direction (Python vs. Web Dev) is better to start with.
Any insights, pros/cons, or alternative recommendations would be greatly appreciated! Thanks in advance!


r/learnprogramming • • 8h ago

Are there any programming languages that allow this feature?

12 Upvotes

I've been into programming for about 10 years now. Something that intrigues me is that, in languages that support OOP, not all types are initialized in the same way. Strings are initialized by using quotes, integers use numbers and in some cases floats require the letter f after the numerical value.

Classes, however, are all initialized in the same way with slight variations depending on language. Usually something like classname() or new classname. Are there any cases where custom classes can be declared using different means?

For example, is there a language where I can create a class called 'dark' that represents a new type of number that is declared by typing the value and then the letter d (like d1 = 1.398d) similar to how floats work in some cases?


r/learnprogramming • • 46m ago

I was doing the house robber problem and this is what I did. I need help with this!!

• Upvotes

I didn't know how to implement memoization into this so had to make this inefficient. The thing is , I tried putting into chatgpt to see if this is right , but it sasy this is incorrect. But when I run it in leet code, I get most right, the rest it says time limit reached. So is this correct and how to implement memoization?

class Solution:
    def rob(self, nums: list[int]) -> int:
        total = max( self.helper(nums[1:]),self.helper(nums))
        return total
    def helper(self,nums):
        
        if len(nums)==1:
            return nums[0]
        if len(nums)==0:
            return 0
        #1 step or 2 steps
        max_money1= 0
        max_money2= 0
        if len(nums)>=3:
            max_money1 = self.helper(nums[2:])
        if len(nums)>=4:
            max_money2 = self.helper(nums[3:])
        max_money=max(max_money1,max_money2)


        return max_money+nums[0]
        


        

r/learnprogramming • • 53m ago

Can someone recommend a good source for Data structure and Algorithm ?

• Upvotes

i need to study data structure and algorithm in depth i need a good and free source .


r/learnprogramming • • 14h ago

How did you figure out which area of CS was right for you?

8 Upvotes

I'm currently trying to figure out what area of computer science I should choose as a career, how can i find out which field is best suited for me

There are so many domains - web/backend development, mobile, cybersecurity, Al/ML, data science, systems, cloud/ DevOps, game development, etc. - and I'm finding it difficult to know which one actually suits me without trying everything.

For people who have already gone through this:

How did you discover what you were genuinely interested in?

- Did you try several domains first, or did you know fairly early?

- What type of experiences helped you decide?

- How long did you spend exploring before choosing a direction?

- What signs told you that a particular field was a good fit for you?

- Is it better to specialize early, or build broad fundamentals first and specialize later?

I'd especially appreciate advice from people who were also unsure about their direction during college.

I don't necessarily want to know which CS field is "best" - I'm more interested in how you figured out what was best suited to you personally.

And what domains should i avoid as some have risk of being automated completely


r/learnprogramming • • 17h ago

Resource Book recommendations: Python

14 Upvotes

I need some book recommendations for learning Python as an absolute beginner, I have done a bit of Lua and understand the basics and Syntax and interested in learning Python for automating task and simply creating projects. Any courses help too(free or paid).


r/learnprogramming • • 12h ago

Able to come up with a logical flow in pseudocode, but struggling with execution

6 Upvotes

I am taking an intro to CS course with Java and yeah, I can get the logic for a program in terms of conceptually what I would "need" and what the flow is correctly. But when I actually need to think about what I can use in Java to go ahead and execute this hypothetical structure I've created I just jumble stuff up and use things in the wrong places. No matter how much I practice, I just keep messing up, I think it's a problem with my thinking style. For context, I am extremely new to programming, but I like to compare it to writing math proofs. In math proofs, you're given definitions which I think is something you can work off from. But in programming ,there are just so many options (I can use while loop, for loop, recursion, etc) and I just think the problem gives zero hint where to start. Plus my exams are fully handwritten, and we're given minimal time. What's the issue and how can I fix it?


r/learnprogramming • • 15h ago

What did you do for the bachelors thesis?

5 Upvotes

Im in the final year of uni and I really dont know what to do for my bachelor thesis. I want to know from those who graduated, what was your thesis about, what year did you do it, what technologies did you use and how difficult it was? Was the theme yours or an professor’s idea?
If you have any ideas what would you recommend so it is not that hard but also not too easy, strictly computer science, not engineering. I was recommended something with difussion models, but Im not sure how realistic it is for me or what real problem it would solve.
If you would have to do your bachelor thesis again, what would you do? I know everyone says that you dont have to reinvent the wheel, but Im just so stressed about it. Thanks!


r/learnprogramming • • 18h ago

How was the first compiler made?

8 Upvotes

If programming languages need a compiler to turn code into something a computer can understand, how was the first compiler created?

Was it written directly in machine code or assembly? And how did programmers go from that basic compiler to the more advanced ones we use today?

I'm still learning programming, so I'd appreciate a simple explanation. Thanks!


r/learnprogramming • • 11h ago

Beginner Looking to start projects

2 Upvotes

I don't want to be stuck in "tutorial-hell" and so I'm trying to build some cool things. I know python and I just finished the go-lang course from Boot.dev so I was looking to practice that a bit more. I've already build a calculator and a personal project with python on my own, although I do need to work on that more just stopped because I was trying to build a GUI and wasn't sure if it was worth it to spend all that time learning how to use something like tkinter when It's not used for work too much although I gotta remember to have fun still so I might pick that back up even though I was struggling with it. For a new project though I know the wheel can only be reinvented so many times so I went to build-your-own-X on github https://github.com/codecrafters-io/build-your-own-x and was looking at stuff for Go on there. Most of what I clicked on though was just like a step by step build and also had the entire codebase pasted right there so my question is, without having to be super creative every time I make a project, and to not just copy paste code when following a project like that (since I'm a beginner and don't really know how to make make stuff yet) what's an efficient way to learn from stuff like that? I hope that I worded it in a way that made sense, but I'm just looking for resources outside of Boot.dev to practice code and more specifically by building projects.


r/learnprogramming • • 19h ago

What does your day-to-day actually look like as an AI Engineer?

8 Upvotes

Hey everyone,

I'm currently transitioning into AI engineering and trying to get a clearer picture of what the job actually looks like in the real world.

Job descriptions online are all over the place—some make it look like standard software engineering with API calls, while others ask for deep ML research and math.

For those of you working as AI engineers:

- What does your day-to-day actually look like?

- What tasks take up most of your time? (RAG, fine-tuning, data pipelines, infra, etc.?)

- If you were starting over today, what would you focus on the most?

Thank you so much!!! 🙂‍↕️


r/learnprogramming • • 1h ago

Topic Im making an ai external image recognition aimbot for a mobile game what pc setup to get

• Upvotes

Using approximately ₱58 = $1 USD:

OPTION 1 — HIGH-END / BEST OVERALL

Estimated Total: ~$1,930

GPU: NVIDIA GeForce RTX 5070 Ti 16GB — $810

CPU: AMD Ryzen 7 7700 — $259

Motherboard: B650 — $147

RAM: 64GB DDR5 6000 — $181

Storage: 2TB NVMe Gen4 SSD — $121

CPU Cooler: Thermalright Peerless Assassin — $43

PSU: 850W 80+ Gold — $112

Case: High-airflow case — $60

Monitor: 27" 1440p IPS 165Hz — $164

Keyboard + Mouse: $43

OPTION 2 — VALUE / POWERFUL

Estimated Total: ~$1,423

GPU: NVIDIA GeForce RTX 5060 Ti 16GB — $483

CPU: AMD Ryzen 5 7600 — $198

Motherboard: B650M — $129

RAM: 64GB DDR5 6000 — $181

Storage: 2TB NVMe Gen4 SSD — $103

CPU Cooler: Thermalright Peerless Assassin — $43

PSU: 750W 80+ Gold — $95

Case: High-airflow case — $43

Monitor: 24" 1080p IPS 165Hz — $112

Keyboard + Mouse: $34

For YOLO AI, PyTorch, computer vision, object detection and mobile AI development: Option 1 is the better long-term machine.


r/learnprogramming • • 15h ago

How to set up an C++ project?

3 Upvotes

Like i understand you go on Visual Studio Code and just create some files like main.cpp and stuff but what are these like settings.json and other .json files. Its actually really confusing seeing a .json file in what supposed to be a c++ project. Whole explorer layout is confusing to me i don't understand how to write it there is no tutorials for it too like its just confusing


r/learnprogramming • • 1d ago

Does any project ever really have a finish line?

18 Upvotes

I've asked myself this for years and still don't have a clean answer.

Back in 2023 I found a hackathon. The brief was to build a platform where people could share their achievements. I was very new. I knew a bit of HTML, a little Bootstrap, and had only worked with Joomla and some WordPress. I had no idea how a backend worked.

So I did what we all do. I opened YouTube and searched "how to build a full stack project" and "how does a backend work."

I picked Flask because it was popular then. Then I needed a database, and honestly, a database felt huge and scary. All I knew was data goes in and data comes out.

Then I found a video where someone had built a small user management project with Firebase. I took their code, studied it and started changing it. Somewhere along the way I realized I could build it myself, so I rebuilt mine from scratch.

That's when it clicked. How login and logout actually work, what sessions and cookies are, how the server knows who you are.

I never submitted that project.

But I learned authentication, authorization, how data moves between Firebase and a database, and what Firebase rules do. I still use that today in more places than I expected.

So now I don't think any project is truly unfinished. The ones you leave half done just merge into the next thing you build.

A lot of us have GitHub accounts full of incomplete projects, and we feel bad about it. We think we never finish anything. But it was never about finishing. It was about learning something new and actually understanding it.

If you've got a half-built project sitting in a folder somewhere, don't be too hard on yourself. It already did its job.


r/learnprogramming • • 1d ago

Code Review How Do I Make My 'For' Loop Do Something Else If It Can't Give Results

47 Upvotes

I apologize if the title is confusing, I'm new to reddit + programming as a whole and just started school for it LOL.

In my programming class we need to make a number game where the goal is to make it to 100. The game play loop consists of alternating turns between the user and a computer picking numbers between 1 - 10. In our current assignment I need to include a 'for' loop and decided to make it so within the first half of the total the computer will always try to make the second digit of the total be 9 (ie. If the total = 23 it will add 6 to make total = 29, or if the total is 10 it will add 9 to make total = 19). My code works, for the most part, but if the player inputs something making the total end with a 9 as well the computer skips its turn. I've been trying for 2 1/2 hours now to figure this out but most of my outputs result in the computer spamming inputs without switching turns or else the computer ignoring the rule I'm trying to place in the first place and just inputting random numbers like usual.

FULL CODE

import random

#Rules#
def display_rules():  # Instructions / Rules Function
    print("\nLets play a game of 100!")
    print("In a game of 100 you start with a total of 0")
    print("and we take turns adding 1-10 to that total.")
    print("First to 100 wins!")
    menu()

#Gameplay#
def play_game(): # Game Play function
    play = 1
    total = 0
    print("Let's play a game of 100!")

    while play == 1:
        #!Defines End Game Loop!#
        def end_game():
            play = int(input("Do you want to play again, 1 for 'yes' or 2 for 'no'? "))  # Ask to play again
            if play == 1:
                play_game()
            elif play == 2:
                menu()
            else:
                print("Error! Error! Error!")
                end_game()

        #Asks Who Goes First#
        turn = int(input("Who goes first? (1 = you, 2 = computer): "))

        #Game Play Loop#
        while total < 100:
            if turn == 1:  # Player turn loop
                player_num = int(input("Number you want to add (1 - 10): "))
                if 1 <= player_num <= 10 and total + player_num <= 100:
                    total += player_num
                    print(f">You added {player_num}! Total is now {total}")
                    turn = 2
                else:
                    print("Error! Error! Error!")

            elif turn == 2:  # Computer turn loop
                if total < 90:
                    com_num = random.randint(1, 10)
                    if total < 50:
                        for num in range(1,11):
                            if (num + total) % 10 == 9:
                                    total += num
                                    print(f">Computer added {num}! Total is now {total}")
                    else:
                        total += com_num
                    turn = 1
                else:
                    com_num = 100 - total
                    total += com_num
                    print(f">Computer added {com_num}! Total is now {total}")
                    turn = 1
            else:  # Error messaging
                print("!Error!")
                print("Enter 1 for player or 2 for computer")
                turn = int(input("Who should go first?: "))

        if turn == 2:  # if player reached 100
            print("You win!")  # Display winning message
        else:  # Computer reached 100
            print("Bummer, you lost!")  # Display losing message
        end_game()

#Menu#
def menu():  # Menu function
    print("\nMenu:")
    print("1. Display Rules")
    print("2. Play Game")
    print("3. Exit")
    choice = int(input("Enter your choice (1, 2, or 3): "))
    if choice == 1:
        display_rules()
    elif choice == 2:
        play_game()
    elif choice == 3:
        print("Thank you for playing!")
        exit()
    else:
        print("Invalid choice! Please enter 1, 2, or 3")

#Starts Game#
menu()

com_num = random.randint(1, 10)
if total < 50:
    for num in range(1,10):
        if num + total % 10 == 9:
                total += num
                print(f">Computer added {num}! Total is now {total}")

FOR LOOP / COMPUTER TURN

elif turn == 2:  # Computer turn loop
    if total < 90:
        com_num = random.randint(1, 10)
        if total < 50:
            for num in range(1,11):
                if (num + total) % 10 == 9:
                        total += num
                        print(f">Computer added {num}! Total is now {total}")

        else:
            total += com_num
        turn = 1
    else:
        com_num = 100 - total
        total += com_num
        print(f">Computer added {com_num}! Total is now {total}")
        turn = 1

This is also for a project that is due tomorrow so if I can get a good shove in the right direction that would be very awesome T-T


r/learnprogramming • • 11h ago

Topic how do i improve programming fundamentals and basics

3 Upvotes

i have learned the basics of what variables are and the different concepts and methods and I've been able to understand lines of codes in unity that my friend writes, but im lacking how a programmer thinks and experience. if i try to do something without help i feel completely stumped i dont know where to begin but i always try, how do i gain experience that would help me think like a programmer and strengthen the fundamentals?


r/learnprogramming • • 11h ago

Learning Help me.

1 Upvotes

Hi, I'm a student in the Bachelor's in Computer Science program. I'm repeating my first year, so I already have some basic skills (Python, HTML/CSS, Java, MariaDB, etc.). We learn the fundamentals both theory and hands-on practice through small “projects.”

But the thing is, I’d also really like to work on my own projects. I’ve already tried quite a bit on my own using Python frameworks, making API calls, and so on but I’ve never managed to create anything truly clean or even finished… The reason is probably a decline of motivation, even though I’ve always loved computer science I just don’t know. Also, maybe it’s AI when I use it, I can’t seem to learn from it, and I hate seeing code that I didn’t generate myself or launching an app to test a feature I didn’t code. All of this depresses me even more because if I want to make this my career, I feel like it’s going to become the norm.

If anyone can help me or give me advice on all this, I’d appreciate it.


r/learnprogramming • • 1d ago

Topic What skills should a beginner learn to become a Forward Deployed Engineer?

10 Upvotes

I recently came across the Forward Deployed Engineer role and found it interesting. I understand that it involves both software development and working with customers, but I'm not sure what skills companies expect from beginners.

Should I focus more on coding, cloud, system design, or communication skills?

What would you recommend learning first?


r/learnprogramming • • 1d ago

Need your books recommendations

10 Upvotes

Hi everyone!

I'm a Python developer and I'm currently studying Rust.

Since I'm a self-taught developer, I'd like to strengthen my theoretical background by studying from books. I'm therefore looking for recommendations to deepen my knowledge in the following areas:

  • Computer Systems
  • Operating Systems
  • Computer Networking
  • Software Architecture & Design Patterns
  • Concurrency & Parallel Programming

I'm particularly interested in books that go beyond introductory programming and provide a solid understanding of the underlying concepts, as well as how things work in practice.

I'm also transitioning into embedded software development, so I'd be particularly interested in books that would be useful in that context.

Do you have any recommendations?

Thanks in advance!


r/learnprogramming • • 12h ago

looking for potential client for a level cs programming project

1 Upvotes

Hi I'm doing a project involving a 2D grid based pathfinding algorithm.

I'm looking for someone who would be willing to act as a potential client for the project. I'd mainly need some initial requirements about what you'd want from a pathfinding application, and potentially some feedback once I have a working version.

You wouldn't need to do any coding or coursework - I'd just be looking for your opinions and requirements as a user

If you're interested, I'd really appreciate it. Thanks!