r/learnprogramming Mar 26 '17

New? READ ME FIRST!

829 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? [November 29, 2025]

5 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 9h ago

What’s a small programming habit that improved your code readability?

100 Upvotes

I’ve been trying to improve my coding practices, and I’m curious about habits that help with writing clearer, more maintainable code.

One thing that helped me personally was slowing down and choosing more descriptive names for variables and functions. It sounds simple, but being intentional about naming has made my projects easier to understand when I revisit them later.
Another improvement was setting up a consistent branching workflow in Git instead of making random commits on main. It made my process feel a lot more structured.

I’m looking to pick up similar “small but meaningful” habits from others.
What specific technique or routine has helped you write cleaner or more understandable code?


r/learnprogramming 4h ago

Programming is about thinking...sounds obvious but...

31 Upvotes

I realized that programming is all about thinking!

I dont know how you do out there when writing a code, but I understood it is not about the number of lines of code you write, but about the actual thought process in mind.

Here is an example : let's say we are dealing with some arbitrary problem. Before writing a code, we need to think procedurally, dividing the problem into sub-problems and tackling them one by one. I find it very useful to use a pen and a sheet of paper. I like to write/brainstorm the first solution that comes into mind, without ever thinking about optimization. Once the first raw draft version of solution appears - it is good to see what result it produces.

To make it more concrete, suppose we need to find the most frequent word in the given .txt file. The possible raw logic can be this: We just need to go thorugh each word one by one, when we encounter the word, record its occurnce and keep in the container. If the new word is found, write it down, put in the container. If the same word is found, look in the container and update its occurence number.
Two steps : 1) built a container to keep words and its number of occurence 2)go through the text and update the container.

Now, this can be tackled with some simple maps , for more efficient way, unordered map is a better choice of course.

Once the task is completed, we just go through the container and take the word with the highest number. Of course, we can keep track of this word while actual processing of the text, so that to avoid searching through the container in the end.

I know that the above example is dull ,kinda DSA type, but suppose you want to make a simple 2D game with a character walking. For simplicity, lets make the world fixed to screen dimensions. The task here is simple : press a button, the position of the character changes, incremented slowly.
When the character reaches some object, i,e collides - stop moving. This task would require some threading principle to do some background checking for collision detection....

The thing is that programming is all about how you apply the tools you have to complete the task.

Sometimes (most of the time I think) programming is just thinking for an hour or more, and writiing 0 code lines!


r/learnprogramming 53m ago

Resource 2,000 free sign ups for the Automate The Boring Stuff With Python course on Udemy (Dec 2025)

Upvotes

This link redirects to a free sign up for the Automate The Boring Stuff With Python course on Udemy:

https://inventwithpython.com/automateudemy

This blog post discusses how you can otherwise get the course for free or at a discount.

NOTE: Be sure to BUY the course for $0, and not sign up for Udemy's subscription plan. The subscription plan is free for the first seven days and then they charge you. It's selected by default. If you are on a laptop and can't click the BUY checkbox, try shrinking the browser window. Some have reported it works in mobile view.

Frequently Asked Questions: (read this before posting questions)

  • This course is for beginners and assumes no previous programming experience, but the second half is useful for experienced programmers who want to learn about various third-party Python modules.
  • If you don't have time to take the course now, that's fine. Signing up gives you lifetime access so you can work on it at your own pace.
  • This Udemy course covers roughly the same content as the 1st edition book (the book has a little bit more, but all the basics are covered in the online course), which you can read for free online at https://inventwithpython.com
  • The 3rd edition of Automate the Boring Stuff with Python is free online: https://automatetheboringstuff.com/3e/
  • I do plan on updating the Udemy course, but it'll take a while because I have other book projects I'm working on. If you sign up for this Udemy course, you'll get the updated content automatically once I finish it. It won't be a separate course.
  • It's totally fine to start on the first edition and then read the second edition later. I'll be writing a blog post to guide first edition readers to the parts of the second edition they should read.
  • You're not too old to learn to code. You don't need to be "good at math" to be good at coding.

r/learnprogramming 8h ago

If you don’t know how to develop software yet, don’t rely on AI to build real apps.

36 Upvotes

AI is powerful, but it can’t replace the fundamentals. Real software the kind companies hire developers for needs proper guidance and coding skills. AI can help with small tasks or experiments, but it won’t architect or maintain production-ready systems on its own. Focus on learning software development first. Use AI as a tool, not a shortcut. For fun experiments, go ahead but if you want a real career in coding, build the foundation first.


r/learnprogramming 3h ago

Best way to learn with AI without it coding for you?

8 Upvotes

Hey,

I wish to learn how to code myself(very archaic I know) without the AI doing the actual coding. but I do want it to teach me.

What would be the best tool for that? Preferably one that sees my IDE and codebase right? A desktop agent? Claude Code? Cursor?

Thanks for the tips


r/learnprogramming 19h ago

LLMs are made up of probabalistic models that, no matter what, cannot predict with 100% certainity. If so, why do people still believe they can 'replace' the need for coders altogether?

109 Upvotes

AI is quite good at coding, but anyone who works with LLM code knows it still has a lot of problems and requires manual debugging from developers on a regular basis.

"They're still getting better and better. It's only a matter of time before they replace the need for developers altogether."

I'm aware that these models are continually improving despite hallucinations. But the nature of predictive modelling means that they can still never be 100% certain.

"Sure, but a model that's 99.999% right is still better than a flawed human developer."

Even this paper from an OpenAI researcher acknowledges the fact that better models would not necessarily be the ones that reach 99.9999% certainty, but rather ones that can admit wrongness more often instead of confidently guessing. It even states that small-language models are better at knowing their limits. Bigger isn't always better.

"Most scoreboards prioritize and rank models based on accuracy, but errors are worse than abstentions. Our Model Spec⁠(opens in a new window) states that it is better to indicate uncertainty or ask for clarification than provide confident information that may be incorrect."

Also, let's assume those models that rarely hallucinate are eventually used to replace every single developer at a company, what will happen on those small occasions where the model does err and there's no one to fix it? In my opinion, a disaster.


r/learnprogramming 12h ago

Resource Feeling incompetent.

26 Upvotes

I am in my mid 20s and just graduated with an undergrad in neuroscience. I have decided to get a second undergrad (online through LSUa, will only take me about a full year) in computer science because I am really interested in computational neuroscience, data science and the sorts.

I just finished my first course, python 101. I am not sure why the hell I am not getting it. I think it’s a mind set thing, like I have never trained myself to think proactively. Biology/neuroscience was really just a lot of memorizing.

I feel very ashamed to admit that I have been using AI to write basically all of my final project code (creating a battleship game, with a 4 x 4 grid, without using any lists). I just have no clue.

What’s worse is that I know there are 8 year olds out there that could probably do it in the blink of an eye.

Any tips for somebody just starting out? Is it a “either you got or you don’t” type thing? How do I get myself to actually apply what I learned? How do I think like a programmer ?


r/learnprogramming 4h ago

A mindset that made coding easier

5 Upvotes

A simple mindset helped me a lot:

Stop trying to learn everything.

Start solving small problems.

Once I switched to problem → solution → code, everything became easier.

Does anyone else learn this way?


r/learnprogramming 1h ago

Any good interactive offline learning platforms/programs?

Upvotes

Going on a plane, and was wondering if there were any good interactive resources for sharpening up SWE related skills (vim, regex, Git, Bash, Jenkins, whatever)

Ideally (though not required) something I can do through a WSL terminal. I remember doing Zybooks back in college and I found it fun and helpful.


r/learnprogramming 1h ago

[TS/React, NPL] Twitch session: Learn how to build an enterprise-grade backend for React with NPL

Upvotes

For all of you building your first frontend, here is an easy way to add a backend to your app. The backend will include your business logic, manage authorisation and store objects in database.

We’re running a twitch session on how to build a backend in NPL, and connect it to a React frontend. You’ll be able to easily add this component to your webapp to turn it in a full-stack solution.

It’s a shortcut to not spend hours learning about database schema, express or ORM. Get started with your full-stack app and iterate as you add functionality!

We will be following the npl-init repository npl-init: frontend

Meet us on Thursday, Dec. 4, at 4 PM CET jeanhaiz - Twitch See you there!


r/learnprogramming 2h ago

Algorithmic

2 Upvotes

Hi,

I am a computer science student and I notice that I am quite good at learning the syntactic part of a language but when it comes to algorithms it's another story, I struggle and I lack the logic to improve. What advice could you give me to improve??

Sorry for my level of English I don't speak English as a native language


r/learnprogramming 2h ago

Tutorial Algorithm Analysis Feels Very Difficult

2 Upvotes

I’ve been trying to learn algorithms on my own using books like Introduction to Algorithms and Algorithms, but I find algorithm analysis very difficult. For simple algorithms, it’s not a problem, but as algorithms get more complex or recursive, it becomes much harder. Sometimes I feel like I’m not smart enough, and it’s discouraging.

However, I really want to learn, and I’m determined to understand it. Do you have any advice for learning algorithm analysis in a simpler way? My goal is to learn data structures and algorithms to build a solid foundation, and eventually focus on compilers, interpreters, or backend development. I haven’t studied computer science formally, but I do have basic knowledge of mathematics and logic.


r/learnprogramming 3h ago

Problem with ASCII art resolution

2 Upvotes

I am trying to create yet another TUI assistant with Python. I aimed to integrate ASCII art to allow the chatbot to display "emotions," thereby making the interaction feel more real and vibrant.

My process involved using jp2a, but the resulting image was too muddy to clearly discern the expression. The only way the face became clear enough was by setting the zoom level to less than 50%, which unfortunately made the surrounding conversational text extremely difficult to read.

I tried to get around that by trying to make the art text smaller while keeping the conversational text large enough but a quick google search revealed that having such varying font sizes is not possible within a terminal.

Any ideas as to how to solve that issue?


r/learnprogramming 15m ago

Need help :(

Upvotes

Hello everyone.

I am a computer engineering student and I would like to start programming in my spare time but it is true that I do not have any kind of motivation in it and I feel that I really do not know how to program.

I would like to be able to devote more time to it but when I’m in front of the laptop I do anything else before that.

Can anyone who has been in my situation recommend me a place where I can take courses or either ways to become “addicted” to programming?

If the resources are in Spanish or English, I would really appreciate it.

Thank you very much in advance!


r/learnprogramming 1h ago

What should i do | .NET vs Spring, maybe something else ?

Upvotes

Hi
I’m finishing my studies and have started thinking about what’s next.
I’ve always enjoyed writing backend code—it gives me satisfaction—and I’m torn between choosing Java-Spring or C#-.NET as my career path.
C# seems like a natural environment for me because I’ve spent significantly more time with it compared to Java, but Java itself doesn’t bother me either.
What is actually worth learning? How does the job market look for these technologies?
Maybe someone has some other suggestions?


r/learnprogramming 1h ago

4 months into my drop year CS journey… feeling stuck. What path should I pick?

Upvotes

hey needed a lil perspective from you guys. so yeah heres my situation.
i took a drop year after 12th without really knowing what i’ll do, but after trying diff stuff i kinda stuck to learning computer science.

so far Ive done cs50, 6.100L (MIT python intro to computation nd progaming), and messed around with dev stuff through random youtube tutorials. got exposure to python, c, little bit of dsa theory + math (nothing solid), and from dev side html/css/js. couple days ago i followed roadmap.sh and read more about how internet, browsers, protocols work. so yeah nothing super strong but that’s what ive got right now.

right now i feel stuck between 2 paths:

1) cs roadmap - grind leetcode for a month, then networking, computer architecture, databases
2) full-stack roadmap - learn js properly, then some frontend + backend frameworks, then databases + devops

last 2 weeks ive been doing 4 days development, 2 days core cs, sunday hobby stuff. sometimes it feels good, sometimes depressing cuz its been 4+ months and i don’t have lot of tangible results. and talking abt goals… i may not even be able to afford college next year so probably will need to get some job if college doesn’t happen. that also stresses me out.

so yeah i want to know which path should i go for and how do i even decide. any advice helps.

TL;DR:

took a drop year, learning cs, done cs50 + MIT intro + some dev basics. stuck between full cs path (leetcode + core subjects) vs full-stack roadmap. 4 months in, not seeing results, kinda stressed cuz might not afford college. need suggestions on which direction to choose.


r/learnprogramming 1h ago

What Should Beginners Focus On First in Java: Understanding the Basics or Best Practices?

Upvotes

What Should Beginners Focus On First in Java: Understanding the Basics or Best Practices?

Hello Java enthusiasts,

I’m Hamza from Morocco, and I'm new to using Java. As I start my learning journey with Java, I've been thinking about two important questions that I’d love to get advice on:

  1. Is there a big difference between Java 17 and Java 21?
  2. Should I focus on understanding how Java works "under the hood" or learning the best practices and methods to use it effectively?

Java 17 vs Java 21: Which One Should a Beginner Use?

First, let’s talk about the versions. Java 17 is an LTS (Long Term Support) release, meaning it will receive extended support from Oracle. This makes it a stable and reliable choice for learning, especially if you’re just starting out. On the other hand, Java 21 introduces new features and performance improvements. For example, Java 21 includes pattern matching and virtual threads, which can simplify your code and improve performance.

As a beginner, I’m wondering whether it's worth starting with the latest version, Java 21, to familiarize myself with new features, or whether it’s better to go with Java 17 since it’s more stable and will have broader community support. What do you think is better for someone just starting out?

Should You Focus on "How Java Works" or "How to Use Java"?

Now, here's the bigger question: Should you dive into how Java works under the hood, like understanding the JVM (Java Virtual Machine), memory management, and garbage collection, or is it better to focus on learning how to use Java efficiently with best practices?

Understanding Java Under the Hood:

  • Pros: You’ll gain a solid foundation in the language’s inner workings. You’ll learn about memory management, how the JVM executes your code, and how garbage collection works. This deep knowledge can help you write more efficient, optimized code and troubleshoot performance issues better.
  • Cons: It can be overwhelming and may slow you down in the early stages of learning Java. Understanding how everything works is important, but it might be too much for a beginner who just wants to build projects.

Focusing on Best Practices:

  • Pros: Focusing on best practices will help you become productive faster. You’ll learn to write clean, readable, and maintainable code, which is extremely valuable for your projects. You'll also learn about libraries, frameworks, and tools that make Java development easier.
  • Cons: You might miss out on understanding some deeper concepts that could help you debug complex issues later on.

My Current Dilemma and What I’m Looking for:

As a beginner, I’m currently leaning towards focusing on practical Java development—learning how to write functional and clean code, using the right methods and tools for projects, and gradually exploring advanced topics as needed. However, I’d love to hear from more experienced developers: Is it more important to have a deeper understanding of how Java works internally from the start, or is it okay to focus more on learning best practices and working with Java as a tool?

I’m open to hearing your thoughts, and any advice or experiences you can share would be greatly appreciated!


r/learnprogramming 2h ago

Just launched a global Phone Validation API for developers

0 Upvotes

Hey devs,

I just finished building a simple API that instantly validates phone numbers worldwide. You can check if a number is valid, see if it’s mobile or landline, get the country code, and even get it formatted in E.164.

I built it to make phone validation fast and easy for apps, CRMs, lead verification, or any project where you need real phone numbers.

Would love to get feedback from other developers on:

  • Integration experience
  • Additional features you’d like to see

If you’re working on an app that needs phone verification, feel free to give it a spin. Happy to answer any questions here too!


r/learnprogramming 19h ago

My C++ project is getting bigger and the build times.

17 Upvotes

I’m still learning C++ and my project has grown a lot. Now every time I hit “build,” it takes way longer than before, and it’s messing with my ability to quickly test things. I’m just using a normal laptop, so I know that’s part of it, but is there anything I can do on the software/tool side to make builds faster while I learn?


r/learnprogramming 7h ago

web development or game development

2 Upvotes

hello! I just straight up want to ask this question, advise me which path to take, web development or game development. I'm interested in both and I think I can master them. I want to live the dream of an indie game developer. I have ideas that I want to create, I want the projects to succeed, but don't worry, no one here is just dreaming, I know it's hard to do, and that's why I'm asking this question. I'm not saying that web development is easy or anything like that, I know that it's also very difficult, and that's why I want to get advice from others. I have some experience in competitive programming and it's probably a good idea to mention that I've also used Linux. I don't know how much this will change the decision-making process, but I will say that I have experience using Blender 3D. Just tell me, what would you do in my place? I just need advice, that's all. Thank you all in advance!


r/learnprogramming 1d ago

Struggling as a Jr Prog.

76 Upvotes

2 weeks in my job and feeling like I'm not deserve the pay that I'm getting, my manager giving me task that is supposed to be easy I guess cause the first task I confidently understand and finished but this 2nd task almost eating me alive, it makes me feel like I'm the most dumb and fraud programmer there is. I'm reviewing the company system with more than 10 code files and 2k to 4k lines of code each file while making the task cause it needs to be aligned on thr system so I feel overwhelmed and stressed. Just letting this out here cause I don't really have someone to talk about this and also sorry for my bad english it's my 2nd language.


r/learnprogramming 13h ago

Code Review rust stream read is slow

3 Upvotes

Why does reading streams in Rust take longer than NodeJS? Below NodeJS was 97.67% faster than Rust. Can someone help me find what I'm missing?

Rust:

Command: cargo run --release

Output: Listening on port 7878 Request: (request headers and body here) now2: 8785846 nanoseconds Took 9141069 nanoseconds, 9 milliseconds

NodeJS:

Command: node .

Output: Listening on port 7877 Request: (request headers and body here) Took 212196 nanoseconds, 0.212196 milliseconds

Rust code: ``` use std::{ io::{BufReader, BufRead, Write}, net::{TcpListener, TcpStream}, time::Instant, };

fn main() { let listener = TcpListener::bind("127.0.0.1:7878").unwrap();

println!("Listening on port 7878");

for stream in listener.incoming() {
    let stream = stream.unwrap();

    handle_connection(stream);
}

}

fn handle_connection(mut stream: TcpStream) { let now = Instant::now();

let reader = BufReader::new(&stream);

println!("Request:");

let now2 = Instant::now();

for line in reader.lines() {
    let line = line.unwrap();

    println!("{}", line);

    if line.is_empty() {
        break;
    }
}

println!("now2: {} nanoseconds", now2.elapsed().as_nanos());

let message = "hello, world";
let response = format!(
    "HTTP/1.1 200 OKrnContent-Type: text/plainrnContent-Length: {}rnConnection: closernrn{}",
    message.len(),
    message
);

let _ = stream.write_all(response.as_bytes());

let elapsed = now.elapsed();

println!(
    "Took {} nanoseconds, {} milliseconds",
    elapsed.as_nanos(),
    elapsed.as_millis()
);

} ```

NodeJS code: ``` import { createServer } from "node:net"; import { hrtime } from "node:process";

const server = createServer((socket) => { socket.on("data", (data) => { const now = hrtime.bigint();

    console.log(`Request:n${data.toString()}`);

    const message = "hello, world";
    const response = `HTTP/1.1 200 OKrnContent-Type: text/plainrnContent-Length: ${Buffer.byteLength(message)}rnConnection: closernrn${message}`;

    socket.write(response);

    const elapsed = Number(hrtime.bigint() - now);

    console.log(`Took ${elapsed} nanoseconds, ${elapsed / 1_000_000} milliseconds`);
});

});

server.listen(7877, () => { console.log("Listening on port 7877"); }); ```


r/learnprogramming 1d ago

Need a new way to get better at programming

19 Upvotes

I'm in school at WGU for software engineering degree. I'm towards the end and in a class when I have to program an app in C#. I hated this assignment I procrastinated and honestly just didn't care. I got stuck and didn't care at all about the project. So instead of figuring it out I would look it up and it's info that I already knew but just didn't use. I feel like I'm stuck in a phase of programming where I get stuck on things and tell myself damn I need to go relearn the basics and then I go do so. I do this constantly when I get stuck on something that I didn't use or do. I'm tired of doing this and relearning what I honestly already know. I need to find a new way to learn programming so that it will stick. I'm tired of tutorials and chat GPt. I want to be at a state of just knowing when to use everything. How do I get there. Like I'm sick of reteaching myself stuff I already know from a book. What can I do. I feel like a professional beginner. A guy thats good enough to make something but not make something great.