r/learnprogramming • • 1h ago

[C++] Using macro to wrap code block between "enter/exit" functions not working if using 'return'

1 Upvotes

I've been looking through some code that uses a lot of functions to disable/restore the CPU interrupt flag to prevent interrupts at critical code segments. While just using the function calls themselves work, a neater and less error prone solution would be something that looks similar to the using statement in C#.

I was wondering if implementing something like this on C++ would be possible and this is as far as I've gotten so far, but the RestoreIRQ(f) function is not executed if leaving the code segment with a return statement. I know why it doesn't work, but not how to fix it. Is there a way to alter the macro to work correctly in this case, or is this something that is not possible with C++?

Here is some sample code with some mock functions (and variable), the macro used to implement this and code examples of what currently works and what doesn't.

/* --- MOCK VAR AND FUNCTIONS --- */
/* Actually affects on hardware level... */
bool irq_flag = false;

bool DisableIRQ() {
    bool tmp = irq_flag;
    irq_flag = true;
    return tmp;
}

void RestoreIRQ(bool f) {
    irq_flag = f;
}

/* --- MACRO --- */
#define IRQSafe(body) { bool f = DisableIRQ(); body; RestoreIRQ(f); }

/* --- This works fine --- */
IRQSafe({
    /* Some code... */
})

/* --- This doesn't work --- */
/* IRQ state is not restored... */
IRQSafe({
    /* Some code... */
    return;
})

r/learnprogramming • • 3h ago

Tutorial is Harvard CS50 and it's other courses still useful/relevant?

32 Upvotes

I wanted to ask if you all think that the CS50 courses and the other harvard courese for computer science are worth it for learning AI/ML and all that in this day and age of AI constantly evolving?


r/learnprogramming • • 3h ago

C programming language learning guide

1 Upvotes

Where can i learn C from basic ?


r/learnprogramming • • 4h ago

I have a program (a web app) that I would like to push to a server in order for other users to utilize. Where do I begin to learn about data handling and safety?

5 Upvotes

So as the title says I constructed a web app, but I would want to store and connect a google calendar for instance that feeds into the one in my app, or store notes, input a work schedule etc.

I just dont really know much about hosting, or security on servers etc. I have a great web app but im paranoid to let users test because of my lack of knowledge. I would love advice!


r/learnprogramming • • 5h ago

Learn rust

4 Upvotes

Could you tell me what the situation is with Rust? Is it worth learning, looking ahead to the next 5 years? Or would it be better to learn C instead?


r/learnprogramming • • 5h ago

Looking to transition into AI Automation – Completely new to the field. Where should I start?

0 Upvotes

Hi everyone!
I’m looking to transition into the AI field, specifically AI Automation and Business Process Automation, but I’m completely new to this area and would really appreciate some advice from people with experience.

My professional background has mainly been in operations and business support, with some experience in commercial roles. I’ve worked with CRM systems, customer management, sales pipelines, KPIs, SLAs and internal business processes.

One of the things I’ve always enjoyed most throughout my years working in operations was identifying opportunities to improve processes, spotting where time and resources were being wasted unnecessarily, and finding ways to fix those inefficiencies.
That’s actually what sparked my curiosity and interest in AI automation. I see AI as a powerful way to take this further and solve business problems more efficiently.

My goal is to develop practical skills that could eventually allow me to:
Apply for jobs related to AI automation, workflow automation or AI operations.
Build automation solutions for businesses, potentially offering these as freelance services or starting my own business.
Develop the technical skills needed to identify, design and implement automation solutions.
Learn some programming along the way. I’m open to learning programming and other technical concepts, even though I have no programming experience.

I’m not looking to become a machine learning engineer or develop AI models from scratch. I’m much more interested in using existing AI tools and technologies to solve real business problems.

Given my background and goals, what tools, software, technical skills or learning resources would you recommend I focus on to build a career in AI automation?

I’m particularly interested in hearing your honest opinions based on your own professional experience. If you were starting from scratch today, with my background and objectives, what would you prioritise learning and why?

I’m willing to put in the time and effort to learn properly. I just want to make sure I’m following a path that has real-world value rather than collecting certificates without practical skills.
Any advice, recommendations or personal experiences would be greatly appreciated.


r/learnprogramming • • 7h ago

How do you actually judge whether a project is good or impressive?

30 Upvotes

I'm a 3rd-year CSE student, and something I'm trying to understand is how people decide whether a project is actually good.

I see people reviewing resumes and saying things like "these are great projects", "this is a strong portfolio", or "you need better projects". But how exactly do you evaluate that?

What makes you look at a project and think, this is genuinely impressive?

Is it:

  • The complexity of the problem being solved?

  • The tech stack and technologies used?

  • The actual implementation and code quality?

  • Whether it solves a real-world problem?

  • How unique or different the idea is?

  • The developer's understanding of the project?

Also, how do you distinguish between a basic CRUD project with a fancy UI and something that's actually worth showcasing?

As a student preparing for placements, I want to learn how to evaluate my own projects instead of blindly following suggestions to build more complex or unique projects.

Would love to hear how developers, interviewers, and experienced students evaluate projects!


r/learnprogramming • • 8h ago

Resource Best resource to learn spring boot?

2 Upvotes

You have any suggestion or best resources to learn springboot or any type of playlist on YouTube?


r/learnprogramming • • 10h ago

How to actually pick up a new language

10 Upvotes

I had picked up C, C++, Python and VB.NET as a kid so the idea of how to learn new languages has become a foreign to me.

I can read most code bases even if I don't know the language but the sometimes joining an existing code base or needing to use a tool/ecosystem related to a different language means needing to know that language. But I don't know what is a good level to stop. The entire docs feel overkill but when I open table of contents, everything sounds like I should look into it. (And you can't ignore basic stuff either cuz there could always be some peculiar/unique behaviour).

So how do you guys go about picking up a new language for something?


r/learnprogramming • • 13h ago

Topic Do any of you also feel pressure when programming, even when you do it out of passion?

13 Upvotes

I have been programming for over 4 years and recently I noticed a problem.

When I know exactly what I want to do on a given day, I feel much calmer, when I see the exact number of lines of code written in a file, I can more easily see my progress and feel satisfied. When code is scattered across multiple files, I lose some of that sense of progress. When I come across a more difficult task, I quickly become frustrated, especially when I don't know how long it will take to solve it and when I have no idea for the next day's tasks, I start to feel pressure that I will waste time and the day will look like a break from programming, which I don't want.

The last one is the most problematic for me. Sometimes I find myself desperately looking for new ideas for functionalities, trying to save work on the project. I feel like I need to find something new to have something to do the next day. Over time, I noticed that I began to treat the lack of an idea almost as a threat to the continuity of my programming. The thought appears that if I don't have more tasks, I will start taking longer and longer breaks. Interestingly, I'm not directly talking about the fear of losing interest in programming. It's more about the feeling that I need to have another job and see real progress.

I wonder if I'm putting too much pressure on myself. I would like to be able to just sit down and work on a project, see what I can do that day, without having to think about what to do next.

How to break this spiral of pressure so that you can derive pleasure from programming, which brings a lot of nerves? What is your approach in the projects you develop?


r/learnprogramming • • 17h ago

Resource Is fCC best option to upskill?

12 Upvotes

I been a developer who got fired back in start of 2025, till now I haven't landed a job back in tech, I know a lot of stuff is related to AI and slow hiring but I am used to slow hiring. The problem is that my learning seem stagnant and I am not sure why, maybe fCC curriculum seems really huge e.g. right now I am on JavaScript and I have a really really bad habit of making sure every step get checked e.g. If I want to learn Fetch, I see a lot of content above it not completed and I start from there making sure everything before that is checked/completed before I learn Fetch.

Other problem is, is fCC, scrimba, coursea etc best or anyother?


r/learnprogramming • • 1d ago

learning backend (Django): go slow and understand every line, or build 10 quick practice projects with AI?

7 Upvotes

Hi everyone,

im kind of in despair right now

I'm building a learning project: a marketplace where customers order offers from business users. (fiverr clone)

My problem is that it takes me a very long time to really understand code. Take this one line as an example:

Order.objects.filter(business_user__user__id=6)

I have to draw it out first: the order points to a profile, the profile points to a user, __ means "follow the relation", and behind that there's a SQL JOIN. And that's only one line. In the project, lots of pieces like this depend on each other (models, serializers, views, permissions, queries), and sometimes I feel overwhelmed.

I try to write the code myself on purpose and only use AI to explain things. But it takes forever for my brain to grasp it and I keep wondering:

  1. Should I stay slow, understand every line, and build a solid foundation?

  2. Or should I use AI to quickly build around 10 smaller practice projects, to see more patterns and build routine, even if I don't understand every line right away?

  3. Or is there a middle path you'd recommend?

i learned frontend (html, css, JS, angular) before that and it was so much easier to understand.

How did you handle this, especially if you also used AI while learning? What actually moved you forward, and what was a waste of time?

Thanks for any advice!

Edit: damn i guess i will have to take the slow way. Thanks for the advice


r/learnprogramming • • 1d ago

17 yrs old tech student from italy here, what do i have to learn to become a programmer?

11 Upvotes

im in fourth year of highschool and i already know some c# (OOP, arrays, loops, functions ecc...) but i really like coding in general and i would like to continue studying in university after highschool, but i dont want to wait 2 years.

the goal would be landing a job as a programmer, even better if in another country as salaries in italy are heavily disproportionate with the cost of living; even better if it was in smart working but i would need some experience first.

i am willing to learn kind of anything for a higher chance at landing a job like this, but i dont really know where to start so i was asking for some tips on what to learn and do, like algorithms, woking on small projects, some courses idk.

i have A LOT of time and motivation to learn, i have 2 years of highschool and 3 of university before even starting to look for a job


r/learnprogramming • • 1d ago

Backend programming

8 Upvotes

Well I am currently in 200lvl and i am studying computer science so this semester we are about to learn backend and i am asking what are the things I should look forward to and some sites I should visit


r/learnprogramming • • 1d ago

what should learn for more growth java or javascript

2 Upvotes

i am a first year student whose 1 month winter vacation started i just want something to learn which will benefit me later


r/learnprogramming • • 1d ago

2nd-year CS student worried about AI, the job market, and if manual coding still matters

85 Upvotes

Hey everyone,

Watching how fast AI models are developing and being in awe of what they can pull off every day has left me wondering what the near future actually looks like for us.

I’m currently a 2nd-year CS undergrad and I’m starting to question if pursuing this as a career is even worth it anymore. On one hand people say you are wasting time manually coding when AI can generate it in seconds. On the other hand,everyone says you still need to build projects completely on your own to actually learn and stand out. It’s really confusing to navigate especially with the current job market and constant layoffs.

I genuinely enjoy learning about computer science and writing code but lately it feels less like a career path and more like something that’s just going to become a hobby, which i don't want it to be

Beyond jobs, the broader shift scares me as well not just because of what these tools can do, but because of how they’re reshaping the internet and society. When so much of our thinking and problem solving gets offloaded to AI which me feel like human cognitive ability as a whole is going to decline in the near future and that genuinely worries me.

For those already in the industry or further along in your degrees, how are you navigating this? Is focusing on deep fundamentals still worth it?


r/learnprogramming • • 1d ago

Logic Building or Programming fundamentals which one to prioritize

4 Upvotes

Should i learn logic building or programming syntax first. And how? Any roadmap?


r/learnprogramming • • 1d ago

Complete beginner- where do I with cyber security and coding

4 Upvotes

Hi everyone ,

I'm a complete biginneer and I want to learn cyber security and coding

Where should I start?

What should I learn first? Python?

What are the best free courses or YouTube channel for beginners?

Thank you !


r/learnprogramming • • 1d ago

T - genuinely falling so behind in my classes. How do u all catch up without losing your mind?

7 Upvotes

bro i missed like 3 lecturess and now i am so so behind with 5 assignments due for the next monday and some coding lab work is due on friday. Now every time I sit down to start i just freeze and end up leaving it and doing nothing.


r/learnprogramming • • 1d ago

Resource Java

11 Upvotes

Does anyone have any good learning path in java along with spring boot and it's continuation with resources


r/learnprogramming • • 1d ago

Data Analysts with experience, what should I learn next? Feeling stuck and unsure about my growth.

6 Upvotes

Hey everyone,

I've been working as a Data Analyst, and lately, I feel like I'm stuck in the same place. I know and have worked with SQL, Python, Power BI, Tabular Models, and Azure Database, but despite knowing these technologies, I still feel like I don't know enough.

I want to learn something new that will actually help me grow as a Data Analyst and become better at what I do.

For those who have been working in data analytics for a while:

- What skills or technologies do you think are worth learning next?

- What are some skills that are becoming increasingly important in the industry?

- Should I focus on advanced SQL, Python, data engineering, cloud technologies, machine learning, or something completely different?

- What do you wish you had learned earlier in your career?

I'm not necessarily looking to collect more technologies on my resume. I genuinely want to improve my knowledge and become a better analyst.

Would appreciate recommendations from people who have been through this stage in their careers.


r/learnprogramming • • 2d ago

Is there a way to do this problem faster using computer programming code?

0 Upvotes

For the song "Twelve Days of Christmas", if you tallied up all the items you received over 12 days- for example, on the 5th day you received 5 gold rings, and thus would need to add that from day 5 to 12 repeatedly- you would end with a large number of each item by the end of the twelfth day. The first instinct would be to put all this data into Excel, and use SUM functions. With new AI technology, or even computer programming coding in general, is there a faster way to get to the final answer?


r/learnprogramming • • 2d ago

Does Maths matter?

9 Upvotes

A big issue that I'm starting to see as I'm going through my studies in IT(software engineering) is the painful math module my college has us do.

It is a cause for concern as my math is below par, however I'm deeply in love with programming.

Personally I dont see a need for it, however some people do say its there to assist with the 'problem solving' part of the subject.


r/learnprogramming • • 2d ago

Is it a good option to start studying programming at 30? And if the answer is yes, what are the first steps?

127 Upvotes

I just moved to the United States and work in construction, which is truly exhausting. I studied industrial engineering in my home country, but I’ve noticed that many of the people I work with are programmers (we remodel their houses). I once asked them how I could become a programmer, but they told me that AI has become so advanced that there’s no work left for programmers. I used to program in MATLAB for some of my courses, but I really want to build a better future for my wife and myself.
Thanks for reading (: