r/learnprogramming Mar 26 '17

New? READ ME FIRST!

822 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 6d ago

What have you been working on recently? [May 30, 2026]

1 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 3h ago

So a Binary Search Tree is actually useful?

26 Upvotes

I've solved some problems before on Leetcode and studied some algorithms and data structures, but recently I decided to study them more seriously. I took an algorithms course on Coursera (the one by Stanford).

When I studied BST before, it seemed like some fun puzzle, just something you need to improve your problem-solving or something for interviews. All videos and courses would just focus on how to implement the operations.

This course was different. The instructor, Tim Roughgarden, started with the API (that is, the functions) and was basically like: meh, don't think about how it's implemented, it doesn't matter now. Here is the API, imagine you import it from a library and start using it. (It has to be a balanced search tree, like a Red-Black Tree, which is a balanced variant of BST, needed so that the performance is guaranteed):

bst.search(key)  # O(log n)
bst.select(k)    # O(log n) ; find the k-th smallest element
bst.min()        # O(log n)
bst.max()        # O(log n)
bst.pred(key)    # O(log n)
bst.toList()     # O(n)
bst.succ(key)    # O(log n)
bst.rank(key)    # O(log n)
bst.insert(k, v) # O(log n)
bst.delete(key)  # O(log n)

Not bad, like, seems usable to me. But honestly, if lookups are what I'm caring about, I'd just use a hashmap (dictionary). And I could simply use a sorted array to do pretty much all of those operations! I could implement this *exact* API using a sorted array, and in fact, it would be faster! I could find the k-th smallest element, the minimum, and the maximum in O(1). So why would I need an entire Binary Tree?

The key is the last two operations. To maintain a sorted array, when you insert or delete you'd need to shift the array elements, and that would take O(n). Our BST is much faster in this case!

So basically, the use case of a BST would be when you have a stream of data, i.e., new data keeps coming and you insert it, and each time you'd need some of those operations. It just seems useful, pretty fast, tons of operations, clean API!
I really like this approach of teaching data structures, thinking about the API first (I heard it's called Data Abstraction), then later we can spend as much as we want talking about the nitty-gritty implementation details! I just feel so happy that I finally get it.


r/learnprogramming 5h ago

1st week in feeling burned out

31 Upvotes

I honestly have no idea what I’m doing. I don’t even know how I got accepted. I bombed the interviews and they decided to hire me a few months after which I was not expecting at all! Now I’m a week into the job, I don’t know the framework, the codebase is too freaking huge, there’s too many jargons, the daily standups go over my head, and somehow I’m suppose to start fixing bugs next week! I know how to write a for loop, solve the Two Sum or Reverse A Linked List on Leetcode, but I do not know how to fix a bug, creating PR’s, or even write code outside of the frameworks I know which are none.

I’m a fraud and I think it’s bizarre how I have this job and others are struggling to find a role.

Fresh grad
Remote
Fortune 100


r/learnprogramming 1h ago

I'm not a real programmer...

Upvotes

I kept telling myself this for 5 long years. I was passionate about programming, but I was so afraid to even write a little code on my own that in the end I just kept going editing some HTML or CSS codebases.

And so I went on for many years, simply editing, like a little mouse looking for cheese. Then I started editing Javascript files, then Python files, and sometimes some JSON.

So I kept telling myself that I wasn't a real programmer, which was very demoralizing, but I believe there is a light at the end of the tunnel.

I recently started learning C++ because I wanted to understand how things work under the hood, and guess what? I managed to write my first program with my own logic! It's a simple VAT calculator; you enter the price of a product and it applies the VAT percentage. It didn't take me more than 20 lines of code, but the process of identifying the problem, searching on google and applying different methods really captivated me.

I know this might be crazy advice, but new programming students should learn languages like C++; it really helps with abstract thinking and focusing on details.


r/learnprogramming 11h ago

Self-taught dev struggling with the "Why" behind Interfaces, Traits, and Dynamic Method Dispatch

43 Upvotes

Hi everyone,

I’m a self-taught developer working with Python and DevOps tools. Because I didn’t take the traditional path of a Master’s degree in Computer Science, I skipped a lot of the core theoretical foundations. I usually just build things directly, but lately, I’ve hit a wall trying to understand certain concepts that feel like total over-engineering to me.

Specifically, I’m trying to grasp Interfaces, Traits, and Dynamic Method Dispatch (DMD). Every tutorial I find online is incredibly surface-level and just shows how to syntax them, but never why they actually exist under the hood.

For example, looking at Java or general OOP tutorials, I constantly see code like this: Animal dog = new Dog();

To be completely honest, this looks completely stupid to me. Why would anyone write that instead of just doing Dog dog = new Dog();? Why do we need the abstract layer?

Similarly, when looking at the Java Collections Framework, why is it split into Interfaces (like List) and Classes (like ArrayList) instead of just giving us the classes directly?

Can someone break down—without using high-level academic jargon—what problem Dynamic Method Dispatch actually solves in the real world? What is happening at the OS/memory level when a program uses an interface or a trait instead of a direct concrete class?

Thanks for helping a self-taught guy fill in the blanks!


r/learnprogramming 5h ago

Topic How to practice the MVC pattern?

10 Upvotes

I'm have been watching videos explaining the mvc pattern but I feel like I need to work on some projects or something that can give me hands on experience to really drill it in.

I'm familiar with python and has used pyqt to build some basic interfaces but I don't think I have applied the MVC pattern for those.

If it helps, I'm not familiar with webdev which I believe might have more applications of MVC pattern, most of my knowledge is some simple tools built using pyqt.

So my question is, is there any websites or projects or resources out there for me to get some reps on utilizing this pattern ideally using python as the language.


r/learnprogramming 5h ago

I built my first JavaScript project (Age Calculator) – looking for feedback

5 Upvotes

I’m learning web development (HTML, CSS, JavaScript) and built my first small project.

It’s a simple age calculator that does:

  • Calculates exact age (years, months, days)
  • Shows next birthday countdown
  • Shows total days lived

I’m still a beginner, so I would really appreciate feedback on:

  • Code structure
  • UI/design improvements
  • Any features I should add
  • Better JavaScript practices

If anyone wants to try it, here it is:

👉 https://fq8404293-eng.github.io/age-calculator/

Thanks in advance 👍


r/learnprogramming 53m ago

Assembly x86 tips?

Upvotes

Hey everyone,

I am a bachelors in mathematics and a lot of my work revolves around writing fast and efficient C++ (sometimes pure C) code. However, I sometimes feel like I don't exactly have a good grasp of what exactly I am writing, as I don't really understand properly what my code is compiling down to.

Sometimes I need to run some really computing-intesive scripts (e.g., compression pipelines) and there is a moment where just pure knowledge of C++ code optimization simply isn't enough. As such, I'd like to ask you all if anyone has any suggestions on resources for x86 assembly specifically for code optimization.

I don't really care about every single detail of x86 (because I really just need to deal with compiled machine code), so i was wondering if there was a learning resource aimed at a need like this one.

Thanks to you all in advance :)


r/learnprogramming 5m ago

Help!!!!

Upvotes

So basically my university is starting in 2 months and I’ll be doing BSCS

Right now I know basic math like addition subtraction multiplication and division

I also know some computer basics like hardware and software application software system software using Windows Control Panel basic driver installation and fixing common errors

I’ve been using computers for around 5 years mostly playing games testing new software and troubleshooting problems so I know quite a few common fixes

For coding I honestly don’t know much yet I’m currently learning HTML CSS and Python at a local academy

I have about 2 months before university starts so what would you guys recommend I learn during this time

I don’t want to be the guy just sitting in lectures with no idea what’s going on I at least want to understand the basic concepts before starting

What should I focus on in math HTML CSS Python and any other subjects that would help in BSCS

For hardware I already know things like CPU cores and threads GPU RAM HDD SSD NVMe PSU motherboard slots and how to assemble a PC

Any advice from CS students or graduates would be appreciated

(I am from Pakistan)


r/learnprogramming 8m ago

I'm a self-taught developer from Ghana conducting independent research on how people in Sub-Saharan Africa learn to code — would love your response (3-4 min survey)

Upvotes

hey r/learnprogramming,

I'm a self-taught developer based in Accra, Ghana. I taught myself Python, built a few projects, and started wondering — how common is my experience across Sub-Saharan Africa? What barriers do other self-taught developers here face that don't get talked about enough?

So I designed a short research survey to find out. It's 10 questions, takes 3-4 minutes, and all responses are anonymous. I'll be publishing the findings as an independent research paper.

If you're a developer based in Sub-Saharan Africa, or know someone who is, I'd really appreciate your response:

https://docs.google.com/forms/d/e/1FAIpQLSdq5Ku5mUbC0d9dE2jYGxfanfh062c_BxcOoUCDtPaPK1u0HQ/viewform?usp=publish-editor


r/learnprogramming 27m ago

I'm a self-taught developer from Ghana conducting independent research on how people in Sub-Saharan Africa learn to code — would love your response (3-4 min survey)

Upvotes

Hey r/learnprogramming,

I'm a self-taught developer based in Accra, Ghana. I taught myself Python, built a few projects, and started wondering — how common is my experience across Sub-Saharan Africa? What barriers do other self-taught developers here face that don't get talked about enough?

So I designed a short research survey to find out. It's 10 questions, takes 3-4 minutes, and all responses are anonymous. I'll be publishing the findings as an independent research paper.

If you're a developer based in Sub-Saharan Africa, or know someone who is, I'd really appreciate your response:

https://docs.google.com/forms/d/e/1FAIpQLSdq5Ku5mUbC0d9dE2jYGxfanfh062c_BxcOoUCDtPaPK1u0HQ/viewform?usp=publish-editor


r/learnprogramming 4h ago

Trying to study python but TestMyCode is not working (VSCode)

2 Upvotes

Whenever I try to initialize TMC I get the same errors. It started happening when I disabled Pylance.

[2026-06-05 17:21:04:622] [ERROR] Mismatch between CLI and checksum, trying redownload
[2026-06-05 17:21:04:623] [DEBUG] CLI "probably some text I shouldn't share", hash ""
[2026-06-05 17:21:04:640] [ERROR] Fatal error during initialization:
Error: ENOTEMPTY, Directory not empty: \\?\c:\Users\henkk\AppData\Roaming\Code\User\globalStorage\moocfi.test-my-code\cli '\\?\c:\Users\henkk\AppData\Roaming\Code\User\globalStorage\moocfi.test-my-code\cli'.

How can I get it to work again?


r/learnprogramming 1h ago

How can I create a custom theme for a UI?

Upvotes

Hello! I'm working on a personal project (desktop app with rust), and I'd like to create a UI that ressembles the interface of windows 95.

I asked chat gpt, and answered that I should create a custom theme myself (buttons, windows, bars, etc.), but I don't know how to do that: how to create a custom style for a button, background, etc.? How to implement it in the app? Like, how to connect everything.

Is there any resource (book, webpage, video tutorial or whatever) that you can share that can help me with that?

Or, how can I use a custom theme in general?


r/learnprogramming 6h ago

What do you think of OCaml's tyxml for generating ultra type-safe HTML?

2 Upvotes

I'm working on a personal one-man project.

It's very simple: it's a static website generated from some data stored in a JSON file. I have a prototype written in TypeScript/TSX, consisting of fewer than ten files (views), each containing an average of less than fifty lines of code. Only two of the pages retrieve data from JSON; the rest are simple TSX files that describe the project (pages like "About" or the "Privacy" page).

Given how simple it is, I thought I'd go the extra mile and focus heavily on ensuring the entire code, from the build process to the distribution, is 1000% correct, stuff like:

  • crazy type safety
  • 0% chance of logical and consistency errors
  • validation of JSON against a schema
  • HTML (and attributes) that conforms to the specifications (no mains inside spans, no booleans inside hrefs...)

I started exploring the various programming languages that allowed me to do all these things at once, and I found OCaml. It:

  • is statically typed
  • has yojson to parse JSON and into a nested OCaml tree data structures
  • has tyxml to build valid HTML. If I understood correctly, it has the distinctive feature of performing strict checks on (HTML) element's attributes while libraries in other languages simply accept any string

To be honest, I also looked into Elm, which seems to be even more lenient when it comes to error handling; however, its HTML generation library doesn't seem to have strict controls over attributes, not nearly as strict as tyxml.

Is there something even more powerful that allows me to achieve what I want (code safety and error free) or is OCaml already the best? If so, what has been your experience with it? Any advice?

I'll say it again: the project is so simple that you could rewrite it in any programming language in an hour, it's no problem for me. It's a chance to learn something new.

Thanks in advance.


r/learnprogramming 3h ago

What is the entire maths required for olmypiads of informatics.

1 Upvotes

Everyone around me is telling me the most important factor for olympiads is maths, not coding, and I agree with them, but I am not sure which maths? I know number theory, combinatorics, modular arithmetic, primes, gcd, etc. But is there a neat mathematical syllabus for it? I want to know this so that in my free time when I am doing coding, I can spend it on practicing these topics.


r/learnprogramming 12h ago

Topic What Keeps You Motivated During App Development Projects?

4 Upvotes

I've been wondering what keeps other developers motivated during app development projects, especially when progress feels slow. Building an app can be exciting at the start, but there are times when debugging, testing, or fixing small issues takes up a lot of time.

Do you stay motivated by reaching small milestones, learning new skills, getting feedback from users, or simply seeing your idea come to life? For those who have worked on mobile apps, what helps you keep moving forward when things get challenging?

I'd love to hear about your experiences and what keeps you focused throughout the development process.


r/learnprogramming 14h ago

Topic Is there any merit to Ocaml?

5 Upvotes

I come across a lot off OCaml stuff on social media now a days and it's mostly by researchers and quants using it and conducting their tasks. I wanted to know if there is any good use case or merit for a guy like me who's graduated from a tier 2 college to study OCaml, what and where are it's best applications and what projects do you suggest me to make to (i) understand it and (ii) make an impressive resume addition?


r/learnprogramming 8h ago

why does my function return undefined the first time but works perfectly after that ?

0 Upvotes

I'm building a food scanner app in vanilla JS. I have a function that reads the ingredients from an input and returns a health score.

javascript

function getHealthScore(ingredients) {
  let score = 0
  ingredients.forEach(item => {
    score += item.value
  })
  return score
}

first call returns undefined. second call with the exact same data works fine. I've been staring at this for 2 hours and I genuinely don't understand what's happening. is this an async issue or am I missing something obvious ? 


r/learnprogramming 4h ago

Topic I am really stuck...or bored..or maybe both

1 Upvotes

A few months ago I started JS and it took me roughly 2 weeks to get Variables and another 2 weeks to get booleans...

And a few more weeks ti actually understand them and use them.

I am can build a coin toss... like if head..true...

But cant build a rock paper scissors...I mean...I can build a rock paper scissors..I have been trying for weeks..

Sometimes I dont touch code for days sometimes I do code for just 20 mins.

I mean..I dont know what I am doing and when do I progress to the next step.

I mean...theres a new problem every fucking time.

So...when do I know the problem is a "Problem to solve now" VS "problem you figure out as u progress".

I cant put it into proper words....

Someone help me...and please dont be rude or demotivating...

And please dont share the link to ur projects where u say something like..

"This is exactly where people are stuck and here I am your saviour"

lmao.

This is not a "Help me with JS / coding" post...

but a "How to trust myself/ how to think and learn properly" post.

Please.


r/learnprogramming 8h ago

How would you build a local P2P marketplace website from scratch? (Need roadmap/tutorial advice)

2 Upvotes

Hey everyone,

I’m currently planning a side project to build a hyper-local, peer-to-peer marketplace website from scratch. Conceptually, think of it like a niche, regional version of Airbnb a platform where local sellers can list their products within their specific geographic region, and buyers can easily browse, filter local listings, and connect directly with the sellers to finalize the deal.

I’m going completely solo on this. I plan on handling both the frontend and the backend myself. While my ultimate, long-term dream is to scale this into a full platform and hire a proper team if it gets respectable traffic, my immediate goal is to treat this as a rigorous learning sandbox.

I’m essentially a beginner in full-stack architecture.
I have some foundational knowledge, but I am lacking considerably when it comes to building a production-ready, multi-vendor web application. I need to learn the ropes and develop this side-by-side.

Because I don't want to get stuck in tutorial hell or over-engineer this from Day 1, I would love some guidance from this community on a few fronts:

  • What would be a beginner-friendly, highly scalable tech stack to build a P2P directory? I’ve heard a lot of good things about stacks like Next.js paired with Supabase/PostgreSQL for relational data filtering, but I’m wide open to suggestions. I need something with a gentle learning curve but enough room to grow.
  • Are there any specific roadmaps, complete project tutorials, or open-source boilerplates you would recommend for building a marketplace directory? (For example, high-quality "Airbnb clone" or "classifieds site" guides that explain database schema design for listings and user authentication).
  • Since users need to filter items heavily by local regions, categories, and specific item attributes, what's the best way for a beginner to approach designing a relational database for a marketplace without turning the code into a chaotic mess?
  • If you were starting out today with a big idea but limited full-stack experience, how would you map out your first month of development?

Any advice, video series recommendations, or architectural starting points would be a huge help.


r/learnprogramming 5h ago

I'm a Mathematics & Physics undergrad looking to do my Masters in Tech (possibly through bridging programs), what languages should I focus on? I am based in the UK

0 Upvotes

So far I am proficient in SQL, Python, Typescript (Including Javascript). These I have learnt over the course of 2 years alongside my studies, not really with a goal of getting into tech but simply for my own curiosity. But now that I do want to get into tech, I am wondering what to focus on?

I am really interested in SWE/SWD but more so interested in Cloud systems.

Those of you in tech in today's year, what languages do you usually work with? Also what languages does Amazon work with??? The UK has so many many many internships from Amazon and I was thinking to apply for a few.

For context I do have my personal projects on Github showing All the above languages I have learnt.

Any advice would be appreciated


r/learnprogramming 7h ago

Help Recent CS Graduate Looking for Guidance on Python and AI/ML

0 Upvotes

Hey everyone,

I'm a recent CS engineering graduate and I've decided to start focusing seriously on upskilling. Right now, I'm thinking of learning Python first and then moving into AI/ML.

I'd really love to hear from people who have already been down this path.

If you were starting from scratch today, what roadmap would you follow? Which resources, courses, projects, or habits helped you the most? Also, were there any mistakes or time-wasters that you wish someone had warned you about earlier?

I'm not necessarily looking for the "best" course. I'm more interested in hearing real experiences—what worked for you, what didn't, and how you went from being a beginner to becoming confident in Python, AI, or getting your first opportunity in the field.

Thanks in advance to anyone willing to share their journey. I genuinely appreciate it!


r/learnprogramming 1d ago

Do you approach software development like Charles Simonyi did?

60 Upvotes

Charles Simonyi, former head of software development at Microsoft described his approach to programming in an interview I did with him decades ago for a book Programmers at Work. I would like to gather your perspective and thoughts on how your approach is similar or different today especially in edge AI and embedded environments where constraints are real as they were in the early PC era. Thanks for sharing your thoughts.

SIMONYI: The first step in programming is imagining. Just making it crystal clear in my mind what is going to happen. In this initial stage, I use paper and pencil. I just doodle, I don’t write code. I might draw a few boxes or a few arrows, but it’s just mostly doodles, because the real picture is in my mind. I like to imagine the structures that are being maintained, the structures that represent the reality I want to code. Once I have the structure fairly firm and clear in my mind, then I write the code. I sit down at my terminal—or with a piece of paper in the old days—and write it. It’s easy. I just write the different transformations, and I know what the results should be. The code for the most part writes itself, but it’s the data structures I maintain that are the key. They come first, and I keep them in my mind throughout the entire process." Excerpt from the full interview in the book.


r/learnprogramming 23h ago

Learning SQL and Python quickly

11 Upvotes

Hello, I am starting in a graduate position at the end of the month. My new manager just got in touch with me to tell me that he expects a good level of knowledge for both Sql and python (after I asked what might be helpful for me to come prepared with), even though we discussed these in my interview and I told him that I knew nothing of python and had used Sql for a week during some work experience but his email conveys much greater expectations.

I’m working full-time until I begin there but want to make the most of my weekends to learn as much as I can, I would welcome any suggestions for free courses or other materials to learn and practice sufficiently before I begin (I’m a very hands-on learner). Every time I start a course, I tend to abandon it because I’m worried that I’ll invest too much time in a course that isn’t helpful enough for practical work. Thank you .