/r/learnprogramming

Photograph via snooOG

A subreddit for all questions related to programming in any language.

Welcome to LearnProgramming!


New? READ ME FIRST!

Posting guidelines

Frequently asked questions

Subreddit rules

Message the moderators


Asking debugging questions

If you need help debugging, you must include:

  1. A concise but descriptive title.
  2. A good description of the problem.
  3. A minimal, easily runnable, and well-formatted program that illustrates your problem.
  4. The output you expected, and what you got instead. If you got an error, include the full error message.

See debugging question guidelines for more info.

Asking conceptual questions

Many conceptual questions have already been asked and answered. Read our FAQ and search old posts before asking your question. If your question is similar to one in the FAQ, explain how it's different.

See conceptual questions guidelines for more info.

Other guidelines and links

  1. Frequently asked questions
  2. Asking homework questions
  3. Asking for code review
  4. Answering questions
  5. Learning resources
  6. Other communities

Subreddit rules

1. No unprofessional/derogatory speech

  • Follow reddiquette: behave professionally and civilly at all times. Communicate to others the same way you would at your workplace. Disagreement and technical critiques are ok, but personal attacks are not.

Abusive, racist, or derogatory comments are absolutely not tolerated.

See our policies on acceptable speech and conduct for more details.

2. No spam or tasteless self-promotion

In short, your posting history should not be predominantly self-promotional and your resource should be high-quality and complete. Your post should not "feel spammy".

Distinguishing between tasteless and tasteful self-promotion is inherently subjective. When in doubt, message the mods and ask them to review your post.

Self promotion from first time posters without prior participation in the subreddit is explicitly forbidden.

3. No off-topic posts

  • Do not post questions that are completely unrelated to programming, software engineering, and related fields. Tech support and hardware recommendation questions count as "completely unrelated".

Questions that straddle the line between learning programming and learning other tech topics are ok: we don't expect beginners to know how exactly to categorize their question.

See our policies on allowed topics for more details.

4. Do not ask exact duplicates of FAQ questions

  • Do not post questions that are an exact duplicate of something already answered in the FAQ.

If your question is similar to an existing FAQ question, you MUST cite which part of the FAQ you looked at and what exactly you want clarification on.

5. Do not delete posts

  • Do not delete your post! Your problem may be solved, but others who have similar problems in the future could benefit from the solution/discussion in the thread.

Use the "solved" flair instead.

6. No app/website review requests or showcases

  • Do not request reviews for, promote, or showcase some app or website you've written. This is a subreddit for learning programming, not a "critique my project" or "advertise my project" subreddit.

Asking for code reviews is ok as long as you follow the relevant policies. In short, link to only your code and be specific about what you want feedback on. Do not include a link to a final product or to a demo in your post.

7. No rewards

  • You may not ask for or offer payment of any kind (monetary or otherwise) when giving or receiving help.

In particular, it is not appropriate to offer a reward, bounty, or bribe to try and expedite answers to your question, nor is it appropriate to offer to pay somebody to do your work or homework for you.

8. No indirect links

  • All links must link directly to the destination page. Do not use URL shorteners, referral links or click-trackers. Do not link to some intermediary page that contains mostly only a link to the actual page and no additional value.

For example, linking to some tweet or some half-hearted blog post which links to the page is not ok; but linking to a tweet with interesting replies or to a blog post that does some extra analysis is.

Udemy coupon links are ok: the discount adds "additional value".

9. Do not promote illegal or unethical practices

  • Do not ask for help doing anything illegal or unethical. Do not suggest or help somebody do something illegal or unethical.

This includes piracy: asking for or posting links to pirated material is strictly forbidden and can result in an instant and permanent ban.

Trying to circumvent the terms of services of a website also counts as unethical behavior.

10. No complete solutions

  • Do not ask for or post a complete solution to a problem.

When working on a problem, try solving it on your own first and ask for help on specific parts you're stuck with.

If you're helping someone, focus on helping OP make forward progress: link to docs, unblock misconceptions, give examples, teach general techniques, ask leading questions, give hints, but no direct solutions.

See our guidelines on offering help for more details.

11. Don't ask to ask.

  • Ask your questions right here in the open subreddit. Show what you have tried and tell us exactly where you got stuck.

We want to keep all discussion inside the open subreddit so that more people can chime in and help as well as benefit from the help given.

We also do not encourage help via DM for the same reasons - that more people can benefit

12. Low Effort Questions

  • Do not ask easily googleable questions or questions that are covered in the documentation.

This subreddit is not a proxy for documentation or google.

We do require effort and demonstration of effort.

This includes "how do I?" questions

13. No AI (chatGPT etc.) generated messages/comments. No questions about chatGPT/AI generated code.

  • Such posts/comments will be removed without warning and the poster of ai generated content will be instantly banned.

/r/learnprogramming

4,171,440 Subscribers

0

Looking for Mentorship & Career Advice in Cybersecurity/Blockchain – Self-Taught & Seeking Guidance

Hey everyone,

I’m reaching out because I’m trying to build a career in cybersecurity, AI, or blockchain technology, but I’m struggling to find the right path. I believe in the power of mentorship and wanted to ask for guidance from those who have experience in these fields.

A Bit About Me: I come from a strict, traditional background where access to opportunities was limited. The internet changed my life by exposing me to new perspectives and knowledge. I taught myself English and became interested in technology, but I don’t have a structured learning path. I’ve worked in physical labor jobs before, but I want to transition into a career where I can use my mind, learn, and grow in the tech industry.

What I’m Looking For:

I know having the right guidance can make a huge difference, so I’d love to connect with: Someone who transitioned into tech from a non-technical background. A mentor or experienced professional who can suggest the best learning resources and practical steps. Anyone who can help me understand how to break into cybersecurity, AI, or blockchain as a self-learner.

My Main Questions: 1.Where should I start learning cybersecurity or blockchain development from scratch? 2.What are the best free or affordable courses and resources for these fields? 3.How can I gain real-world experience if I don’t have a degree or prior work experience in tech? 4.Are there entry-level remote jobs or freelance opportunities that can help me build a portfolio?

If you’ve been in a similar situation, or if you have any guidance, even small advice would mean a lot to me.

I truly appreciate your time in reading this, and I’d love to hear from anyone willing to help.

Thank you and much love.

0 Comments
2025/01/31
18:13 UTC

1

Need help with choosing a techonology

So im a junior programmer with 1 year experience developing in .net(Windows forms) and c#(rest api), i want to start developing in my free time but i dont know What to program in, ive been looking into MAUI,flutter or ruby. Are any of these good options or should i opt other things?

2 Comments
2025/01/31
18:04 UTC

4

The path to adulthood IT

I am a novice programmer and in the future I want to fully immerse myself in the IT field. Right now, I'm mainly learning Windows Forms and WPF. I have a small development stack, I mainly work with relational databases in programs (Microsoft SQL Server, postgresql). I want to go deeper into Windows software development. I also started learning Kotlin (jetpack compose) for mobile app development. I would really like to hear the advice of experienced programmers on what is the best thing for me to learn (can you recommend free learning resources) for further development and employment.

3 Comments
2025/01/31
17:28 UTC

1

İmportant Topics and Concepts

Hello everyone. I am new here and at software. I learnt basic C, am continuing to learn C++ and Rust. I know that computer&software have many fields. Therefore, whatever field or fields I select, Which basic topics and concepts should a computer&software engineer candidate know? The topics that I want to be expert are desktop, ai and os development in order from easy to difficult. I read carefully the FAQ but I couldn't find anything about these 3 fields. Thanks.

2 Comments
2025/01/31
17:25 UTC

1

Finding a codebase ”in the wild” java

I need to find a codebase ”in the wild” in Java with something like 20-50 classes that I can analyze.

Anyone know or have one on github that they could recomend? It does not matter the quality of the code just the size.

4 Comments
2025/01/31
16:38 UTC

1

First Party Microservice Authentication/Authorization

Hi all, I’m currently working on designing authn/authz for a new micro-services based platform.

My background is in cloud/infrastructure so some of the concepts in this area are new to me but I do have experience in adjacent areas.

In short, I’m trying to understand if oauth/oidc is overkill for us, given that we’re a creating a system composed entirely of 1st party applications. If it is overkill, I’d like to understand what the alternatives are.

The requirements for this platform are quite straightforward - we’d like to leverage Microsoft Entra as an IDP to relieve ourselves of some of the implementation details of managing users (i.e., passwords). We also need to be able to implement fine-grained access control. 

I believe that oauth 2.0 was mainly designed for the use case of a 3rd party client connecting to a resource server and therefore requiring consent of the resource owner. Because of this, all clients and all resource servers have to be registered with the authorization server and have their scopes published. Moreover, on each client, one needs to establish the consents needed from the user using the published scopes of the resource server. Also, in Entra, you need to assign users to all apps involved (and optionally some roles if you want RBAC).

The above seems cumbersome/pointless for a few reasons. For one, we may have several resource servers in the future - managing this ever-growing list of consents and scopes will be difficult. Two, the client is a first party application that is already trusted so the consent process seems a bit redundant. Moreover, this client will be serving as a front-end for the entire platform, so it’s likely all scopes will be just full-access anyway. Of note, the client in this case will be a SPA.

It also appears that oauth doesn’t help us achieve fine grained access control. While it’s true that you can assign roles to users in the authorization server, and those claims are accessible in the access tokens, RBAC does not achieve fine-grained access controls itself. We will require another authorization solution like OpenFGA that supports ReBAC to achieve more sophisticated authz capabilities.

For these reasons, I am starting to doubt the need for oauth/oidc, but this is where my knowledge falls short. What other industry accepted practices are there in terms of authn/authz for first party micro services? Is there a simpler way to allow Entra to simply be an IDP, have my users login to it, but then make all authorization decisions via a ReBac tool, thus removing the need to register/manage all applications/scopes/grants in oauth? If so, how exactly does this work from a user flow perspective (user-agent, client, micro service N)?

Thanks!

1 Comment
2025/01/31
16:17 UTC

2

Esoteric programming.

I have become very interested in esoteric programming languages recently and I am really interested in building my own, the problem is I don't exactly know where to start, I want to make this language using C++ because I think it will look good on my resume and I want to improve my skills in c++. I have been programming for about 6-8 months now, and the most complicated thing I've built is a TCP chat application in java I feel like I've hit a wall, so I want to really up the challenge, but I'm just not even sure where to start, any advice would be appreciated thanks!

5 Comments
2025/01/31
15:58 UTC

0

Is there any point in learning to program in 2025?

Does it make sense to learn to program in 2025? I am a chemical technology student who went into this field because I was interested in chemistry in high school, although I was discouraged by the fact that wages in the chemical industry are not high (a few years ago I even had a small laboratory at home, now there is nothing that interests me). I was thinking about trying to get into IT because of the greater opportunities and potentially better money despite the supposedly ongoing crisis, although I don't know if it makes sense to try (or continue to struggle with chemical engineering).

17 Comments
2025/01/31
14:52 UTC

7

Best free Java material

I’m looking for something similar to Harvard’s CS50 (catered to c) but for Java. Obviously it’s going to be difficult to match Harvard’s quality but as close as it gets. I just need something that’s more like a uni course rather than a coding bootcamp.

3 Comments
2025/01/31
14:45 UTC

1

Text-based planned economy game

Hi! I’m attempting to make a video game on running a planned economy. Somewhat like Victoria 2 but completely text based. I hate graphics. I want to clarify that my “vision” is not a text adventure but more of a simulator. I have dabbled In Python but I am willing to learn any language. I understand this will take years to finish so I’m not going to immediately develop the game. I ultimately need practice and experience first. In the future of final development I also would like to add procedurally generated flavor text. I just need advice on what language I should learn or any software to get into. To give you an idea the whole thing will be mechanics-heavy with spreadsheets. Any advice is welcome!

8 Comments
2025/01/31
14:38 UTC

0

Cant find Python course website

Months ago I encounter link for Python course website here in comments - website was black with questions and code window where you put your code sniped as answer.

1 Comment
2025/01/31
14:23 UTC

4

Competitive Programming or Backend Development – What Should I Focus on in My 4th Semester?

Hey, I am a BTech sophomore (4th semester just started). I have solved 300+ LeetCode problems and am interested in both competitive programming and backend development with Spring Boot. I want to do an internship in the summer after my 3rd year.

Should I focus on competitive programming or development in my 4th semester? I am confused. Please help me decide!

1 Comment
2025/01/31
14:10 UTC

1

Codeintuition.io any reviews?

Hello, I am graduating in CS later this year and wanted to brush and maybe expand my knowledge in DSA. I found this website where premium costs 57 £, however course is structured (that is what I am looking for) with plenty of exercises and etc? Anyone has completed this course? How is it, how's the quality of it?

0 Comments
2025/01/31
13:48 UTC

1

Pseudocodes

Hi, I'm a beginner and I just need a little enlightenment because I'm incredibly lost.

In the pseudocode below, the number of dresses sold changes daily, so it is treated as an input, while the dress profit remains the same and acts as a constant. But since we're still the one that inputted it and it's part of the program, we're still supposed to put an INPUT in front of it right? Just like the dresses sold?

START

INPUT dressesSold

INPUT dressProfit = 5

totalProfit = dressesSold * dressProfit

END

4 Comments
2025/01/31
12:26 UTC

4

There are many good resources for design patterns, but what about patterns that are on a slightly higher level? Is there, for example, a good book on different ways to implement a DAL?

A DAL can be implemented with ORM, Service Layer, Data Access Object, Active Record, and I'm sure that there is more. But I have only seen resources that talk about one of them at the time.
Do you know a book that list them all and compares them? That discusses the pros and cons?
Not just DAL but also interested in other categories of these "Design patterns" (for lack of a better word (Architectural? Enterprise Patterns?))

0 Comments
2025/01/31
12:20 UTC

0

I never truly have been able to define "Frontend" for myself. Can someone help me?

Is the frontend only the files that you get send to your web client (browser for example)?
Because, if not, than a frontend in itselfs also has a backend, right? It is served from a backend, whether we are talking about a backend that uses a templating engine or let's say a React app that is a client to some REST API (the React app needs to be installed on some server, and it "serves" the html+ccs+js files).

Especially with the latter one (front-backend separation) I find it a bit confusing, because they could be installed on a server along side each other, or separately, and the notion of "frontend" is somewhat vague there.

Maybe I'm completely missing something. I would appreciate it if someone could clarify my doubts here.

10 Comments
2025/01/31
12:14 UTC

1

Problem with solving algorithmic tasks

Hi everyone! I'm learning Java and plan to learn Spring and other technologies to become a backend java developer.

As I mentioned, I have problems with algorithms, like sorting arrays, building own data structures and so on. I can understand what's going watching on the code, but when it comes to writing code, brain shuts down, and even simple algorithms become hard to implement.

What to do to ease the process of learning algorithms? And is it absolutely necessary to become a junior developer?

3 Comments
2025/01/31
11:55 UTC

1

How to setup oauth2 redirect uri's with google and github

Hi, does anyone know how to properly setup a redirect uri for oauth2 with google and github?

When i try to login with both, i get to the screen where they (google and github) ask for username and password. then both of them error out, github with a 404 not found page, google with a 400 redirect_uri_missmatch.

I want to be able to redirect to the main page of my website (aka. "localhost:8080/")

2 Comments
2025/01/31
11:18 UTC

2

How do I teach someone?

I’m teaching a complete beginner how to program and I’m going to implement a project based approach from the very start.

What’s a fun lil project idea that I can guide them through with Python? Something worth adding to their GitHub ideally

10 Comments
2025/01/31
11:16 UTC

1

Help with Basic ? arguments

Hi i got this exercise but im not sure how to read it.

For each row both variables are int and i = 1 and j = 2. It is not mentioned which language it is.

The Quiestion is for each row, which value i and j are.

  1. i = (j ==2)? 1:3; -> j equals 2 so i is set to 1, therefore i=1 and j=2
  2. i = (2)? 1:3; -> Problem 2 is not a boolean so it's an ERROR or 2 is true since it has a value?
  3. i = (0)? 1:3; -> Problem 2 is not a boolean so it's an ERROR or 0 is false ?
  4. i = ( j =1)? 5:7; -> Also should be an Error imo.
4 Comments
2025/01/31
11:11 UTC

1

Tips for Meta Internship Final interview

Hi! I have the final 45 min interview for the Internship at Meta in 1 week. Any tips on how to succesfully pass it? Thanks

0 Comments
2025/01/31
10:37 UTC

2

Should My Friend Learn Python or JavaScript for GHL Custom Automations? Need Recommendations

A friend of mine wants to learn programming, but he has no prior coding experience. His background is in business administration, and he has been working in digital marketing for the past few years. The reason he wants to learn programming is to leverage GHL (GoHighLevel) custom automation flows using REST APIs, since the CRM has limitations in its native automation capabilities.

He asked me to guide him, and while I personally work with JavaScript/TypeScript, I’m considering recommending Python instead. My reasoning is that he won’t be using it for web development, and Python might have a gentler learning curve for someone new to programming.

I’d love to get some opinions:

  1. Is Python the better choice for him, given his goal of working with APIs and automation? Or should he go with JavaScript?
  2. What are the best beginner-friendly courses/tutorials for him? Since this will be a side hobby for him, I’m looking for resources that are engaging and beginner-friendly.
  • FreeCodeCamp
  • Programming with Mosh
  • Code with Harry
  • Any other Udemy/YT instructors you’d recommend?

Would love to hear your thoughts! 🚀

0 Comments
2025/01/31
10:25 UTC

1

Help with Maximum Subarray Sum variant

I am currently trying to learn DP. So from my limited knowledge I decided to learn how to do different problems in the order of trying to solve it using basic recursion, then memoization and then the same thing again using tabular DP. I know it might look redundant but I was hoping to get a solid understanding by doing so. I have been stuck trying to solve the following problem using memoization:

You are given an array arr of size sizeOfArr. You need to find the maximum sum in the array provided that you cannot sum neighboring elements or adjacent elements.
Example:
Input: {6, 4, 7, 8, 4, 7, 1, 7, 3, 6}
Output: 34

I am able to do it in other/simpler methods but I was hoping that there was a memoization based solution to this problem. The approaches that I have tried based upon memoization are able to solve the broblem but each version fails at a specific type of test case for example the one that works for positive input fails at an all negative integers input. And another which works for such an input gives wrong output for a mixed set of numbers.
Any help is appreciated.
Thank you.

1 Comment
2025/01/31
09:23 UTC

8

Software that shows a live 3d model that responds to real time-changing data

I am wanting to build a 3d model of a drone hub (houses 100 drones) that will take in sensor data to show whether the drone is there or not. I am not sure where to start. It is just a pet project I can put on my resume for internships. Please any advice or ideas on where to look would be very helpful.

2 Comments
2025/01/31
08:13 UTC

2

Help me with my first code please

I did practice on freeCodeCamp website And when I checked my code on validator.w3.org. it showed many errors in code about Img elements.

https://github.com/YonaVin/Build-a-Tribute-Page

11 Comments
2025/01/31
06:57 UTC

4

Can I switch my career from SQL developer to Software Developer ?

Hello All!

I have 2 years of experience in SQL development in IT support and want to switch to Software Developer role, preferrably in Java backend developer , is it possible given the job market ?

Will my skill count as an experience if I apply for Software Developer role ?

Edit 1 : In my role, we get tickets raised regarding data issue so we find the root cause in stored procedure level else if code issue so hand it to software developers then do data correction.

Edit 2 : I have a CS degree and know the basics of DSA and Core subjects. I know basic java. However, due to series of bad decisions ended up in this role.

25 Comments
2025/01/31
06:45 UTC

1

What should I do right now ?

I completed half of cs50 during my 1st semester (basically the C part) and submitted my week 5 assignment 4 months ago . It was very helpful as my college was teaching C as well . In the second semester , my college's using C++ and I have decided to learn C++ through my lectures only ( partly because there's no cs50 like course for C++) . Do you guys know a website where I can practice C++ questions (preferably topic-wise )? More importantly , should I go back and finish cs50 or take up something else like doing a MOOC course on Java or Web Development ?

6 Comments
2025/01/31
06:37 UTC

1

Logic Building

Hi! I am a CSE graduation student and I am really struggling to write code by myself, I don't have any issues with the syntax of the languages (ex - JAVA). I find the main problem in building logics for the coding questions. When I see the solution, all I do is wonder that if the solution was so easy how come I couldn't make an approach for it. Like when can I say with a little bit confidence that I can build some logic on my own. Is there a certain number of questions that a person should solve by watching solutions to build some logic? If someone was in this situation and got out successfully please help out.

1 Comment
2025/01/31
06:11 UTC

5

Struggling to Choose: Web Dev, System Software, AI/ML, or Cloud?**

So, I am an FYBCA student working at an SBC manufacturing company. They do a lot of low-level programming, embedded programming, system software development, and also handle websites and mobile applications.

Right now, I'm confused about which field to choose. My options are:

  1. Web Development – Easy to get a job/internship.
  2. System Software Development – Time-consuming to learn and hard to get a job in a short period.
  3. AI/ML – 😭 I saw experts on YouTube saying not to go for AI/ML because it's very tough, highly competitive, and could ruin your life.
  4. Cloud Computing – The one I like the most.

PS: I currently know C and Python. Should I continue with Python or start web development?

Q: Will switching from web development to cloud computing later affect my career?

I'm very confused 🥲. Thanks in advance!

4 Comments
2025/01/31
06:03 UTC

1

Looking for .net workflow engine recommendations

Hey guys, i've used Elsa 3 but thats just not a reliable framework because they don't seem to get the concept of minor versions, backwards compatibility etc. can't run production systems

0 Comments
2025/01/31
06:03 UTC

Back To Top