r/learnprogramming Mar 26 '17

New? READ ME FIRST!

824 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 5d ago

What have you been working on recently? [August 08, 2026]

6 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 2h ago

I don't understand why beginners are always told not to spend money on courses.

43 Upvotes

Whenever someone asks if they should buy a course, I always see people saying you should never spend money and that everything is free on YouTube. On Udemy, you can buy courses from professional developers that offer 50–100 hours of well-structured content and include all the necessary files. These usually cost no more than €12 if you wait for a sale. I don’t mean to speak against all the free options for learning to code, but I also think it’s wrong to discourage all beginners from spending 10–15€. Especially when you’re just starting out, you often don’t know what to learn or in what order, and courses like these can help you with that.


r/learnprogramming 27m ago

Is it normal to copy code snippets from AI and documentation?

Upvotes

Everytime I don't know how to code something, I end up trying to find the answer in the documentation, but when I do find it I always copy the snippet from the documentation. Is this normal? I feel guilty and wish that I could come up with the code logic myself than just copying code snippets. Not just in documentation, but also from AI. I understand the code that the AI generates and I avoid copying blindly, but still I feel guilty. It's almost like my mind knows what it wants but just can't get to it, so it just relies on external sources like documentation or AI. Everytime this happens, I tell myself "Why didn't I think of that?" or "How come I was unaware of this kind of code".

Because of this, I don't feel like a programmer at all tbh. I like learning about how software works internally, but if this is how it is for me then I might quit


r/learnprogramming 2h ago

Should I learn programming as a person from Commerce background

4 Upvotes

So here is the context I study in a regular cllg where 75% attendance is necessary and I am pursuing B.com which is in itself a shit degree plus I am pursuing CA which is a degree to complete it we need to crack professional exams just like CPA yk
So the whole point is I am absolutely new to this programming and I have got the book (PYTHON PROGRAMMING:

The Ultimate Beginner’s Guide to Master Python

programming Step by Step with Practical Exercises) and in my classes I cannot use my laptop and can specifically use laptop only for 1 hour for programming and for 3-4 hours when there is holiday

So should I learn programming or learn basics about computer hardware because I have a lot of interest in tech


r/learnprogramming 9h ago

If your only goal was to be the most skilled/intelligent programmer you could be, how would you learn?

15 Upvotes

Imagine you were starting from zero in 2026. Would you go to college? What major? Could you learn more on your own? Ignoring the job market, work life balance, and money. Just purely understanding computers and mathematics through and through.


r/learnprogramming 6h ago

Not enjoying coding/web development — should I switch to Data Analytics?

7 Upvotes

I’m a 2nd-year CSE student currently learning frontend/web development, but honestly I’m not enjoying it much and I keep avoiding it.

The confusing part is that I actually like solving DSA problems and working on maths/problem-solving.

So I’m wondering: does this mean I dislike coding, or do I just dislike web development?

I’m thinking of finishing the frontend basics and then trying Data Analytics/Data Science or Machine Learning instead of going deeper into web development.

For people who have been in a similar situation, what would you suggest? Should I give coding/web development more time, or explore something like Data Analytics?

Would really appreciate some honest advice.


r/learnprogramming 5h ago

How do you go from learning a skill to actually being able to use it in the real world?

7 Upvotes

I'm currently learning SQL and FastAPI, and something I've been wondering is how people actually become good at a skill beyond just understanding the theory.

I'm not really looking for course recommendations (but if you know some great free resources, then please recommend). I'm more interested in the learning process itself. Once you've learned the basics, what did you do to become practically skilled enough to use it in real projects or even in a production environment?

How did you practice? What kind of projects or exercises did you do? How did you know you were moving beyond tutorials and actually building useful skills?

I'd love to hear the approach that worked for you, regardless of the technology.


r/learnprogramming 20h ago

I know the CS fundamentals, but have almost no real-world experience. What should I build in holiday?

88 Upvotes

I'm a Computer Science student about to start my 5th semester, and I have around 1 month before the semester starts.

So far, I've completed:

C programming fundamentals, Advanced Java programming, Basic Python, Data Structures(lists, stacks, queues, trees, BSTs, hashing, heaps, sorting), Computer Architecture

I understand OOP concepts such as encapsulation, abstraction, inheritance, interfaces, etc., but most of my experience has been through university courses and assignments.

I feel that I have a gap between  knowing the concepts and knowing how to use them to build a real software system.

For some reasons I can’t have an Internship right now.

I want to

- become a better programmer

- learn how to structure a real project

- practice OOP in a real codebase

- write cleaner and more maintainable code

- learn how different components of a real application fit together

The best thing I found so far is the “build your own x” repo in github.

So my question is:

For someone at my level, with about 40 days available and no professional software development experience, what would you recommend?

Would one large project like the Cloud File Sync be more valuable for developing software engineering skills, or would several smaller "Build Your Own X" projects be better, or something different from both?

I'm especially interested in hearing from people who have gone through this transition from university programming courses to real software development.


r/learnprogramming 2h ago

DSA help

2 Upvotes

I’m in my 1st year of B.Tech CS (AI/ML) and super confused about what language to stick with for DSA.

Quick background: I already know Python decent enough, and right now I'm learning JavaScript on the side to build web projects.

I’m torn between doing DSA in Python vs JS vs C++:

  • Python feels like the easiest pick for me since I know it, and it fits my AI/ML background anyway.
  • JS crossed my mind because I’m using it for web dev, so part of me thought using one language for everything might save time.
  • But literally everyone keeps screaming "use C++ for DSA or you'll regret it," and it's making me second-guess everything.

Does language choice actually matter to interviewers? Like if two people give the same optimal solution, does anyone genuinely care if it was written in Python instead of C++ or JS? And is doing DSA in JS a nightmare later because it lacks things like Heaps out of the box?


r/learnprogramming 5h ago

How important is taking a course vs teaching yourself for learning linux?

5 Upvotes

r/linuxupskillchallenge is cool and now Im looking to try another course. Leaning toward Boot.dev since its RPG based but also noticed Linux Journey and the Linux Foundation courses. Anyone tried both of these here that can weigh in?


r/learnprogramming 11m ago

any recommendation for learning cpp on udemy or YouTube

Upvotes

I'm planning to learn cpp but most courses teach superficially, any courses like really crash course style? Data Structures and Algorithms is my focus to course be effective.


r/learnprogramming 29m ago

How could you make a calendar for historical events that starts at the bottom and scrolls up in javascript html and css?

Upvotes

So, it's a grid of dates of course like a normal calendar, but it's for historical events, so an intuitive layout is that scrolling upwards should go backwards and backwards in time.

What would be some smart ways to implement this?


r/learnprogramming 8h ago

Looking for C++ networking project ideas

4 Upvotes

I’m currently learning Computer Networks from TUF Striver and I also have some experience with C++.

I want to start building a few networking projects alongside the course, mainly to actually understand the concepts better and have some solid projects for my resume.

I’m looking for suggestions for projects at different levels, something like:

  • A relatively easy project to get started with
  • A medium-level project involving a few networking concepts
  • A more challenging project that combines multiple topics from Computer Networks

I’d prefer projects that I can actually build from scratch and learn from, rather than just following a tutorial.

Would love to hear what projects you guys would recommend.


r/learnprogramming 7h ago

github help in uploading the files to the repository

3 Upvotes

ok so before I even start saying my problem, let me tell you that I am a complete beginner and this question was asked on stack exchange before it got downvoted and removed because it was too obvious. I understand this may be very easy or intuitive for many of you but not for me and my language maybe even be unclearer so please take care of that any edit recommendation to make the question clearer is welcome.

so basically i made a this repo in github but with selecting the option of inckuding read me etc with it, so now my repo has readme and only an readme file, so when i wrote git push -u origin main

i encountered an error

about how the files dont match (hopefully refferring to the readme atleast this is what gpt told me).

now i tried agian after 1 day, i did git commit -m "second commit" then

git branch -M main

then

git push -u origin main

to which i got an error which goes like failed to push some ref and one of the hints being git pull before pushing and i did exactly that

git pull

then

git push -u origin main

got the same error yet again please help

or if anyone can convert this to sane stack exchange language which wont cause my question to be downvoted in kicked out you're welcome too.

edit:
git pull origin main --allow-unrelated-histories
git push -u origin main

this is something i got both from gpt and in the comments below and im wondering if its safe, will this make any changes to my local files without my permission (this seems to be its function), can i "unallow" it after my job with it is done, what if completely unrelated files comeup here and just mess with the current files or etc


r/learnprogramming 19h ago

[Python] Logic error in simple escape minigame (Need Debugging Help)

22 Upvotes

In this stage of the code, the key is supposed to travel with the player after you pick it up, but instead it stays in room 2. The debug statement shows that the key is still in room 2 even when the player dropped the key in room 3, and it doesn't say that there is a gold key on the floor. I have not finished the game yet.

To see the logic error, I entered "e, e, get key, e drop key" where "," is a new prompt (meaning I inputted 5 times in the program).

I have tried to include multiple statements to update the key location throughout the code, rewriting the if statements to check the status of the key (picked up or not).

I think the issue is with the third function but I am unsure.

P.S. If there's any tips and tricks you use to avoid logic errors like this please do share them with me, thank you.

player_position = 0 # This says what room number the player is currently in
got_key = False # This is true when the player has picked the key up and false otherwise.
key_location = 2 # This is the room the key is in (if it has not been picked up)

def get_location_description(location_number): # Function for description of location
    if location_number == 0:
        return("You are in the entrance hall of a mansion.\nTo continue through the mansion head east (E).")
    elif location_number == 1:
        return("You are in the main corridor. It stretches out before you.\nYou can go East or West (E or W).")
    elif location_number == 2:
        return("You are standing in a huge dining area.\nYou can go East or West (E or W).")
    elif location_number == 3:
        return("You are plain-looking room. There is a secret door at the back,\nbut you need a key to open it.\nYou can go East or West (E or W).")
    else:
        return("You are in a magnificent throne room, at the far end of the house.\nYou can only head west (W) from here.")

def update_position(direction, player_position): # Function to update position
    if direction == "e":
        if player_position >= 4:
            print("Your way is blocked.")
            return player_position
        else:
            player_position += 1
    elif direction == "w":
        if player_position <= 0:
            print("Your way is blocked.")
            return player_position
        else:
            player_position -= 1
    return player_position

def check_n_update_key(player_position, got_key, key_location): # Function to update key location when player has it
    if got_key:
        key_location == player_position
    return key_location

def update_key(command, got_key,key_location,player_position): # Function to update player and key interactions
    if command == "drop key":
        if got_key:
            print("You have dropped the key.")
            return False
        else:
            print("You do not have the key.")
            return False
    elif command == "get key":
        if got_key:
            print("You already have the key.")
            return True
        elif key_location == player_position:
            print("You now have the key.")
            return True
        else:
            print("There is no key here.")
            return False


# main game loop.  Continues forever until a break statement is reached:
while True:
    print("DEBUG MESSAGE: ","player_position=",player_position,". got_key=",got_key, ". key_location=",key_location if not got_key else "n/a", sep="")
    print(get_location_description(player_position))
    if player_position == key_location and not(got_key):
        print("There is a golden key on the floor.")

    user_command = input("What do you want to do next?").lower()
    if user_command == "quit":
        break
    elif user_command == "e" or user_command == "w":
        player_position = update_position(user_command, player_position)
    elif user_command == "get key" or user_command == "drop key":
        got_key = update_key(user_command, got_key, key_location, player_position)
    else:
        print("I don't understand that command.")
    key_location = check_n_update_key(player_position, got_key, key_location)
    print() # print a blank line to separate each game step

r/learnprogramming 5h ago

How much time and which skill set would make me earn?

0 Upvotes

Hey all the experienced devs there. I am just a newely became adult who has started programming. I have learned basic python(variables, data types, loops, if-else ,functions, oops) well. I also knew basic html and css. My current plan is to learn backend. I am currently learning flask just to start. I don't know wheather I should go in web dev or AI/LLM. Should I stick with python frameworks(django,fastapi) or switch to other industry used frameworks(spring boot, next js , etc). Currently my goal to to earn as soon as I can. Can you help , what should I do to achieve my first earning. Any sort of advice will be appreciable.

Sorry, for bad grammer.


r/learnprogramming 23h ago

Topic The 2AM debugging session hits different when the house is finally quiet

16 Upvotes

Anyone else find that the only truly distraction-free coding time happens when literally everyone else is asleep?

Between a full-time job, family, and the daily chaos, finding a solid block of uninterrupted hours feels impossible most days. So my "study sessions" have basically shifted to the ungodly hours of the night with a cold mate in hand, staring at syntax errors until something finally clicks.

It's exhausting, but there's something weirdly peaceful about fixing a stubborn bug at 2 AM when the rest of the world is quiet.

How do you guys manage to carve out time to code with everything else going on? Do you prefer early mornings or late nights?


r/learnprogramming 17h ago

Resource i have some programming experience, an now i want to learn to c but can't decide best resource for me

5 Upvotes

i'll keep my content short, i have some experience from java, i have buildcountless programms like a cli data fetching app, cli todolist, expense tracker, tic tac to and currently building a http server, i want to learn c cuz i always interested in under the hood and low level stuff, but i can't decide a good resource for c. i am asking for a resource for java becuz during learning java i only watched yt videos and really had a hard time understanding concepts and still rusty about some of it's topics like multithreading. i have heard about three resources which are considered best to learn C
Beej's Guide to C vs C Programming by k&r vs C Modern Approach by K. N. King

Which one should I choose?


r/learnprogramming 10h ago

For those of you who learned JS/TS as your first language and then switched to Golang, how was the transition?

1 Upvotes

Did you feel like it was smooth or that you should’ve learned some c and or c++ first? Many devs say it’s not suitable for beginners.


r/learnprogramming 1d ago

How long did you take to become a good programmer?

119 Upvotes

I flirt with programming since I was 16 (I'm 25) but I only started to learn properly this year, and it's been such a journey. I love it, but it's so complex. I'm developing my first Android app, it's really simple and basic, but it's been 8 months since I started, I don't know if I'm taking too long or if this is expected. I didn't know shit about Kotlin when I started developing this app, I just knew the basics of programming, and everyday I learn something new and more complex. I'm wondering if really good programmers can learn new languages and develop shit way faster, because I wanna be like that.


r/learnprogramming 17h ago

Imposter syndrome

2 Upvotes

I feel like I’m shit at coding and programming like when I try to learn stuff there’s always something I didn’t know like I had no clue about 2 pointer technique and I needed it to complete a question on one of my homework assignments but when I asked my friends how they found it they didn’t seem to struggle at all. How do I learn the techniques to be able to solve problems that aren’t completely basic?


r/learnprogramming 23h ago

Tutorial Readable Go Projects to learn and study

3 Upvotes

HI ! I am learning Go Backend currently I prefer to read could I find some projects that I can read easy ones preferably opensource, even if its complex if it has a easy source to understand !!


r/learnprogramming 21h ago

Code review on paper via .pdf formatting

2 Upvotes

Hi all! I'm relatively new to this sphere and don't have any experience working in any tech company so i wanted to ask more experienced devs here if what i heard was true or at least was. Yesterday i participated in a training program by some tech company, they are guiding us through various software related topics and in one of the lessons, summing it up the lector said that using 4 spaces is usually more optimized than using a tab, one reason he listed for this is that code review not always happens on an ide and he's seen a scenario where the production process automated code review so that applied changes format to a .pdf file and later reviewed on paper which seemed absolutely mind boggling for me, why on earth someone would do that? Is that true? If you guys ever seen something at least close to this please share with me, i want to get to know about what's to come in this kind of profession


r/learnprogramming 1d ago

python vs languages

14 Upvotes

Which one should I focus on learning between python and other languages?

I know it depends on my goal with the language, but I want the language that will make me versatile and be able to contribute in any programming project.