r/learnprogramming • • 7d ago

Code Review Why do we use return?

189 Upvotes

I'm starting the Harvard CS50 Course (I'm on Lecture 1), and I noticed that the dude uses "return n" at the end of the code. He explained it... Well... returns, but I don't really get it. What does "returning" mean? I've seen people explain it but they go, "Oh, that basically returns a value," like ????

Can someone please explain using non-coding terms? I know beginner Python up to like loops and defining functions.


r/learnprogramming • • 6d ago

Ragionare

2 Upvotes

Hi! I'm in my first year of university and I'm studying Computer Science! Ever since I was little I've always been interested in this world but I never had the chance to take this subject as a path and by myself I learned a bit of HTML but nothing special. In my school path unfortunately I had a lot of study problems and only in the last years I learned how to study properly. The problem is that now I'm facing another big problem: reasoning when I write code. Unfortunately the schools I attended were really low level and they didn't teach us, for example in maths too, how to build real reasoning and now I have to admit that it's not really my strong point to reason about these things, so I'm struggling because I'm veeery used to going by intuition or logic, but not to reasoning really deeply about that thing. I manage to do simple codes but as they get more complicated it gets more and more difficult for me to reason even about the algorithm behind it. Yes, I do a lot of exercises, even starting from some simple ones, but unfortunately I don't notice improvements... Last week I had a midterm test that I didn't pass and while I was doing it it's as if my mind stopped reasoning and went on intuition and exactly because of this thing I couldn't move forward :') is there any advice that could be useful for me? Is there something I'm doing wrong? I don't know but this thing makes me so sad T-T


r/learnprogramming • • 7d ago

What is the point of object oriented design?

232 Upvotes

Hello! I am still relatively new to programming, so my apologies if this is an obvious question, or if this is the wrong subreddit, but I never saw the point of using classes. For context, I only really use Fortran and C++. I used python before that, but nothing else.

When I am programming, I always find myself using data structures like the thing that you say struct for, and namespaces to organise data and functions. My thinkatron never really considers using classes, so I don't really see the point or indeed how they are different to the datatype defined with the struct keyword. Thank you!


r/learnprogramming • • 6d ago

Tutorial How do I setup a Socket Client, that sends Data through Tor?

1 Upvotes

So, I know how I get a Server to being accessible trough the Tor-Browser with an onion address, but how do I write a Client, which can for example access a .onion address, or any ip over the tor network? Some Information: I'm not new to Socket programming, I already did some http Server in C and some basic Server-Client projects, but I didn't really find an answer to that and I forbid myself to use AI this moth. I hope I got the right subreddit.

Edit: Maybe important, I'm using Linux.

TL;DR: If anyone got the same question in the future: I can't post a full solution, but when you start the tor service, it listens on port 9050 as a SOCKS(5) proxy by default, so you send some handshake bytes and after that you can use it as a normal socket to you destination! How the handshake works is explained by u/jjangg96 or here --> https://medium.com/@nimit95/socks-5-a-proxy-protocol-b741d3bec66c and https://www.rfc-editor.org/info/rfc1928/


r/learnprogramming • • 8d ago

Is C++ systems / performance work a good bet for a 2027 grad, or am I training for a job AI will change?

32 Upvotes

I'm a 4th year software engineering student in Israel, graduating in 2027, and I keep going back and forth on a direction. I'd like to hear from people who actually do

these jobs.

The plan I have now: get good at C++ and performance work (threads, memory, profiling, OpenMP/MPI), and later move toward AI infrastructure, the people who make models

train and run fast. I like low level work, my best course grade was C/C++, and it feels harder to automate than building another CRUD app.

What bothers me:

- Part of the plan is writing a lot of code by hand, without AI, to really learn it. Everyone around me uses AI for everything. Is that still worth it, or am I

practicing for a job that won't look like this in 3 years?

- I don't see many junior C++ / HPC openings. Most ads want a master's or years of experience.

- I don't see many junior C++ / HPC openings. Most ads want a master's or years of experience.

- The other option is DevOps / platform as a first job because it's quicker to get into (I did a DevOps course), and moving later.

Questions:

  1. If you work in C++ systems, HPC or ML infra: how did you get your first job there? Do juniors get hired?
  2. Is "learn to write it yourself first" still good advice in 2026, or should I get really good at working with AI tools instead?
  3. In my place, would you start in DevOps and move later, or go straight for systems?

Thanks, honest answers are more useful to me than nice ones.


r/learnprogramming • • 7d ago

20 years old, in my 4th year of pharmacy school, but thinking about exploring a completely different career path. Any advice?

11 Upvotes

So I'm 20 years old, currently in my 4th year of pharmacy school. My grades are great and everything, but honestly, I just don't see myself doing this long-term.

I'm not planning on dropping out or anything, and I'll probably still end up working as a pharmacist, but I don't want to limit myself to just one career path.

Lately, I've been thinking about picking up some new skills and teaching myself something online. The problem is, I genuinely have no idea what to get into.

I've considered software development, but with how quickly AI is advancing, I sometimes wonder whether it's even worth getting into at this point. I'd especially love to hear from people already working in tech. If you were starting from scratch today, would you still recommend software development? Are there other tech-related skills or fields you'd suggest looking into?

I'm not necessarily looking for something that'll make me money overnight. I don't mind spending months, or even years, learning a skill as long as it's worthwhile and could open up other opportunities for me.

I guess I'm just looking for some direction. Would love to hear your thoughts, especially from people who've been in a similar position or have experience in tech.


r/learnprogramming • • 7d ago

Is it still worth specializing in one area of programming with AI getting better?

0 Upvotes

Guys, I've been thinking about this lately. With AI getting better at writing code, I'm starting to wonder what we should actually focus on learning as developers. Back then, getting really good at one thing, like backend, frontend, or mobile development, seemed like the obvious way to go. But now I'm not so sure. Should we still spend years mastering one area? Or is it better to learn a bit of everything, including stuff outside programming like business, product design, or communication? I mean, being a specialist still has value, right? But if AI can handle more and more of the technical work, what actually makes a good developer stand out?

I'm curious how you guys are approaching this. Are you going deeper into your specialty, picking up other skills, or just sticking with what you've always done?Especially those who've been coding long before AI became a thing. Has your approach to learning changed at all?


r/learnprogramming • • 7d ago

My colleague Franceska Xhakaj's intro programming course at Carnegie Mellon (15-110) is now free on YouTube

8 Upvotes

Disclosure: Franceska is my colleague at CMU, and I help run CS Learn, the program that publishes the recordings.

15-110, Principles of Computing, is Carnegie Mellon's introduction to programming for students with no experience at all. Franceska is a terrific teacher, and the full classroom lectures are now free, edited with captions and chapters. The first three are up, and a new one goes up every Monday.

It's the real course as CMU students take it, so it moves at a university pace and builds from the basics of programming toward how computers solve problems.

Links are in my first comment.


r/learnprogramming • • 7d ago

Development Path in C# .NET Backend and Motivation

3 Upvotes

Hi everyone! To give you some background: I graduated from university with top marks. That’s where I first started programming—we were taught a little bit of everything, including Pascal, C++, PHP, Python, C#, and so on.
Our coursework always covered up to OOP (Object-Oriented Programming), but never went any further.
I also studied C# and Python on my own, but again, I never really ventured much beyond OOP.

During my studies, I tried to avoid web development because it didn’t particularly interest me; however, after graduating, I realized that most of the job market is in web development, so I need to find a way to get comfortable with it. Since I’m most familiar with C#—and it’s the language I enjoy the most—I’ve decided to focus on C# backend development. But a few issues have come up:

It’s been a 2 years since I graduated, at that time, I had to find a job quickly, and it wasn’t in the field I had actually studied for; now, I want to return to my studies so that I can finally work in my chosen profession. and I’m not sure what tech stack I actually need to know to build a project of my own. Also, how can I recover the knowledge I gained during my studies? This uncertainty makes me procrastinate whenever I set out to learn something new, or I end up not dedicating enough time to actually master anything.

A crisis of ideas. Even back in university, I struggled to come up with projects to build. I have a persistent feeling that everything has already been created by more skilled programmers. Is it even worth working on a project if a more successful version already exists? How does one go about choosing a suitable project topic?

AI. The rise of AI happened around my third year of university, and we even started experimenting with it a little bit back then. It’s one thing to enter a prompt to get some guidance for a specific task, but it’s quite another to actually learn something and build a project of your own. How should one interact with AI models when learning? Should you even use them at all? I recall plenty of times spent endlessly tweaking prompts, trying to get a decent result—when, in reality, it would have been faster to just write the code from scratch myself. What is the right way to learn programming today using AI (given that AI is clearly here to stay)?

Right now, I’m trying to learn ASP.NET through a course by Teddy Smith on YouTube, but I’m struggling to grasp a lot of it. Plus, I’m essentially just following along and mimicking what he does—which isn’t really the kind of learning process I’m used to.


r/learnprogramming • • 8d ago Heartwarming

Resource A new, supportive subreddit for programming without LLM assistance. r/codedbyhand

279 Upvotes

r/codedbyhand

More people, myself included are becoming disillusioned with the experience of coding with AI assistance and are turning back to traditional programming.

Some may do it because they feel their hard won skills are diminishing as they become over-reliant on the technology, some for ethical reasons related to the environment or intellectual property, some simply because they are highly competent programmers with an established workflow who don't feel the need to use AI assistance, and some because they are seeking an intellectual challenge.

It can be argued that heavy AI usage is harmful to computer science education. Learning to program is difficult, and high level skill can only be achieved with lots of practice, making mistakes and struggling to solve difficult problems. Even among those who embrace the technology, programmers who are over-reliant upon LLM may never develop the technical competency needed to audit the code produced by AI.

If you are using AI for coding, and feel satisfied with your experience, that is fine. I'm not trying to change your mind. However, I and many others feel that the disadvantages of these changes to the programming landscape are not being adequately addressed.

That's why I created r/codedbyhand, a new subreddit that supports traditional programming, provides resources to assist those programming without LLM assistance, and highlights projects that programmers who don't want to use AI can contribute to without being pressured, such as Zig, Gimp, Cataclysm Dark Days Ahead and many others.

If that sounds nice, come check it out.


r/learnprogramming • • 7d ago

What should I do as a 2nd year CS student interested in low level programming ?

3 Upvotes

I already have a project - GPU accelerated terminal emulator


r/learnprogramming • • 7d ago

I want to recreate a simple program I made in C++ but as an unofficial apk/app so I can use it on my phone, how can I go about doing that?

1 Upvotes

The program is extremely basic. It is a quiz that takes input in a way where it checks to see what keywords are included in the answer to verify if it is true or not, as opposed to manually having to have the answer be word-for-word correct. It was great for not only practicing programming, but for studying as it was related to a topic I wanted to learn.

I know nothing about app development. I know AI can create apps, and I was gonna search to see if AI can make it, but then I realized how absurd that would be considering what I want to create is something I already created before in another language.

How can I go about making it and running it on my phone? There isn't gonna be graphics or anything like that.


r/learnprogramming • • 8d ago

Best tools/languages to learn for devops?

6 Upvotes

I plan to go into devops/ platform engineering. what are the best tools/programming languages to learn? Are python and bash good starters?


r/learnprogramming • • 7d ago

HOW TO WIN ANY HACKATHONS?

0 Upvotes

What is the secret of winning any hackthons? I have participated in many hackathons but never made it to the final rounds. I have got feedbacks that problem statement is good but the architecture ia not so great. So give me some advice and tips to master hackathons.


r/learnprogramming • • 7d ago

Need help

0 Upvotes

Chat im building a AI type bubble software that has multiple agents giving answers at a time, but what I want is to apply another api on top of it so that it will analyse all the answers and give me one result.

Few things in which i would like to get some help -

• for the concept - do you think this is good for a self project or should I add another thing in this

• I tried to apply a separate agent over all others but all the time I get errors.

• third is about responsiveness, sometimes the api model didn't work at all stating 'server too busy'

My base language is python


r/learnprogramming • • 7d ago

Is it normal to feel down during situations like this?

1 Upvotes

Hello, I'm a university student in my final year, going to work on my final year project soon.

I found interest in backend development, been struggling with studies cause I can't use a day to understand a concept so I go through several times to know how it works and what to do about it.

Now, in a week's time, I will be meeting my project supervisor about what to do cause he suggested we work on a health management system, and my group and I will be doing more research before we start anything. My problem is that, among the group, I see myself a little bit ahead cause I try to understand what it takes to build a system(software development), and from what the project supervisor said to me, he wants us to implement an ML model. I'm yet to know more about it.

I feel we can do this together as a team, but they feel that, with the help of AI, which will help sometimes, things will be easy cause they will upload the whole project documentation, prompt it, and get the final results, and if it doesn't match, more prompting.

I'm still learning, and I feel we can't finish this before the academic year ends. Cause when we start now:

  1. I don't know how to host an application.
  2. Buy a domain and link it to the site.
  3. Security measures to ensure the app works fine.
  4. I feel the whole load will be on me.
  5. What it takes to build a whole functional mobile application.

I honestly don't know what to do now. The programming language I'm learning is Python, and I haven't started with Django yet.

Please advise, or anything will help. Thank you for your time.

I asked what they could all do when we start; the response I got was that we can do this, and they believe I'm here and AI is also here, so things will be easy.


r/learnprogramming • • 7d ago

Tutorial Building a shell in C from scratch made me realize how similar it is to modern AI Agents

0 Upvotes

Hey folks,

I'm currently halfway through Stephen Brennan's classic "Write a Shell in C" (lsh) tutorial. It's a fun read so far, though it feels a bit too hand-wavy—it shows how to glue fork(), exec(), and wait() together, and leaves me itching for the actual official specs and deeper design docs.

It got me thinking about two things:

First, how did the OG legends like Ken Thompson or Stephen Bourne actually architect the early UNIX shells from a blank slate? I want to read the real foundational papers, POSIX docs, or historical design breakdowns instead of just toy tutorials.

Second—linking the classic Read -> Parse -> Execute loop to modern AI Agents—it feels remarkably similar to how agents parse context and dispatch tools.

Looking for recommendations on historical specs, papers, or minimal shell source repos. Drop them below. Thanks! And hopefully I'll stick with documenting my learning journey here ;)


r/learnprogramming • • 8d ago

What's the best way to learn Git and GitHub effectively?

16 Upvotes

I'm looking to learn Git and GitHub from scratch.

What's the best way to learn them effectively? Which resources would you recommend, and how should I practise to become comfortable using them in real projects?

I'd appreciate advice from people who have learned them or use them regularly.


r/learnprogramming • • 7d ago

How do i code a theme for a website without having any prior knowledge to programming?

0 Upvotes

Hi everyone, i am not a programmer nor have done anything similar or related in the past but due to some current circumstances id like to know how to create a specific, but very easy theme layout for a brand website. I already have a clear inspo to in general.

the brand website is on a server/platform similar to “shopify” (an e-commerce platform where u create a store for a brand or so etc..)

Only issue is i couldn’t find any already available themes suitable for my liking or my vision.

Is there a way i could create a theme with Claude? Or maybe learn from a trusted course or a tutorial?

How do i do that? Any tutorials?
or what should i know?

Thanks help is very much appreciated


r/learnprogramming • • 8d ago

how do you ‘learn to code’?

25 Upvotes

Hi all, so i’m a cs major and i know the fundamentals of coding and data structures, but i don’t know how to ‘learn to code’ for a project

for context, i’m trying to learn Flask. im using claude code to write a Python notebook that teaches me how to build what i want, but this feels really weird

i want to learn how to build the apps myself, which is the intent of the whole notebook thing, but i often feel bogged down by what claude generates

that’s when i go online to look up some kind of Flask tutorial, but im not sure what to look up, or whatever idea is in my head feels too complicated for what i know how to do. so i was curious, how do i learn these tools? do i just build and hope i understand? or do i read thoroughly? or some middling thing?


r/learnprogramming • • 8d ago

Competitive programming New to comp programming...HELP!

0 Upvotes

I've got a coding olympiad(ZCO-Indian route to IOI) to give in around 20 days and I have not started anything yet.

I'm familiar with C++, python , Java(gave AP CSA) but new to problem solving or DSA but totally new to problem solving/DSA or CP.

Here's the syllabus: https://www.iarcs.org.in/inoi/online-study-material/topics/

  • Efficiency
  • Searching
  • Sorting
  • Basic Graph Algorithms
  • Dynamic Programming
  • Greedy Algorithms
  • Computing Shortest Paths
  • Heaps
  • Permutations
  • Directed Acyclic Graphs
  • Computing Prefix Sums
  • Sliding Window Algorithms

Can anyone guide me with a roadmap or resources??


r/learnprogramming • • 8d ago

Does it get better?

11 Upvotes

I had just gotten done with my first basic weather app project using react and python for backend and started a new project, thing is I feel like I’m back a square one, I freeze at what to start and forget syntax of code I used in my last project. Is this something that gets better with spamming a bunch of projects or am I learning wrong?

For reference I would think of the components needed for the app and use the internet or ai for the coding concept/ syntax needed for the code that does the function I need( I do manually write the code and figure out what should go where for the most part, though Im unsure if this is relying on ai too much too). For debugging I also mostly use ai and try to solve it a bit myself at first too(I feel like using ai is fine here as debugging comes from experience, correct me if I’m wrong). So am I learning wrong or do I need to just endure and spam projects?


r/learnprogramming • • 8d ago

Debugging 1 copying HTML into Word while preserving (certain) white space

0 Upvotes

I have a web app I've put together that outputs text. For reasons (long story), I need to copy said output into a Word document while preserving the formatting. To do this, I copy the whole HTML output (not just the raw text) via JavaScript. It mostly works, but I can't get it to preserve more than one non-breaking space, e.g. spaces between sentences.

The HTML is copied to the clipboard as a Blob with a MIME type of text/html. It handles line and paragraph breaks fine, but as I said, condenses two spaces after a period to one.

I've tried including a <style> tag in the Blob along with the actual HTML (mostly <p> tags), as well as in-line styles within the <p> tags themselves. I've also tried telling Word to preserve the original formatting or merge it, both with the same result.

If I instead copy the HTML as raw text (without tags) using the writeText() method of the Clipboard API, the white space is preserved. However, this raises its own problems, mainly that I sometimes need to include bulleted lists. If I copy the full HTML with <ul> tags Word handles this fine (other than the aforementioned white space issue). If there's a way to copy plain text and still have Word register it as a bulleted list, that could probably work as well.

This is obviously not the end of the world, but it's something I'd like to fix if I can.

If it helps, here's the JavaScript for copying the HTML:

function toClipboard(text) {
    const type = 'text/html';
    const dataBlob = new Blob([text], {type});
    const data = [new ClipboardItem({ [type]: dataBlob})];
    navigator.clipboard.write(data).then(
        /* snip */
    );
}

r/learnprogramming • • 8d ago

Rate my first project

4 Upvotes

Hello! I've started learning python abt 2 weeks ago and till now, I just know the basics. I've created my very first project on my own (I only asked ChatGPT for project ideas but the rest was on me) and this is what I've done in abt an hour.

I'd like you guys to tell me how can I get better. I know many things are may be missing regarding calculations and operators.

print("===========================================")
print()
print()
print("     BASIC & ENGINEERING CALCULATOR   ")
print()
print()
print("===========================================")
calc_type = input("What type of calculator do you want to use?: Basic, Engineering ").capitalize().strip()
if calc_type =="Basic":
    operator = input("Enter the operator (+, -, *, /, ^):")
    num1 = float(input("Enter the first number:"))
    num2 = float(input("Enter the second number:"))
    if operator == '+':
        result = num1 + num2
        print(f"The result of adding {num1} and {num2} is: {round(result,2)}")
    elif operator == '-':
        result = num1 - num2
        print(f"The result of subtracting {num1} and {num2} is: {round(result,2)}")
    elif operator == '*':
        result = num1 * num2
        print(f"The result of multiplying {num1} by {num2} is: {round(result,2)}")
    elif operator == '/':
        result = num1 / num2
        print(f"The result of dividing {num1} by {num2} is: {round(result,2)}")
    elif operator == '^':
        result = num1 ** num2
        print(f"The result of raising {num1} to {num2} is: {round(result,2)}")
    else: 
        print("Enter a valid operator!")
elif calc_type == "Engineering":
    calculations=input("What do you want to calculate?: Force, Density, Speed ").capitalize().strip()
    if calculations == "Force":
        mass= float(input("Enter the mass value: "))
        acceleration= float(input("Enter the acceleration value: "))
        Force = mass * acceleration
        print(f"The Force is equal to {round(Force,2)} N.")
    elif calculations == "Density":
        mass= float(input("Enter the mass value: "))
        volume= float(input("Enter the volume value: "))
        Density = mass/volume
        print(f"The Density value is {round(Density,2)} kg/m^3 ")
    elif calculations == "Speed":
        distance = float(input("Enter the distance travelled: "))
        time = float(input("Enter the time in seconds:"))
        Speed = distance/time
        print(f"The Speed is {Speed} m/s")
    else: 
        print("Enter a valid calculation type!")
else:
    print("We only offer Basic & Engineering calculations")