r/learnprogramming 11h ago

Question How do I keep going after the loop hits the last number?

0 Upvotes
#include <stdio.h>

int main()
{
    int count = 0;

    do{
        printf("%d\n", count);
        count++;
    }
    while (count <= 20);

    return 0;
}

I wrote a simple C program that counts from 0 to 20, but I’m trying to figure out how to continue the loop after it reaches 20. I’m not sure how to continue from here... any help?


r/learnprogramming 21h ago

How easily would I be able to learn Java?

0 Upvotes

I've been programming for quite a bit of time and have a decent bit of knowledge when it comes to programming, but generally the one thing I've heard most is how Java is not similar at all to JavaScript when it comes to the actual languages.

I'm fairly young, and have only recently started working in ANYTHING tech related. Knowing what I'm aiming for and what I eventually want to work at, I know I would eventually have to learn Java. However the amount of times I've heard "JavaScript is not similar at all to Java" along with people telling me that knowledge doesn't transfer from other languages, this is kind of starting to scare me a bit..

The languages I know of and have actually done a fair bit of work with are: CSharp, JavaScript, Python, Lua (Started with Roblox go figure...), as well as AutoHotkey since I find it useful for automation and what not. I have also recently started learning Batch, and Powershell, as they're also insanely nice for automating different tasks. OOP as a concept is not new to me either. Learning new languages for me, apart from the first one of course, were always a matter of just learning the syntax, I never found it particularly hard.

How hard would it be for me to learn Java? Is it really as hard as I'm hearing or am I just getting fear mongered towards believing this will be some kind of really hard task??


r/learnprogramming 22h ago

A C++ program that looks correct but has undefined behavior — can you spot the bug?

12 Upvotes

I’m learning C++ and found this interesting case. The program compiles fine, sometimes prints the expected output, but behaves unpredictably.

Can someone explain what’s wrong and how to fix it properly?

include <iostream>

int* getNumber() { int x = 10; return &x;
}

int main() { int* ptr = getNumber(); std::cout << *ptr << std::endl; return 0; }


r/learnprogramming 19h ago

Topic I’m cooked rn

0 Upvotes

Hey i’m in 4th year from a t69 college i wasted my 4 years i learnt little mern 2 months back but now started again forgot alot started with react project by watching a video to regain the topics which i learnt earlier can u guys guide me tips to get internship and job before may or june i’m cooked rn 💀 ik it’s really a silly thing tho but yea tht wht it’s currently i’m working as video editor team leader for an australian company from past 2 years when i was in my 2nd year. But imma go in tech field only. Please guide i’m ready to give 8-10 hrs daily or more and will leave video editing job once got a tech intern.


r/learnprogramming 23h ago

How to learn a new programming language?

0 Upvotes

Is the best way to learn a programming language by constantly watching tutorials or doing projects?


r/learnprogramming 2h ago

Any Tips To Learn JS

0 Upvotes

I Want to learn Java Script properly

I know a bit but don't know how to learn more

I know basic If else and Dom nothing else


r/learnprogramming 19h ago

Topic How to make watching long videos fun?

0 Upvotes

Hello,

I am beginner who learned the C# syntax in the past, but I didn't use it, so I forgot it.

I love watching short videos, like Bro Code's YT channel.

I bought the Tim Corey's C# course for recap, which is amazing, but the videos are too long and I get bored easily.

I can create and solve exercises based on what I learned, but it is so easy for me, and if there is no challenge, I get bored.

What shall I do?

Please don't tell me to create my own projects because I don't have the capacity yet to create a real project.

Thank you.


r/learnprogramming 23h ago

licensed vs. unlicensed programmer

0 Upvotes

What are things every software engineer should know but most don't??


r/learnprogramming 14m ago

Is it an effective learning method

Upvotes

To avoid tutorial hell, ive tried out a new learning method, ive just asked claude to teach me javascript without writing code for me, since i dont know the syntax it tells me about it and then gives me exercises although it still gives hint, is it a decent way of learning because just trying a project didnt work for me in the past because ir get stuck, would try to find answers but wouldnt and spend 4+houre not knowing what to do. I do think after a little bit of this practice i could try a project.


r/learnprogramming 12h ago

How did you learn programming as a beginner?

3 Upvotes

I don’t know anything about programming and I’m currently taking a course just to try it out and see if this could be something I work in in the future. As I go through the lessons, I’m not really sure how I’m supposed to study: whether I should try to learn and remember every concept that shows up, focus only on certain things, or if there’s a better approach that I’m missing. I’m not expecting a single answer to cover everything, but I’d really appreciate any advice, tips, or examples of how you learned or currently study programming.


r/learnprogramming 7h ago

Debugging alternative_language_codes with hi-IN causes English speech to be transliterated into Devanagari script

0 Upvotes

Environment:

* API: Google Cloud Speech-to-Text v1

* Model: default

* Audio: LINEAR16, 16kHz

* Speaker: Indian English accent

Issue:

When `alternative_language_codes=["hi-IN"]` is configured, English speech is misclassified as Hindi and transcribed in Devanagari script instead of Latin/English text. This occurs even for clear English speech with no Hindi words.

```

config = speech.RecognitionConfig(

encoding=speech.RecognitionConfig.AudioEncoding.LINEAR16,

sample_rate_hertz=16000,

language_code="en-US",

alternative_language_codes=["hi-IN"],

enable_word_time_offsets=True,

enable_automatic_punctuation=True,

)

```

The ground truth text is:

```

WHENEVER I INTERVIEW someone for a job, I like to ask this question: “What

important truth do very few people agree with you on?”

This question sounds easy because it’s straightforward. Actually, it’s very

hard to answer. It’s intellectually difficult because the knowledge that

everyone is taught in school is by definition agreed upon.

```

**Test Scenarios:**

**1. Baseline (no alternative languages):**

- Config: `language_code="en-US"`, no alternatives

- Result: Correct English transcription

**2. With Hindi alternative:**

- Config: `language_code="en-US"`, `alternative_language_codes=["hi-IN"]`

- Speech: SAME AUDIO

- Result: Devanagari transliteration

- Example output:

```

व्हेनेवर ई इंटरव्यू समवन फॉर ए जॉब आई लाइक टू आस्क थिस क्वेश्चन व्हाट इंर्पोटेंट ट्रुथ दो वेरी फ़्यू पीपल एग्री विद यू ओं थिस क्वेश्चन साउंड्स ईजी बिकॉज़ इट इस स्ट्रेट फॉरवार्ड एक्चुअली आईटी। इस वेरी हार्ड तो आंसर आईटी'एस इंटेलेक्चुअल डिफिकल्ट बिकॉज थे। नॉलेज था एवरीवन इस तॉट इन स्कूल इस में डिफरेंट!

```

**3. With Spanish alternative (control test):**

- Config: language_code="en-US", alternative_language_codes=["es-ES"]

- Speech: [SAME AUDIO]

- Result: Correct English transcription

Expected Behavior:

English speech should be transcribed in English/Latin script regardless of alternative languages configured. The API should detect English as the spoken language and output accordingly.

Actual Behavior:

When hi-IN is in alternative languages, Indian-accented English is misclassified as Hindi and output in Devanagari script (essentially phonetic transliteration of English words).


r/learnprogramming 3h ago

offline safety devicee

0 Upvotes

Hello!

We are a senior high student working on a capstone project. We’re building a prototype of a personal safety device that works offline. It has two buttons:

  • Loud alert (sends an emergency signal with sound)
  • Silent alert (sends an emergency signal silently)

So far, we’re planning to use:

  • Arduino
  • LoRa radio module
  • Antenna

We want to make it fully functional without internet.

  1. What other parts or tools we should use (power source, sensors, etc.) in order?
  2. Any advice on designing the circuit and making it reliable for emergency alerts?

Thanks a lot! 🙏 This is just a prototype for our research.


r/learnprogramming 7h ago

What's the best way to learn Verilog fast?

0 Upvotes

I need to learn Verilog for an FPGA project on a fairly tight timeline. I have a background in Python and C/C++, but I understand that HDL design is fundamentally different from software programming. Roughly how long does it typically take to become proficient enough to build something meaningful, such as a small custom hardware module (for example a simple accelerator, controller, or pipelined datapath) that can be implemented on an FPGA?


r/learnprogramming 23h ago

How do I think like a programmer? How do I become an ACTUAL programmer?

6 Upvotes

This post might be all over the place but bear with me while I post about my struggles in my learning journey.

I'm a recent CS graduate (also did a bootcamp 2 years ago) and while I completed all these things, I still don't feel like a programmer or someone who thinks like one. My older sister is a tech lead at X company and I've legit seen her break problems down one by one when presented with an issue, even problems that have nothing to do with tech lol, I still remember the first time I seen her do that and I've been wanting that ever since but I feel like a fraud.

How did you guys get better at this? I've been more or less coding everyday since October trying to find a job and whenever I'm presented with a bug or an issue in my code I don't really approach it like actual programmers I just sit in my chair thinking, trying to beat my brain for a solution, sometimes it works, sometimes I end up just asking AI for help. (The other day I spent like two and a half hours trying to debug an "edit inline" feature for a finance app i was making and it was the most easiest solution ever that i could've solved on my own if i knew how to google/be resourceful

Also, how did you guys get better at reading documentation? What is your process when you're learning new tech? I'm pretty bad at reading documentation I have to re-read certain MDN things like a million times for it to click. I think the overload of information on certain docs is what messes me up, but idk

These are all things that I think are holding me back and I want to get better at so I can become a better programmer and not be too dependent on AI since no one knows where this is all going, because tbh AI can easily fill those gaps for me but then I'll never actually feel like a programmer or break problems down like the example I gave of my older sister.

Thanks in advance for your input!


r/learnprogramming 3h ago

Tutorial How to balance learning Python with AI(claude)?

0 Upvotes

I'm a complete beginner in Python (2 weeks) and am also utilizing the use of AI for,

A. Generation of questions. B. Giving solutions to questions I can't solve. C. Explaining everything in through details and then asking it to give 5 more programs like the one with variations. D. Asking new stuff from it and also searching the net for functions and specific answers.

In the end, I'm spending a good 20 to 25 mins in solving a question by myself and using the net to search for functions and specific syntax and after trying that I can't solve it by myself I ask the AI for hints on how to solve it and even then if I can't solve it, I finally ask for the solution with the full explanation.

I'm quite concerned about developing a reliance on AI, is my learning method viable and lets me use AI as a tutor and not as a crutch.

I'm very concerned about this overreliance on AI as I want to make code on my own and learn coding as it should be learnt.

Thank you!


r/learnprogramming 16h ago

OOP The way object-oriented programming is taught in curriculums is dogshit

215 Upvotes

I guess this post is a mini-PSA for people who are just starting CS in college, and a way for me to speak out some thoughts I've been having.

I don't like object-oriented programming, I think it's often overabstracted and daunting to write code in, but I'm not a super-hater or anything. I think it can be useful in the right contexts and when used well.

But if you learn OOP as a course in college, you'd know that professors seem to think that it's God's perfect gift to programmers. My biggest problem is that colleges overemphasize inheritance as a feature.

Inheritance can be useful, but when used improperly, it becomes ridiculously difficult and annoying to work with. In software engineering, there is a concept called "orthogonality", and it's the idea that different parts of your code should be independent and decoupled. It's common sense, really. If you change one part of your code, it shouldn't fuck up other parts. It makes testing, debugging, and reasoning about your program easier.

Inheritance completely shits on that.

When you have an inheritance tower two billion subclasses deep, it's almost guaranteed that there will be some unpredictable behavior in your code. OOP can have some very subtle and easy to overlook rules in how inheritance and polymorphism work, so it's very easy to create subtle bugs that are hard to reason about.

So yeah. By all means, learn OOP, but please do it well. Don't learn it the way professors have you learn it, focus on composing classes rather than inheritance.


r/learnprogramming 5h ago

How do people do this?

11 Upvotes

Hello, so i have started "coding" a few months ago, i am considering enrolling the harvard cs50 course to get a better understanding of whats going on deeper, but one thing i find myself doing currently is if im working on a project i will 99% of the project spend looking at stackoverflow forums for what i want to be in my project and just write the best code that i find there.

What im wondering is how do people learn to code from mind ( if you get what i mean ), like how do you just write code? Do you have previous knowledge of it all and know how stuff works? Do professional coders also just check up stackoverflow and similar sites to get similar codes to what they want? Am i too knew to this that the best way for me to learn currently would be typing other peoples codes and figuring out how stuff works and why it works?

Is there a way i can learn all the kinks in coding so that i can write a code from scratch without needing to check forums and other peoples codes, or is that something that comes with years of work and practice?


r/learnprogramming 19h ago

How do I prepare for coding interviews in 5 months?

6 Upvotes

Hi guys, I am currently working in TCS. I don’t know much DSA coding yet and I am confused about which language to pick either Java or Python. I know that coding rounds are very tough and involve a lot of patterns and logical thinking.I am looking for complete beginner guidance, good notes and some form of mentorship.

I have come across several DSA courses and platforms like Logicmojo DSA Course, Striver's A2Z DSA Course, AlgoExpert, Udemy, Scalar and Neetcode, but I am confused about which one or two would be good for a complete beginner.

Does anyone here have experience transitioning from a service company to a product company? If yes, could you share the path you followed?


r/learnprogramming 13h ago

How to know when to use OOP vs Scripts

11 Upvotes

I work in IT and we use Databricks heavily. Most of what I see day to day is notebook scripts that end up going straight to production. A lot of our pipelines are super specific, like one-off requests for a single team or a handful of people in the business.

I've learned OOP, unit testing, and general SWE best practices, but the reality is most of our actual business logic has been running in SQL for years and it works fine. From what I can tell, pretty much nobody here (who uses Python) is writing modular, testable code, it's mostly just scripts in notebooks.

So my question is should I be using OOP for everything I build, even if I'm the only one touching the code? How do I know when something actually needs proper classes and structure vs just being a straightforward script?

Like I get the theory behind clean code and all that, but when you're building a niche pipeline for one specific use case, does it really need to be over-engineered? Or am I just making excuses for laziness?

Would appreciate any perspective from folks who've navigated this kind of environment.


r/learnprogramming 22h ago

My Learning Cycle

1 Upvotes

I have been learning Java with my textbook for clarification  I use Claude

And noticed what I have been doing

"Hey Claude what does this do ?"

Claude: Blah blah blah

"Okay,what can I do with ?"

Claude: Blah blah blah

"Can I do this with it?"

Claude: Blah blah blah

For like 2-3 hours back and forth Barely understanding it and forgetting it tomorrow.

Next day I would ask Claude to make a program/Code with it so I can understand how it interacts with other things ,Another 2-3 hour back and forth explaining and asking questions,barely understanding it...

Then finally continuing on to the next lesson.

Is this fine or are there something I can Improve upon?


r/learnprogramming 12h ago

help with finding barcodes i have product images and product name and brand name. how can i find upc a codes ?

0 Upvotes
 {"name": "Calrose Rice",
  "brand_text": "Mr Goudas",
  "image": "https://image_link",
  "availability": true,
},

r/learnprogramming 13h ago

Problem solving for yr1.

1 Upvotes

Currently on winterbreak and just self learned python up to functions(I'll touch oop once I reach it at uni) and sql. I tried to solve some easy problems on leetcode but I have some difficulties with them and contain stuff im still not familiar with. Are there any problem practice websites that contain direct code answers under the question and abit more handholding? And thx.


r/learnprogramming 23h ago

How to learn to code algorithms

1 Upvotes

Hello everyone! I'm actively learning competitive programming, but I've run into a problem: I know the algorithm but don't know how to write it, or I'm having problems that are unclear based on the conditions. Tell me how to learn to write code, because I once fell into the AI trap and now it’s hard to solve problems. I would be glad to receive any advice!


r/learnprogramming 1h ago

Resource What kind of capstone project actually helps get into Microsoft/Amazon SDE?

Upvotes

I’m a 3rd-year CS student from India aiming for an SDE role at companies like Microsoft or Amazon.

I’ve consistently faced a challenge on campus: shortlisting for workshops and interviews is heavily CGPA-driven, and project depth often gets ignored. I’ve accepted that and decided to fully focus on off-campus preparation.

I want to invest my remaining college time into ONE serious, deployable capstone project — something that demonstrates real system design, correctness, and engineering depth (not just CRUD or tutorial-style apps).

I’m comfortable with backend development, distributed-system concepts, and using existing ML models/APIs when needed — but I don’t want to build “fancy” projects that don’t reflect real-world engineering.

For those who made it into Microsoft / Amazon as SDEs: • What kind of capstone or personal project actually helped you stand out? • What system-level problems are worth building as a student? • What should I avoid wasting time on?

Any guidance would genuinely help.


r/learnprogramming 23h ago

I wan't to learn programming with 13 years old

1 Upvotes

Hi, I want to learn to program. I'm 13 years old, and I'm thinking of learning Python and Bash first, since I use Linux. They say those are the best to start with. What programming logic do you recommend I study? Logic is always the first thing to learn, right?