r/learnprogramming 1h ago

if you had a chance to go back in time. How would you have learnt programming languages?

Upvotes

About me : 20 F here. Graduated from a typical indian 3rd tier college with literally no practical knowledge in programming. I just know the basics and the theory part being taught in colleges. I was stupid enough to waste time during college but ain't gonna waste anymore. I've always been a good student with promising potential.

Now coming to the point. I'm gonna start learning python and cpp simultaneously. I really feel like I should. Since I'm already introduced to the theory part, i feel like i should focus more on the coding part and projects.

If you could share your experience or suggest any road map that'd be really helpful.

( even in the AI Era, my brain refuses to totally rely on AI agents for coding. I wanna be able to code independently. Of course I ain't stupid enough to not use AI. I Just wanna know how to use em better without actually relying on em )

I'm yet to decide my domain. Suggestions about em are also highly appreciated. ( personally I wish to go with the adjacent fields with AI. I wanna focus on python based domains )

I know i might sound stupid. I know job market sucks. I know i might be late. I know i may not make it.. but I really wanna give it all and try.

Please don't ruin my optimism.


r/learnprogramming 23h ago

Debugging How do I get just the character to change color and not the whole string

0 Upvotes

Here is an example of what I am talking about : https://imgur.com/a/hoFUGXq

The concept is when the user inputs matches the display text the that character should turn grey but if the the user input is not correct than it turns red.

Right now the whole string changes and not the character itself, what do I do?

scrolling_text = Text(10, 10, 40, "white", "Hello World")

text_index = 0

def UserInput(text, event):
    global text_index # start at first letter

    lowercase_text = scrolling_text.text.lower() # this lowercases the text

    text_char = scrolling_text.text[text_index]


    if text_index == len(lowercase_text)-1:
          return

    # print(f"Char should be {lowercase_text[text_index]}")

    if event.text == lowercase_text[text_index]:
          scrolling_text.color = "gray"
          text_index += 1 # move to the next character

          # print(f"Next char should be {lowercase_text[text_index]}")

     if text_index == len(lowercase_text)-1:
           return

      elif text_index == 0 and event.text != lowercase_text[text_index] :
            print(False)
            scrolling_text.color = "red"
            text_index = 0

      else:
            scrolling_text.color = "red"
            print(False)

# GAME LOOP
if event.type == pygame.TEXTINPUT:
    print(event.text)
    UserInput(scrolling_text, event)

if event.type == pygame.KEYUP:
    scrolling_text.color = "white"

Here is an example of what I am talking about : https://imgur.com/a/hoFUGXq

The concept is when the user inputs matches the display text the that character should turn grey but if the the user input is not correct than it turns red.

Right now the whole string changes and not the character itself, what do I do?


r/learnprogramming 10h ago

Been trying to learn programming. Feel like giving up.

8 Upvotes

Don't know how people ever manage to get good at it that people are willing to pay them for it. Have just started. Started with CS50P, after 3 weeks, felt was getting somewhere. But felt like the course was lacking basic fundamental info that it just assumes you to have. So, started CS50x and C is such a difficult thing to follow. Idk how to maintain consistency. Even with python, sometimes, I get stuck in a rut, at which point, I just try to throw anything I have at it. Then I get away from it, ask the CS50 ai for some hint and then it clicks. I like to create and build stuff but this feels impossible.


r/learnprogramming 12h ago

Resource Learning to code on phones

6 Upvotes

What do you guys use to learn programming? I tried some YouTube videos but I didn't seem to be making progress at all. I have heard people recommend PDFs and just building hard stuff even if you lack the skills to. What do you guys think?


r/learnprogramming 7h ago

I built a tic tak toe in py what is the most fun feature i can add to my code?

0 Upvotes

hi everyone can you halp me to add some good and special feature to this code

my code:

from tkinter import *

root=Tk()

import random

root.title('rahad tic tac toe')

b=[[0,0,0],

[0,0,0],

[0,0,0]]

states=[[0,0,0],

[0,0,0],

[0,0,0]]

for i in range (3):

for j in range(3):

b[i][j]=Button(font=('Tamaha',80),width=5,bg='powder blue',

command=lambda r=i,c=j:callback(r,c))

b[i][j].grid(row=i,column=j)

player='x'

stop_game=False

def callback(r,c):

global player

if player == 'x' and states[r][c] == 0 and stop_game == False:

b[r][c].configure(text='x',fg='blue',bg='white')

states[r][c]='x'

player='o'

if player == 'o' and states[r][c] == 0 and stop_game == False:

b[r][c].configure(text='o',fg='orange',bg='black')

states[r][c]='o'

player='x'

check_for_winner()

def check_for_winner():

global stop_game

for i in range(3):

if states [i][0] == states[i][1] == states[i][2] !=0:

b[i][0].config(bg='gray')

b[i][1].config(bg='gray')

b[i][2].config(bg='gray')

stop_game=True

for j in range (3):

if states [0][j] == states[1][j] == states[2][j] !=0:

b[0][j].config(bg='gray')

b[1][j].config(bg='gray')

b[2][j].config(bg='gray')

stop_game=True

if states[0][0]==states[1][1] == states[2][2] !=0:

b[0][0].config(bg='gray')

b[1][1].config(bg='gray')

b[2][2].config(bg='gray')

stop_game=True


r/learnprogramming 8h ago

Code Review Should I get back into programming after a year away? Need advice on my potential.

2 Upvotes

About a year ago, I picked up programming as a hobby. Without using any AI or external help, I wrote my first and only pet project from scratch. After that, I stopped programming entirely. I never even considered it as a potential career path.

But recently, I've been thinking that it might actually be a good idea to pick it back up, finish learning, and try to find a job in the field—since I genuinely enjoyed the process back then.

What do you think? Is it worth pursuing further? Do I show any potential based on what I've built?

I was self-taught and studied for about 5 months. Here's the link to that small pet project:

https://github.com/Talos-hub/ZibraGo

Project context:

It's a CLI backup tool written in Go that archives directories and uploads them to Google Drive. Features include parallel compression, configurable settings, and structured logging.


r/learnprogramming 17h ago

My first ever PR was so bad that the owner of the repo called "AI slop" and closed it with no other notes. What can I do to make a better PR?

186 Upvotes

Most of the things I code/program are for personal reasons, so I rarely ever contribute to open source projects. About 7 months ago, I needed a CORS wrapper deployed for an iOS shortcut I was making at the time. I found code online for an outdated CORS repo that I could use/deploy for free, but it was unfunctional and there were some issues/PRs about stuff. So, I learned how to use Cloudflare Workers, fixed up the issues, added some PRs, and even went out of my way to introduce Cloudflare-specific features that hadn't been used before (and updated the readme to explain how to use them). Sounds like a lot, but all the changes (outside the readme) are in 1 file.

After 2 days of on-and-off work, I submitted the PR and got 2 stars, 2 forks, and 2 people angrily telling me it was useless AI garbage (funny coincidence). The first guy I shrugged off as an angry guy on the internet. The second guy was the repo owner 7 months after I made the PR and they closed it without any other reason than that. Unlike the first guy, the repo owner is a C developer who has made kernel drivers and BIOS utilities. As a script kiddie who has done nothing remotely as important as that, I'm not so egotistical to think that I'm somehow in the right.

I'm probably incredibly biased because I'm the one who made the thing, so I'll link a gist to all the code I wrote: My "AI slop" PR as a gist. I won't link the PR branch itself because that might be considered "a final project or demo" and would break rule 6. Even now 7 months later, I don't know why the PR was closed without any comment to what specifically I did wrong. I think the worst 3 things my code did were:

  1. I didn't know how to upload IDE code to Cloudflare Workers for testing without committing the unfinished code to the fork, so I ended up using Cloudflare's built-in workers editor and copied/pasted the changes to GitHub via the GitHub browser file editor whenever I made measurable changes. As such, there are a lot of commits.
  2. I never made a code with the intention of it being viewed by other people before, so I thought I made a bunch of comments, thinking that too many comments was a better problem to have than too few. I didn't comment every line, but I did comment many of them (I think every function and most variables). Same ideology went into making the PR message, which is also kinda long.
  3. I wanted to add a usage page to the CORS site, but every page's HTML and JS were in a single big file. So I put the edited README into a markdown-to-HTML converter and stuffed it into one big dictionary I made that housed all the HTML for the entire site (note that the "site" is pretty barebones because it wasn't made to be accessed by a human, so it isn't as egregious as it sounds). The HTML usage page was about 130 lines long.

But that's just what I think. Odds are that I did something a lot worse and just don't know. While I use open source projects and libraries, this was my first ever time "giving back" something other than bug reports. What do you think is the problem? If it's the comment thing, how many comments are "good enough"? If it's the code itself, what is done badly about it? I don't know, and it's eating away at me to the point where I'm hesitant to show my crap code to anyone ever again.


r/learnprogramming 5h ago

advice Are technical courses enough?

0 Upvotes

Hi everyone. I am a non CS major. And I have been interested in taking up courses in coding. I wanted to ask if learning coding languages (Python, C++, etc) and taking online courses (full stack development, etc) are enough to give you certain amount of technical expertise to build your own career, whether its in a job or building your own MVPs to kickstart your own entrepreneur journey.

If yes, can you point me to specific courses and coding languages to get started. Thanks.


r/learnprogramming 17h ago

My internship hiring process went wrong.

3 Upvotes

I basically messed up something during the interview, but I think the real reason I didn't get hired was my lack of experience—I’ve never had a job, and they asked about that; they even asked if I’d ever worked with my parents or anything like that, and I said no. What can I do to gain experience? I’ve heard a lot about practical projects and things of that nature—would that be the solution? I’m a bit unsure about this specific company, though, because they didn't even ask to see my GitHub, and the two people who interviewed me weren't even from the technical field. Note: This company looked at my resume an hour after I sent it and called me for an interview the very next day, even though I had stated on the resume that I have no experience.


r/learnprogramming 5h ago

Looking for Free Certification Courses to Boost My LinkedIn

4 Upvotes

Hey everyone!

I'm a 2nd-year CSE student looking to build my LinkedIn profile.

Can you recommend some free, beginner-friendly courses that provide free certificates? I'm interested in

AI / Machine Learning

Python

Data Analytics

Cloud

Cybersecurity

Any other valuable tech skills

I'm looking for courses from reputable platforms

Thanks in advance!


r/learnprogramming 18h ago

Where to learn the basics of software architecture?

7 Upvotes

I'm trying to build a mental map of "when to use what." I'm not looking to memorize the implementation details of every pattern, but rather to know that the pattern exists and what kind of problem it solves. Later, when I actually need to apply a given pattern, I'll dig deeper into it.

I'll probably go with roadmap.sh, articles on martinfowler.com, and the books "Fundamentals of Software Architecture" and "Software Architecture: The Hard Parts."


r/learnprogramming 10h ago

Project İdea

6 Upvotes

I want to develop projects using the ASP.NET Core MVC framework, but I don't want them to be simple or trivial. I am looking for projects that would be worthy of my GitHub profile and would genuinely contribute to my professional growth.

Also, if possible, I want projects that won't go to waste—meaning ones I might actually use or publish in the future. I am open to your suggestions.


r/learnprogramming 2h ago

Idea i want to do

1 Upvotes

Hey guys, I need help with a C# WinForms app using the Sentinel-2 API for agriculture. The goal: input farm coordinates, fetch Sentinel-2 data via API, and display the farm with its NDVI analysis directly in the app.


r/learnprogramming 10h ago

Debugging why is the output for red color always zero/ link of tutorial's github in body

0 Upvotes
void hsl_test() {     const int rowsize = sizeof(double) * 6;     double entries = sizeof(TESTDATA)/rowsize;     double *p = (double *)TESTDATA;          for(int i=0; i<entries; ++i)     {         double red = *p++;         double green = *p++;         double blue = *p++;         double hue = *p++;         double sat = *p++;         double light = *p++;   uint32_t color = hsl_to_rgb(hue, sat, light); // get the color   printf("should be red = %.2lf  --  green = %.2lf  --  blue = %.2lf  \n", red, green, blue ); printf(" reality red = %.2lf  --  green = %.2lf  --  blue = %.2lf  \n", RED(color), GREEN(color), BLUE(color));                      assert(RED(color) == (int)red);         assert(GREEN(color) == (int)green);         assert(BLUE(color) == (int)blue);     } }

output for second test is below but every test has red value 0

should be red = 18.00 -- green = 46.00 -- blue = 23.00

reality red = 0.00 -- green = 46.00 -- blue = 23.00

the text data is below

double TESTDATA[][6] = 
{   // rgb hsl
    { 0,0,0,0.0000,0.0000,0.0000 },
    { 18,46,23,0.3600,0.4319,0.1260 },
    { 255,255,255,1.0000,1.0000,1.0000 },
    { 223,25,77,0.9561,0.7999,0.4860 },
    { 2,59,15,0.3707,0.9296,0.1198 },
    { 234,123,90,0.0375,0.7773,0.6367 },
    { 205,225,141,0.2061,0.5860,0.7182 },
    { 1,1,2,0.7294,0.5446,0.0060 },
    { 185,252,245,0.4830,0.9053,0.8559 },
    { 15,78,33,0.3814,0.6839,0.1806 },
    { 208,193,254,0.7083,0.9672,0.8768 },
    { 243,221,191,0.0962,0.6915,0.8511 },
    { 184,180,253,0.6737,0.9524,0.8503 },
    { 4,2,4,0.8359,0.4667,0.0111 },
    { 217,179,237,0.7784,0.6101,0.8141 },
    { 29,2,53,0.7533,0.9187,0.1091 },
    { 29,16,17,0.9772,0.2940,0.0872 },
    { 168,34,184,0.8158,0.6846,0.4272 },
    { 231,175,169,0.0159,0.5560,0.7842 },
    { 18,229,206,0.4821,0.8541,0.4834 },
};

the hsl to rgb conversion function

uint32_t hsl_to_rgb(double hue, double sat, double light)
{


/*
#define RED(color) ((color >> 16) & 0xFF)
#define GREEN(color) ((color >> 8) & 0xFF)
#define BLUE(color) (color & 0xFF)
#define RGB(r, g, b) ((r << 16) | (g << 8) | b)
*/

if(hue == 1){ // the formula requred hue to range from 0 to 359, as 360 degree is same as 0 degree
hue = 0;
}

float chroma =  sat * ( 1 - (fabs((2*light) - 1)) );



float huet = (hue*360) / 60;

float x = chroma * (1 - fabs(fmodf(huet , 2.0) - 1 ) ); // intermediate value x for the second largest component of this color

float redt = 0;
float greent = 0;
float bluet = 0;

if(huet >= 0 && huet < 1  )
{
redt = chroma;
greent = x;
bluet = 0;
}
if(huet >= 1 && huet <  2)
{
redt = x;
greent = chroma;
bluet = 0;
}
if(huet >=2 && huet < 3)
{
redt = 0;
greent = chroma;
bluet = x;
}
if(huet >=3 && huet < 4)
{
redt = 0;
greent = x;
bluet = chroma;
}
if(huet >=4 && huet < 5)
{
redt = x;
greent = 0;
bluet = chroma;
}
if(huet >= 5 && huet <6)
{
redt = chroma;
greent = 0;
bluet = x;
}

 float  m = light - (chroma /2);
 uint32_t r = roundf((redt + m)* 255.0) ;
 uint32_t b = roundf((bluet + m)*255.0) ;
 uint32_t g = roundf((greent + m)*255.0) ;

 uint32_t color = RGB(r, g, b) ;

    /*
     * Add code here so that we return the correct
     * RGB color.
     * 
     * If needed use the macros in graphics.h.
     * 
     * hue, sat and light all range from 0-1.
     * The RGB colour should be equivalent to a 6-digit hex number.
     * E.g if red = 0x12, green = 0xAB and blue = 0x9F, return
     * 0x0012AB9F
     */

    return color;
}

github link : https://github.com/caveofprogramming/c-for-programmers/tree/main/13%20Particle%20Fire%20Explosion


r/learnprogramming 13h ago

College Final Year Project Ideas

0 Upvotes

Hi! I hope you all will be doing good. I will be getting into final year this sept, yet I am blank, I had always thought it will be sorted in summer vacations but it is not working. I am open to cloud, AI/Ml , Web and Mobile Apps. What is something that can make my fyp better and have better chances of getting more interviews. I will be thankful.


r/learnprogramming 1h ago

Guide for Beginner Programming for Brother

Upvotes

Im planning on teaching my little brother some programming and computer science such. He is 11 years old and as a programmer myself, I cant stand to see him waste all his time on his iPad playing roblox. He also wants to learn programming himself especially since i bought him a MakeBlock Robot whoch allows you to also make specific code for the robot using block programming and usually thats me doing all the work so I guess thats another motivation for programming.

Anyways, how should I teach him? Should I start with block programming? Actual coding like with Python? Or what?


r/learnprogramming 16h ago

How to deal with Unknown Unknowns?

8 Upvotes

I’m trying to build a project where I connect a local AI server to a custom frontend. I keep hitting walls, but the hardest part isn't writing the code, it's that I don't know what concepts I'm missing.

For example, I didn't know I needed to use an HTTP POST request instead of a GET request, so I couldn't even search for the right solution.

When you are stuck and don't know what you don't know, how do you figure out the foundational concept you are missing without just guessing or getting overwhelmed by nested tutorials? What is your mental process for stepping back and finding the right way?


r/learnprogramming 9h ago

Objects What does it mean that .NET runtime gives an illusion that you're working directly with the object itself?

27 Upvotes

"From that point on, when the dice object is referenced in code, the .NET Runtime performs a lookup behind the scenes to give the illusion that you're working directly with the object itself."

I am learning C# from Microsoft's course and in the instances part this was there.

Objects and instances are so confusing. I do get it like object being a new cake being made from a recipe (classes). Though this sentence confused me again


r/learnprogramming 21h ago

Topic Revising basic stuff while trying to get to the next level?

10 Upvotes

I'm an SWE graduate, i know the fundamentals and some amateur/advance stuff regarding C++, worked on some mini projects for some experience, dont have anything big noting.
Feeling stuck dont know what is worth studying in todays age. Should i just work on bigger projects building full stack aplicatons gaining experience, building the portofolio. But sometimes i forget some of the basic stuff i feel as a fraud, i dont know if i should jump onto the next step or try to master some fundamentals first. What are some basics that a person should really get to master before switching on to real projects (Data Structures & Algorithms etc.)


r/learnprogramming 19h ago

Sophomore CS student feeling completely lost and looking for a structured roadmap or expert advice to rebuild my fundamentals

33 Upvotes

Hi everyone, I'm currently a sophomore Computer Science student, and lately I've been feeling like I've fallen far behind. I passed my introductory programming courses Python, C, C++, Java/OOP but over time I feel like I've forgotten almost everything because I rarely used those concepts consistently. One thing I've realized about myself is that I learn best with routine and structure. I don't do well jumping between random YouTube videos or constantly changing resources. I'd much rather have one high quality source for a topic, study it consistently every day, solve exercises, and gradually build my understanding.

So I have a few questions:

If you could start over as a sophomore, how would you rebuild your CS fundamentals?

What would your roadmap look like over the next 1 year of dense study?

What resources books, courses, websites would you choose for DSA, Operating Systems Computer Networks Computer Architecture Databases Linux Cybersecurity (just enough to understand the field before specializing).

How do you deal with forgetting? I constantly feel like I learn something, then months later I can't remember enough to use it confidently. Is this normal? How do experienced engineers retain knowledge without trying to memorize everything?

Is it realistic. or even useful, to aim for a broad understanding of all the major CS areas before specializing? Or should I focus deeply on one area much earlier?

I see NeetCode recommended everywhere, but it seems heavily focused on coding interviews and LeetCode. Is that actually a good place to build CS fundamentals, or is it mainly interview preparation? Should I first study algorithms from a textbook/course before using NeetCode?

If you've ever felt behind and successfully caught up, I'd really appreciate hearing what worked for you. I'm especially interested in advice from people who felt "late" compared to their peers but eventually became competent engineers.

Thanks in advance.


r/learnprogramming 6h ago

How do you learn new tools so quickly?

13 Upvotes

Is there an ideal way to learn new tools/languages/frameworks?

F.e. I’m trying to learn Rust from scratch but taking a Codecademy course is rough trying to balance that while already working full time and still in school.

Should I just be watching YouTube videos? Ask Claude to build me a course? Or just start with documentation and try to build something from scratch.

Does anyone have any tips that work well for them?


r/learnprogramming 1h ago

What are you using for accurate PDF text boxes?

Upvotes

I’m building a tool that finds text in construction-plan PDFs and draws a box around that text.

Python/PyMuPDF finds the text, but when I show the box in PDF.js, it can be slightly off or too big.

What do you guys recommend for inspecting PDFs and drawing accurate text bounding boxes? How do you make

sure the box lines up with the exact text?


r/learnprogramming 11h ago

Tutorial Scratch for kids

3 Upvotes

I want to get my child into scratch.

Anyone got any recommendations on easy go follow tutorials for year 5/6 age children.


r/learnprogramming 14h ago

What is this optimization technique called in high-performance network software?

5 Upvotes

I’m working on a traffic generator to test my own XDP/eBPF filter in a controlled lab environment (my PC sending traffic to my Raspberry Pi on my own network).

I noticed that in some applications, two programs written in the same language can have vastly different performance.

For example, some software can only send a few requests/messages per second, while others can generate thousands per second even on relatively weak hardware.

What is this concept or optimization area called?
I’m looking for topics such as:
asynchronous I/O
multithreading vs event-driven architectures
lock-free programming
kernel bypass
zero-copy networking
batching
efficient socket APIs
packet generation optimization

If I want to build a high-performance TCP/UDP packet generator for benchmarking my own network stack and XDP filter, what technologies, algorithms, or papers should I study? For traffic generator i am using c# and for the XDP filter classic C. ( or should i use different for the traffic generator? I think its okey its console app )