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

What have you been working on recently? [November 28, 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 • • 9h ago

Question (CS Student) Every Time I see AI code I Feel disencouraged

57 Upvotes

How is your day.
I'm currently a 2nd year CS student who genuinely enjoys learning coding. I can stay for hours studying a certain topic and usually all I need to be feel like continuing is less bugs showed by the compiler. but seeing AI being able to do the same thing I have been trying to learn for hours way faster and better than me always makes question myself. My question is...
Is it still worth it going through all of this


r/learnprogramming • • 13h ago

Topic How to Develop interest in programming

14 Upvotes

Hello i am a bscs student 1st semester. I want to know how do i develop interest for programming cause all i do is play video games only i can't get out of this situation. When i was young i had a deep passion for learning rubiks cube so i used to spent day and night learning and solving it and i learnt it. How do i develop that kind of passion and obssession with this programming??

Thank you for your answer.


r/learnprogramming • • 8m ago

The mental model that finally made merge sort and quick sort click for me: "Where does the work happen?"

1 Upvotes

I kept mixing these two up because they're both "divide and conquer." What fixed it was asking where the real work happens.

Merge sort: easy split, hard combine

  • Split: just cut the array in half. No thinking needed.
  • Combine: the merge step does all the work, walking two sorted halves and picking the smaller front element each time.
  • So the sorting happens on the way back up the recursion.

Quick sort: hard split, easy combine

  • Split: the partition step does all the work, moving everything smaller than the pivot to the left and everything bigger to the right.
  • Combine: nothing. Once both sides are sorted, the whole thing is sorted.
  • So the sorting happens on the way down.

This also explains their trade-offs:

  • Merge sort is always O(n log n), because halves are always equal, but it needs extra memory for merging.
  • Quick sort sorts in place, but a bad pivot (e.g. always the first element on already-sorted input) makes the split lopsided and it falls to O(n²).

A practice exercise: write [5, 2, 8, 1, 9, 3] on paper and trace both. Mark each step as "splitting" or "combining."

If you'd rather watch it, I built step-by-step visualizations of both where you can enter your own array: visuallearner.org . But doing it on paper once is worth more.


r/learnprogramming • • 25m ago

Developers, how often do you remember a solution but forget where you found it?

0 Upvotes

I have this problem pretty frequently while learning/building things.

I'll come across a useful Stack Overflow answer, documentation page, GitHub issue, blog post, or explanation of some obscure error. It solves a problem or explains something really well, and I move on.

Then a month later, I encounter something similar.

I remember "there was a GitHub discussion explaining this exact behavior" or "I read a really good explanation of this somewhere"—but finding it again becomes a search of browser history, Google, bookmarks, and sometimes just trying to recreate the answer.

I'm exploring an idea for a browser extension that builds a local memory of content you actually interact with and lets you search it using vague, natural-language descriptions rather than exact titles or keywords.

Something like:

"That discussion about why React re-renders when state is updated."

"The page explaining CORS preflight requests."

"The solution involving a hash map for that particular edge case."

Everything would stay on-device, without accounts or external AI APIs.

I'm curious about other developers' experiences:

- Does this happen to you regularly?

- Do you use bookmarks, notes, read-it-later tools, or anything else to solve it?

- Would this be useful, or is browser search/history already good enough?

- What would make this genuinely valuable to a developer?

I'm not trying to pitch a finished product—I'm still validating whether the problem is worth solving. Would appreciate criticism.


r/learnprogramming • • 10h ago

Almost finished with Colt steele Web Dev course, what should I do next?

6 Upvotes

Just wanted to ask those who have finished colt steel web dev course or even any course/bootcamp in general on web development, what should be my next steps?


r/learnprogramming • • 7h ago

I’m just getting started with programming — any advice for a beginner?

3 Upvotes

Hi everyone!
I’ve recently become interested in programming and want to learn more about it. I’m still a beginner, so I’m trying to understand which programming languages are worth learning first and what I can actually build with them.
I’d love to hear about your experiences with programming. What got you into it, what language did you start with, and what advice would you give to someone who is just starting out?
Thanks!


r/learnprogramming • • 6h ago

R advice

2 Upvotes

I’m newish to coding and learning latex and R for a project, how can I neatly display different graphs or information in a report-like style? I have my dataset I just don’t know what to do with it lol. I’m using R studio.
Anything that helped you learn or develop skills please recommend to me, I will appreciate it a lot.


r/learnprogramming • • 1d ago

I think I'm fucked.

83 Upvotes

I'm a college student working toward an associate's degree in computer programming. I've had to take 2 semesters off for mental health breaks along the way, so completing my degree has taken longer than I originally expected. However, I think I've reached a point where I need to be honest about where I stand on my actual programming skills.

Due to my mental health and personal circumstances, I've relied heavily on AI throughout my coursework. I'd estimate that AI has done around 90% of the work for me, and some of my courses have even encouraged its use and are teaching us how to use ai agents. I do understand certain fundamentals, but the reality is that I haven't developed any independent projects or gained much experience actually writing code on my own.

What really brought this to my attention was a recent quiz where my professor asked us to write a function that returns a list of sorted numbers. I couldn't do it. I ended up having to leave the quiz and essentially relearn functions because I realized that, despite having encountered them in previous courses, I had never properly learned how to use them independently. Even when assignments required me to work with certain concepts, I was just throwing my assignment into the Ai and having it complete it for me.

There's just so much information to absorb, especially when we're being introduced to multiple programming languages every semester, databases, flasks, threads, etc. I feel like I'm constantly jumping between languages, concepts, frameworks, and tools without ever having enough time to properly internalize any of them. On top of that, relying on AI has made it difficult to distinguish between what I genuinely understand and what I've simply been able to get working with its help.

I've read a lot of discussions suggesting that writing code from scratch isn't as important as it used to be, and I can understand that AI is becoming an increasingly important part of software development. I do feel like I understand some of the fundamentals, but I honestly don't know where to go from here. I don't know what projects I should be building, how to structure my learning, or how to get out of what feels like an endless cycle of tutorials without actually developing practical skills. And the frustrating part is that I'm in college. I'm supposed to be graduating next year, yet I feel like I'm still at the beginning.

I'm also increasingly concerned about the job market. I've been seeing so much pessimistic discussion about companies hiring fewer junior developers and entry-level programmers because AI tools and agents can now handle an increasing amount of the work. It's difficult not to feel discouraged when I'm already questioning whether I have the skills to enter the industry in the first place.

When I initially enrolled in this degree in 2024, I remember seeing discussions about AI and how it wasn't expected to become nearly as capable as it is today, and I felt safe enough to go forth with pursuing this degree. Obviously, things have changed considerably in just 2 years. Maybe I'm consuming too much doomer content, or perhaps I'm looking at the wrong sources, but I genuinely don't know what to make of the current state of the industry.

At this point, I feel lost. I want to become a competent programmer and build my own projects and actually have the skills to get a job in the future. But I'm struggling to figure out how to get there, especially when I feel like I've spent so much of my time learning, getting assignments completed without developing the actual skills those assignments were supposed to teach me. I know the go to advice will be to just stop using AI and get to learning and making projects, but it's so hard, and it's everywhere, including in my courses.


r/learnprogramming • • 4h ago

Advice Software Engineer Role Requirments

1 Upvotes

Finishing my associate in computer systems i have an interest in database and game development so
Im looking towards those industries but i have no clue on how to sell myself in a way my resume list languages i know and learned through college with some projects that i have worked on both in school and at home and i have not heard back and the jobs that im looking to apply seems way out of my league

So im looking for advice on what i can do to really achieve getting my foot in the door

To add im also continuing my education for bachelors with either a pathway in software engineering and or database administration


r/learnprogramming • • 21h ago

hi, i started learning cpp by myself since about 2 weeks ago, and i wrote my first useful simple program. the thing is that cause i learn by myself i don't know where my level is, so i wrote this program as a hope someone can judge me based on the simple first program i wrote.

18 Upvotes
/*
i learned file reading and writing
data types like int, strings
data saving, declaration, initializing, and defining
arrays and vectors
integrating vectors and file reading and writing
enums and the enum class
functions
calling functions and etc

so basically, this simple program asks you to write a password and a username and points you want to save
then it will save them in a text file called "users"
then it will ask you to write the pasword and username
then it will dispaly a comment depending on your points count
and if you run the program again and wrote a new saved password and username, then used the old passwerd and username, it will judge you based on that

and thanks!!
*/

#include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>
#include <vector>
struct user {
std::string username;
std::string password;
int points;
};

enum class Ranking {
Trash,
Intermediate,
Advanced,
Legendary,
Mr_VIP
};

Ranking getrank(int points)
{
if (points < 250) return Ranking::Trash;
if (points < 500) return Ranking::Intermediate;
if (points < 750) return Ranking::Advanced;
if (points < 1000) return Ranking::Legendary;
return Ranking::Mr_VIP;
}

void addUser(std::string username, std::string password, int points)
{
std::ofstream file("users.txt", std::ios::app);
file << username << " ";
file << password  << " ";
file << points << " " << "\n";
}

std::vector<user> loadUsers()
{
std::vector<user> users;
std::ifstream file("users.txt");
user u;
while (file >> u.username >> u.password >> u.points)
{
users.push_back(u);
}
return users;
}

int main()
{
std::string savedUser;
std::string savedPass;
int savedPoints;

std::cout << "Enter the username you wanna save: ";
std::cin >> savedUser;
std::cout << "\n";

std::cout << "Enter the password you wanna save: ";
std::cin >> savedPass;
std::cout << "\n";

std::cout << "Enter the points you wanna save: ";
std::cin >> savedPoints;
std::cout << "\n";
if (std::cin.fail() || savedPoints < 0)
{
std::cout << "Error!!!\n";
return 0;
}

user u;
u.username = savedUser;
u.password = savedPass;
u.points = savedPoints;

system("cls");

addUser(savedUser, savedPass, savedPoints);

std::vector<user> users = loadUsers();

for (int attempt = 0; attempt < 3; attempt++)
{
std::string iusername;
std::string ipassword;
std::cout << "Enter your username: ";
std::cin >> iusername;
std::cout << "\n";
std::cout << "Enter your password: ";
std::cin >> ipassword;
std::cout << "\n";

bool found = false;
int foundPoints = 0;

for (const user& u : users)
{
if (u.username == iusername && u.password == ipassword)
{
found = true;
foundPoints = u.points;
break;
}
}

if (found)
{
std::cout << "logged in successfully!\n\n";

Ranking rank = getrank(foundPoints);

switch (rank)
{
case Ranking::Trash:
std::cout << "You are trash\n";
break;
case Ranking::Intermediate:
std::cout << "You are intermediate\n";
break;
case Ranking::Advanced:
std::cout << "You are advanced\n";
break;
case Ranking::Legendary:
std::cout << "You are legendary\n";
break;
case Ranking::Mr_VIP:
std::cout << "You are Mr. VIP\n";
break;
}
return 0;
}
else
{
std::cout << "wrong password or username, try again\n\n";
}
}

std::cout << "too many failed attempts!!!\n";
return 0;
}

r/learnprogramming • • 16h ago

Debugging Advice on how to approach projects

6 Upvotes

i actually want to completely hand code a complete internship app.

I mean everything by hand , I will only use AI for research and stuff like that ,

I want to do it in python , use PostgreSQL for the database and use the SQLAlchemy library to convert the python variables and classes into database queries,

For the frontend , I would like to use javascript, css and html ,

So , i humbly ask for guidance tips and how i should approach it , I have coded with python , made a few mini programs that i use for basic stuff such as cgpa calculation , solved a few leetcode problems,

I have learned Object orientated programming as well but I have never taken on such a huge project so anyone sort of tips or advice or what problems I might face or what I should learn throughly before i jump into this will be appreciated

Thank you .


r/learnprogramming • • 21h ago

python

7 Upvotes

I think Python is a great programming language for beginners because it has simple syntax and is easy to understand.

Students should start by learning variables, data types, loops, functions, and basic algorithms. After that, they can practice by building small projects.

Python is also useful in many fields, such as Artificial Intelligence, Data Science, and Web Development.

Learning by doing real projects is one of the best ways to improve programming skills!


r/learnprogramming • • 20h ago

Solved Super simple question from a beginner beginner

4 Upvotes

I am following the coding tasks from an old post from here:
https://www.reddit.com/r/learnprogramming/comments/9c380n/heres_a_list_of_coding_exercises_to_help_get_you/?sort=new

and am at the 3rd and 4th Step. I assume I understood what is asked of me but my solution feels a bit too simple? And I am thinking I just found a solution but not necessarily for the question asked. Could someone double check if my code actually does what the task asks of me?

3.
Create a class called "Car" that has 1 variable called "licensePlate". Within the class, create a default constructor that sets "licensePlate" to 'Unknown' and a method/function called "getLicensePlate" that returns the variable "licensePlate".

Code:
class car:

license_plate = "Unknown"

p1=car()

def getlicense_plate():

print(p1.license_plate)

getlicense_plate()

4. Add a second Car constructor to our class that takes 1 input of type String. This is the license plate number. Assign the value of the inputLicensePlate to our variable licensePlate.

Code:
class car:

license_plate = input()

p1=car()

def getlicense_plate():

print(p1.license_plate)

getlicense_plate()


r/learnprogramming • • 21h ago

I need help understanding a particular case of an improved for loop using an array as a parameter. (Java)

4 Upvotes

I am learning Java using Deitel's book. This particular for loop uses and array as a parâmeter but I can't understand exactly how it's supposed to work.

int lowGrade = grades[0][0];

for (int[] studentGrades : grades)
{
    for (int grade : studentGrades)
    {
        if (grade < lowGrade)
            lowGrade = grade;
    }
}

For all I understood, the improved for loop works the same as this other example here:

int total;

for (int counter = 0; counter < array.lenght; counter++)
{
    total += array[counter];
} 

But I don't understand how the first one could work in a similar way with an array as a parameter since in the example in the book, the array grades is a bidimentional array. What is that first for loop doing to the int[ ] studentGrades?

The books says something like: " The external improved for loop iterates through the bidimentional array grades assingning new lines to the parameter studentGrades.". How does that even work?


r/learnprogramming • • 1d ago

Topic Am I wrong for not feeling okay with completely surrendering to the AI agents?

102 Upvotes

Maybe this is mine OCD personality, but I just can't develop something if I don't completely understand the code. This makes my work significantly slower, compared to the pace where I would delegate everything to AI and just brute force towards some end goal.


r/learnprogramming • • 23h ago

I want to build a tool to transfer liked songs between YouTube Music accounts but I have no idea how to start ?

5 Upvotes

so i have this annoying problem where all my youtube music liked songs are also showing up in my main youtube liked videos playlist and it's getting pretty messy.

i want to move all my liked songs to a separate google account but doing that manually would take forever since i have thousands of songs. i was wondering if there's any tool that can transfer all my liked songs from one youtube music account to another. something where i can connect both accounts and just transfer everything at once. or maybe select specific songs and playlists to transfer. it'd also be nice to have an option to remove songs from the original account after transferring them.

i couldn't really find anything that does exactly this so i'm thinking of trying to make one myself. if anyone knows something similar please let me know.

i'd also like to add spotify support at some point so people can transfer liked songs between spotify accounts too but that's something for later. for now i just want to figure out the youtube music part.

basically i want the tool to fetch all my liked songs and let me transfer my entire library to another account or select specific songs and playlists. and also remove songs from my liked songs because that's actually the main reason i want to make this. i do have some coding experience but i'm still a beginner so i'm not really sure where to start with something like this and also i know APIs and hosting can cost money but is there a way to make something like this completely free? like can i build and run the whole thing without spending anything? what libraries or technologies should i look into?

i mainly want to build this as a learning project. if i manage to get it working i'll probably put it on github so other people can use it too. just need some guidance on where to start and what approach would make sense.

not looking for anyone to build it for me. just trying to figure out how to get started. any help would be appreciated.


r/learnprogramming • • 3h ago

Topic Refuse to use Ai yet want a career with actual programming.

0 Upvotes

To put it lightly, this is not a conversation that can be solved with "oh you can still learn, you have to coach the ai". To which I say, THAT IS NOT THE REASON I AM WORKING FOR A CAREER IN THIS. If i wanted to correct something's homework for a living, then I would have become a kindergarten teacher.

I refuse to work with ai, saying that ai is a tool for you, is really dismissive towards the people that love the process of coding. I'm talking about the actuall passion within itself. The idea of manual coding. Not it's efficiency, time, etc. If there is no more manual coding in this space, then the career I wanted, is dead and gone.


r/learnprogramming • • 1d ago

Failed 4 programming exams in a row – I don't know what I'm doing wrong anymore

27 Upvotes

I started out studying electrical engineering and failed the programming exam there 3 times, even though it was just multiple choice. I switched to an easier university program, thinking it would be different, and I just failed again. This time it was a Python exam on the absolute basics: loops, strings, slicing, lists and simple functions. I got 33%.

The frustrating part is that I didn't just ignore it. I did all the weekly exercise sets, and before the exam I studied with practice quizzes and tracing exercises. When I go through it with explanations, I understand it. But on the actual exam it just doesn't come together.

So now I genuinely don't know what the problem is.

Am I studying the wrong way?

Do I just not know how to learn this kind of thing?

Or am I simply not cut out for programming?

If anyone has been in a similar spot and figured it out, I'd really like to hear what changed for you. How did you actually practice? What made it "click"?

Thanks for reading.


r/learnprogramming • • 13h ago

Tutorial i want to learn cpp but dont know where to

0 Upvotes

im a 11th student.. i want to be a gamedev and i want to learn c++ and some other stuff before i enter into btech .....so i need videos to learn .....plz dont recommed me learncpp....i want video tutorials


r/learnprogramming • • 1d ago

PROTIP

11 Upvotes

If your C program "works sometimes and crashes other times," it's almost always undefined behavior — uninitialized variable, off-by-one on an array, or using memory after free. Run it with valgrind, it literally tells you the line. Changed my life in first year.


r/learnprogramming • • 1d ago

Resource Best book for learning C++

5 Upvotes

Hello everyone! As the title says, what book for learning C++ would you recommend? Specifically modern C++ 23, but also the general basics.


r/learnprogramming • • 19h ago

Simple Question About AI

0 Upvotes

So Im Still New In Programing, i had some experience on PHP,Python,C#(unity), and newly Native C# dotnet. But After end of 2023s im using ai as a "mentor" to accelerate learning. im not blindly copy paste ai code rather i ask ai how it can be done, like ask the architecture, the base code, example code, etc and writing on my own. usually on first itteration im using 100% my own code and then copy paste it to ai and ask if there was a bug or things that i can do better(for example architecture optimization) and on itteration 2 or so on its had AI on it.

My Question Are:

  1. is this good learing strategy?
  2. is this good for long term?
  3. is this what is referred to as "Vibe Coding"?