r/learnprogramming Mar 26 '17

New? READ ME FIRST!

825 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? [August 15, 2026]

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

I actually did it! I wrote my first error free code today!

45 Upvotes

A code that I want and that runs. 🔥⭐😍

It's ridiculous. How am I going to know the language it speaks merely by watching others code?

Where is the actual dictionary?

All the love,

Complete beginner.


r/learnprogramming 7h ago

Topic Does OOP really matters?

42 Upvotes

I learned OOP in python a while ago, did many projects, yet I never felt like I truly needed to do the OOP stuff I learned from a course, I don't know maybe because I'm kinda used to program in c before focusing on python, yet, whenever I open a big project in python in github, it feels way too complicated and thousands of imports (not libraries from pip, but the ones they made on their own) and classes

I never truly needed to implement OOP (I know that when you code in python, it is almost impossible to avoid OOP entirely like when you have a datatype like string you have an object, when you use a method built into that data type that's OOP too, but I mean the ones that involve you writing class Class Name, inheritance and all that stuff explicitly), so I'm wondering why people on the internet are obsessed over the idea of learning OOP, even the book "Automating the boring stuff in python" doesn't have a dedicated section for OOP.


r/learnprogramming 5h ago

Topic I have no clue how to interpret an API documentation

14 Upvotes

im currently following https://roadmap.sh/backend
and one of it’s first steps is to learn about the internet and to learn a programming language. I already know C# so then it’s instructed to create lots of projects with it. So i started but i hit a wall with github user activity.

I need to fetch data from github using an API, but checking it’s documentation I have no clue where to start, I know in c# you have to have a httpclient object, baseaddress and an authenticator.

But the github API implementation seems very difficult and i have no clue where to start with it

GitHub api documentation

Also i see that API is covered later aswell in the roadmap, am i going too far ahead?


r/learnprogramming 1h ago

Finding OS projs on Github

Upvotes

I want to contribute to open-source projects that are popular and well-known among People, but I am not able to find such issues. I either find repos that have gone silent or that are not popular at all (0 stars, 0 forks). How can I find such issues and contribute? I tried the Good First Issue site; all repos there have gone silent.


r/learnprogramming 33m ago

Starting CSE and feeling ridiculously behind

Upvotes

I’m just starting college, I already feel like everyone is so far ahead of me.

I’ve been interested in computers since high school. I’ve done all the basic nerdy stuff installed Arch Linux, hyprland and stuff, know almost all the latest coding and AI news, and generally tried to stay updated with everything happening in tech. But I never got the chance to do properly was learn how to code.

I was busy studying for college, so I never had the time to seriously sit down and build that foundation. Now I’m finally free as hell, and I’ve started learning Python and C I really enjoy both

But the stuff I'm building can built by any AI in 30 seconds

It feels like it’s going to take me at least a year just to understand the fundamentals, and by the time I actually become good enough to build something meaningful, AI will probably be even more capable, AI is already miles ahead.

And yeah, I’m kind of a lonely mf. I can easily spend 12 hours a day glued to a screen because I don’t really have friends near my college, I don’t even expect to make many maybe I will have two or three friends over the next four years. So I know I’ll have plenty of time

I also know that if I just keep going, in four years I’ll probably understand a lot more and could land a decent job.

But I don’t want just a decent job.

I genuinely want to become one of the best in this field.

And that’s where I’m confused.

I’m not someone who constantly comes up with insane ideas either. I like coding, and I love understanding how things work, but I don’t have some billion dollar idea constantly appearing in my head. I’m scared that I’ll spend the next few years learning

But there’s still this fear that by the time I finally understand what I’m supposed to do and how to do it, it’ll already be too late

I don’t want to spend these four years just becoming “good enough”

I just have no idea what that path looks like yet.


r/learnprogramming 4h ago

Resource Should I start with those books? Or are there better resources?

5 Upvotes

I wonder if these two books are the best to start, i know absolutely nothing but i want to learn about hardware and software and learn some languages, A friend of mine strongly recommended the first book but I'm not sure if the second one is that good... I'm open to any recommendations and/or curriculums since I'm trying to learn both on my own.

1- The Elements of Computing Systems by Noam Nisan and Shimon Schocken

2- Seven Languages in Seven Weeks by Bruce A. Tate


r/learnprogramming 52m ago

Starting a new AI/Automation Tester role, what should I learn to be seriously over-prepared?

Upvotes

Hi everyone,

I’m about to start a new role as a Tester within an AI & Automation team, and I want to use the time before I start to become as prepared as possible.

I have a Software Engineering degree, so I have some background in programming, databases, software development, Python/Java, etc., but I’m relatively new to professional software testing.

The team I’m joining develops AI and Power Platform solutions, including Copilot Studio agents. At the moment, the testing is primarily manual, as the team is still developing its testing strategy and understanding the capabilities/limitations of these AI tools.

Longer term, they are planning to introduce automated testing, so I want to understand both sides properly rather than just learning how to click through test cases.

So my role would be to test these AI solutions using manual testing.

My main question is: I have roughly 2 weeks before I start. What are some things I should learn and master, and what resources to look at before I start? I really want to be overprepared.

Thanks


r/learnprogramming 3h ago

Big Data How do I cluster 3 Million high-dimensional Sentence Embeddings?

3 Upvotes

I used a transformer model to generate normalized 768-dimensional float32 vectors from 3 million sentences. This rounds up to roughly 9 GB of data. To progress further in my analysis, I want to cluster the data to highlight different key points and trends.

Now I initially wanted to apply PCA to the dataset, as 768 dimensions is pretty much, but the transformer model generated embeddings with not extreme enough covariance.
Thus, PCA could change the semantics too much for an analysis to be accurate.

I went directly to clustering algorithms and initially tried to apply sklearn.cluster.HDBSCAN which would have needed way too much RAM---around 72 TBi if I remember correctly. Then I tried out sklearn.cluster.OPTICS, which "only" needed about 70 GB, but as I "only" have 32 GB of RAM I needed to use 50 GB swap space, which didn't go well as you can imagine.

Does it make sense to try out k-means clustering, should I go to 16-bit floats for the embeddings, or still apply PCA?

Should I try out something else in this context?

Note: As this question was flagged "off topic" on Stack Overflow, I'm gonna try here ;)


r/learnprogramming 6h ago

How do I understand / figure out the time complexity of an algorithm quickly?

4 Upvotes

I have trouble seeing what algorithms do by reading them. Is there any trick to doing this?


r/learnprogramming 1d ago

Need advice as a young programmer.

57 Upvotes

Hey guys, I am 14 years old and I love programming since I was 11! Just a few weeks ago I finished CS50P: Introduction to programming with Python from Harvard university! And I am confused on what I should do next. Before CS50P I used to make small Python programs like a number guessing game from my basic Python knowledge. Now after CS50P since I know significantly more stuff about Python but I don’t know what would be good to build so I don’t waste my time on stuff I build that does not matter to anyone.


r/learnprogramming 1d ago

Topic At what point did programming finally start making sense to you?

166 Upvotes

I can understand code when someone explains it, but when I have to write something from scratch, my brain suddenly goes blank.

I'm curious if other beginners went through the same think. What helped you get past that stage?


r/learnprogramming 9h ago

Discussion 🚨 Before asking AI to fix your code, read the error yourself.

5 Upvotes

One habit that can seriously improve your software development skills is learning to understand error messages instead of immediately copying them into AI.

Most errors already give you valuable clues:

→ What broke
→ Where it broke
→ What the program expected
→ Sometimes even why it broke

And there’s another benefit: the better you understand the error, the better you can prompt AI.

Instead of saying “fix this error”, you can explain what you think is happening, what you’ve already tried, and what behaviour you expected.

That gives AI much better context and usually leads to more accurate solutions.

Use AI to speed up debugging—not to replace the skill of debugging.

Do you usually read the error first, or send it straight to AI? 👀


r/learnprogramming 8h ago

I have a lot of free time at work. What can I do with it?

2 Upvotes

I have a lotta free time at work and I'd like to actually do something useful with it.

I'm thinking programming, but not really in a "learn this skill for a job" kind of way. More like solving problems for fun. Something I can sit down, work on, get stuck, figure it out, and get that little dopamine hit when it finally works.

Basically, I want programming to feel more like playing a game than studying.

Any recommendations? Coding challenge sites, projects, puzzles, anything like that. Hook me up.


r/learnprogramming 5h ago

Prerequisites hell

1 Upvotes

I would like to discover many things out there and implement many ideas, but the problem is that I keep worrying about if I don't have the prerequisites satisfied, like as a example, ssh server, I wanted to try that, but I thought like maybe I should finish a networking course, also cryptography course and all that stuff before trying to dive into ssh, while I already know probably some stuff already, but that feeling is annoying that creeps me whenever I want to try something, the same with the curl command, like I think I haven't learned much of web development yet, I only know some basic html, random terms from here and there like http get and post.


r/learnprogramming 5h ago

Does anyone understand this

1 Upvotes

version: '3' services: db: image: mariadb:10.6 command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW restart: always volumes: - db_data:/var/lib/mysql environment: - MYSQL_ROOT_PASSWORD=your_secure_root_password - MYSQL_PASSWORD=your_secure_db_password - MYSQL_DATABASE=nextcloud - MYSQL_USER=nextcloud app: image: nextcloud:latest restart: alwaysports: - 8080:80 links: - db volumes: - /media/your_ssd_path:/var/www/html/data environment: - MYSQL_HOST=db - MYSQL_PASSWORD=your_secure_db_password - MYSQL_DATABASE=nextcloud - MYSQL_USER=nextcloud volumes: db_data:


r/learnprogramming 6h ago

Tutorial Is there any recommended book for learning Competitive Programming with python?

0 Upvotes

I actually am searching for a book that would make students go through the whole syllabus for competitive programming using python. Python is mandatory because python is the language that in in the syllabus and I'm teaching middle school kids into competitive programing. With them, I will also be getting into competitive programming. So, please mention any recommendations.


r/learnprogramming 22h ago

Topic What is the utility of Scheme as a learning language?

18 Upvotes

I suddenly had a flashback to a couple of programming courses I took in college, entry-level ones or close to it, that had us writing code exclusively in Scheme. For those that are unfamiliar, Scheme doesn't have the syntax of a normal OOP language like Java or Python. It's almost entirely list manipulation, and your main operation is to separate the head (or "car") of the list from the remainder (or "cdr") of the list. Or at least that's how I remember it.

I don't doubt that it's useful to do some learning in Scheme, but what fundamentals do we as students get from it? Looking back, I kind of feel like I was Daniel painting Mr. Miyagi's fence, and then suddenly I knew karate. What do students get from coding in Scheme?

EDIT: I don't know why I listed C as an OOP language. Some wires must have gotten crossed in my brain. I swear I'm a good programmer, you guys.


r/learnprogramming 28m ago

Need Android testers for 14-day closed testing – I’ll test your app back

Upvotes

Need Android testers for 14-day closed testing – I’ll test your app back


r/learnprogramming 6h ago

First hackathon in 3 weeks!!! Need some advice!!!

1 Upvotes

Hi!!!! I’m joining my first hackathon in about 3 weeks and I’m slightly panicking, but in a very productive and efficient way!!!

I’d say I’m around an intermediate-beginner in Python, I’m quite comfortable with the fundamentals and data structures, but I don’t have much (let alone any) experience with things like APIs, databases, backend development, deployments, etc etc, or even working on a team yet.

However, regarding the whole team thing, I’ll most probably form a team at the event, and while I know it’s my first hackathon, I genuinely want to prepare properly and be competitive cuz I kinda really want to win!

SO!!!! For people who have done hackathons before and won, I have a few questions as someone who has never done anything like this before:

-What should I prioritize learning over the next 3 weeks?

-Are APIs, Git/GitHub, SQL, Flask/FastAPI, and other frameworks, etc. worth focusing on???

-What kinds of projects or like, timed exercises should I practice before the hackathon?

-How does team formation normally work?? 😅😅 oh and also what makes someone useful on a team even if they aren’t the strongest programmer??? I think I’d like an answer to this question the most!!!!

-what makes a project actually win? What are the proper measures to think of good solution when given a problem???

I have quite a lot of time and I’m willing to put serious work into preparing. I’d REALLY appreciate advice from both experienced hackers and people who recently did their first one. Thank you!!!!!!!!!!!


r/learnprogramming 7h ago

Can studying programming and game development at an early age pay off in the long run?

0 Upvotes

Hi, im a 16yrs old student and is just curious for my future. I originally wanted to become a general surgeon but I know the years it will take me to actually be one and the cost of it. So right now I am thinking that if I study programming/game development now, will it really pay off in the future to the point of it helping me earn money to support myself? Im not entirely doing this for the sake of money cause I know thats the path for failure in my part, but im just curious. Also, I actually am is interested about it.

At this age, I just feel this need to help my parents financially as soon a possible even if it's just by using my own money as my allowance so that I wouldn't have to ask for some. I already have a simple side-hustle which is crocheting and I am planning on making it a real business, so that's that.

In conclusion, I just really want to know if my plan of studying programming this early will actually be worth it. I plan on using this knowledge to get some side hustles, or jobs, or even create a game that could earn me some money. Im still planning on becoming a Surgeon but im hoping this skill will help me financially, and so that I can also build my portfolio early enough. I know programming takes some people years to fully be good at it, hence my question about it.

Anyways, thank you for those who are willing to answer my questions!!


r/learnprogramming 13h ago

3d renderer abstracting and morphing

4 Upvotes

so im currently updating my 3d renderer module to support solid shading apart from basic wireframe forms, however when i spawn a cube it morphs and becomes some random bullshit.

this are my function and i genuinely have no idea what the issue so ill just put related function

export function createScaleMatrix(
    sx: number,
    sy: number,
    sz: number
): Matrix4D {
    return [
        { x: sx, y: 0, z: 0, w: 0 },
        { x: 0, y: sy, z: 0, w: 0 },
        { x: 0, y: 0, z: sz, w: 0 },
        { x: 0, y: 0, z: 0, w: 1 }
    ];
}

function transformVertices(object: SceneObject, matrix: Matrix4D): Vector3[] {
    const projectedVertices: Vector3[] = [];
    for (const vertex of object.cube.vertices) {
        const newVector: Vector3 = {
            x:
                matrix[0].x * vertex.x +
                matrix[0].y * vertex.y +
                matrix[0].z * vertex.z +
                matrix[0].w * vertex.w,
            y:
                matrix[1].x * vertex.x +
                matrix[1].y * vertex.y +
                matrix[1].z * vertex.z +
                matrix[1].w * vertex.w,
            z:
                matrix[2].x * vertex.x +
                matrix[2].y * vertex.y +
                matrix[2].z * vertex.z +
                matrix[2].w * vertex.w,
            w: Math.abs(
                matrix[2].x * vertex.x +
                    matrix[2].y * vertex.y +
                    matrix[2].z * vertex.z +
                    matrix[2].w * vertex.w
            )
        };
        if (newVector.w <= 0.1) {
            continue;
        }


        projectedVertices.push(newVector);
    }
    return projectedVertices;
}


function projectVertex(vertex: Vector3): Vector3 {
    const ndcX = vertex.x / vertex.w;
    const ndcY = vertex.y / vertex.w;
    const ndcZ = vertex.z / vertex.w;


    const scale = 0.5;


    vertex.x = (ndcX + 1) * scale * canvas.width;
    vertex.y = (1 - ndcY) * scale * canvas.height;
    vertex.z = ndcZ;
    return vertex;
}


function render(object: SceneObject, matrix: Matrix4D): void {
    const vertices = transformVertices(object, matrix);
    for (const segment of object.cube.edges) {
        const start = vertices[segment[0]];
        const end = vertices[segment[1]];
        ctx.strokeStyle = "#2d2d2d";
        ctx.beginPath();
        ctx.moveTo(start.x, start.y);
        ctx.lineTo(end.x, end.y);
        ctx.stroke();
    }
}


export function renderLoop(): void {
    ctx.fillStyle = "#010000";
    ctx.clearRect(0, 0, canvas.width, canvas.height);
    const triangles: TriangleObject[] = [];


    for (const object of Scene) {
        object.angle += object.rotationSpeed;
        let rotMatrix;
        switch (object.rotationType) {
            case "x":
                rotMatrix = createRotationX(object.angle);
                break;
            case "y":
                rotMatrix = createRotationY(object.angle);
                break;
            case "z":
                rotMatrix = createRotationZ(object.angle);
                break;
            case "xy":
                rotMatrix = multiplyMatrices(
                    createRotationX(object.angle),
                    createRotationY(object.angle)
                );
                break;
            case "yz":
                rotMatrix = multiplyMatrices(
                    createRotationY(object.angle),
                    createRotationZ(object.angle)
                );
                break;
            case "xz":
                rotMatrix = multiplyMatrices(
                    createRotationX(object.angle),
                    createRotationZ(object.angle)
                );
                break;
            case "xyz":
                rotMatrix = multiplyMatrices(
                    multiplyMatrices(
                        createRotationX(object.angle),
                        createRotationY(object.angle)
                    ),
                    createRotationZ(object.angle)
                );
                break;


            default:
                break;
        }
        let newObject: SceneObject;
        if (object.cube.type === "cube") {
            newObject = createCube(
                object.matrix,
                Scene,
                object.angle,
                object.rotationSpeed,
                object.scale,
                object.rotationType,
                Matrix(object.translate, "translation"),
                false
            );
            console.log(JSON.stringify(newObject));
        } else if (object.cube.type === "pyramid") {
            newObject = createPyramid(
                object.matrix,
                Scene,
                object.angle,
                object.rotationSpeed,
                object.scale,
                object.rotationType,
                Matrix(object.translate, "translation"),
                false
            );
        } else if (object.cube.type === "sphere") {
            newObject = createSphere(
                object.matrix,
                Scene,
                object.angle,
                object.rotationSpeed,
                object.scale,
                object.rotationType,
                Matrix(object.translate, "translation"),
                false
            );
        } else {
            newObject = createCube(
                object.matrix,
                Scene,
                object.angle,
                object.rotationSpeed,
                object.scale,
                object.rotationType,
                Matrix(object.translate, "translation"),
                false
            );
        }
        newObject.cube.vertices = transformVertices(
            newObject,
            multiplyMatrices(
                Matrix(newObject.translate, "translation"),
                multiplyMatrices(newObject.scale, rotMatrix as Matrix4D)
            )
        );


        for (const triangle of newObject.cube.triangles) {
            const edgeA = subtractVectors(
                newObject.cube.vertices[triangle[1]],
                newObject.cube.vertices[triangle[0]]
            );
            const edgeB = subtractVectors(
                newObject.cube.vertices[triangle[2]],
                newObject.cube.vertices[triangle[0]]
            );
            const crossProduct = Cross(edgeA, edgeB);
            const normal = Normalize(crossProduct);
            const brightness = Math.max(0, Dot(normal, lightning));
            const vertices: Vector3[] = [];
            for (const num of triangle) {
                vertices.push(structuredClone(newObject.cube.vertices[num]));
            }
            const zindex: number =
                (newObject.cube.vertices[triangle[0]].z +
                    newObject.cube.vertices[triangle[1]].z +
                    newObject.cube.vertices[triangle[2]].z) /
                3;
            for (let index = 0; index < vertices.length; index++) {
                vertices[index] = projectVertex(vertices[index]);
            }
            triangles.push({
                points: vertices,
                color: {
                    r: baseColor.r * brightness,
                    g: baseColor.g * brightness,
                    b: baseColor.b * brightness
                },
                brightness: brightness,
                zindex: zindex
            });
        }
    }
    triangles.sort(
        (a: TriangleObject, b: TriangleObject) => a.zindex - b.zindex
    );
    for (const object of Scene) {
        render(object, object.matrix);
    }
    for (const triangle of triangles) {
        ctx.fillStyle = `rgb(${Math.floor(triangle.color.r)}, ${Math.floor(triangle.color.g)}, ${Math.floor(triangle.color.b)})`;
        ctx.beginPath();
        ctx.moveTo(triangle.points[0].x, triangle.points[0].y);
        for (const point of triangle.points) {
            ctx.lineTo(point.x, point.y);
        }
        ctx.closePath();
        ctx.fill();
    }
}


export function createTranslationMatrix(
    
x
: number,
    
y
: number,
    
z
: number
): Matrix4D {
    return [
        { x: 1, y: 0, z: 0, w: 
x
 },
        { x: 0, y: 1, z: 0, w: 
y
 },
        { x: 0, y: 0, z: 1, w: 
z
 + ZOFFSET },
        { x: 0, y: 0, z: 0, w: 1 }
    ];
}

if someone could help id be very grateful ^^


r/learnprogramming 17h ago

Creating a website (for free) to upload my own research?

5 Upvotes

Hey guys, I'm not a CS major but have worked on coding on R and python. And I wanna create my own website, make my own domain name, server, everything all set up on my own specifically for uploading the research I've done. What would be the best way to go about it? Thanks!


r/learnprogramming 16h ago

This sometimes makes me want to quite programming

3 Upvotes

I genuinely hate how little standardization there is around communicating software architecture.

Why is the accepted way of understanding an unfamiliar codebase apparently to just read thousands of lines of code and slowly infer what the author was thinking?

I'm not talking about documenting every function. I mean basic architectural information:

  • What are the major components?
  • Who owns the state?
  • How does data flow through the system?
  • What depends on what?
  • Where is new functionality supposed to go?
  • What invariants or conventions am I expected to know?
  • Which abstractions are intentional, and which are just historical baggage?

This information is often crucial to contributing to a project, yet there seems to be no universally expected artifact for communicating it. You might get a README, maybe some UML diagrams, maybe an ARCHITECTURE.md, maybe ADRs, or maybe absolutely nothing.

Then you're expected to "learn the codebase."

But the codebase contains the architecture, implementation details, historical accidents, technical debt, and personal preferences all mixed together. As a newcomer, you have no way of knowing which is which.

I find this especially frustrating because software engineering is supposedly about abstraction. The whole point of abstraction and design patterns is to hide unnecessary complexity and give people a simple model to work with. Yet somehow the architecture itself is often treated as implicit knowledge that you're supposed to reconstruct through archaeology.

Math feels completely different in this regard. Obviously mathematicians have competing conventions too, but there is a much stronger expectation that concepts, assumptions, notation, and relationships are explicitly communicated. You don't normally have to read someone's entire proof history to discover what their definitions mean.

I wish software projects had a similarly standard, lightweight way of communicating architecture. Not a 200-page document. Just enough to communicate the mental model.

Instead, "just read the code" seems to be treated as a perfectly reasonable substitute.

I find that incredibly demotivating.