/r/learnprogramming
A subreddit for all questions related to programming in any language.
If you need help debugging, you must include:
See debugging question guidelines for more info.
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.
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.
When posting some resource or tutorial you've made, you must follow our self-promotion policies.
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.
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.
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.
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.
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.
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.
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".
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.
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.
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
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
/r/learnprogramming
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.
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!
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!
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).
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.
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!
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.
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!
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?
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
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?))
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.
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?
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/")
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
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.
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
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:
Would love to hear your thoughts! 🚀
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.
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.
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.
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.
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 ?
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.
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:
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!
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
I am in my 2nd sem of college , as my 11th , 12th has java so , i just go with this but after that struggling to solve question , Frustated after some time while for not solving problem like multiplication of matrix , if i solve by watching video then after some time i forgot what the concept of the question, struggling to build logic .
I just completed a two year web dev program at a trade school. Did okay. Completed in December. Don’t wanna go into work so I enrolled in a software dev program. Will I survive? I start in 3 months and just got the motivation to start prepping for this learning curve. Any tips? I start this spring.
When I get comfortable enough to move to another language to become a REAL game developer instead of a filthy Roblox developer they call it. Which would be good to learn? Im thinking GDScript if I go to Godot, or C# if I go to Unity. Or none if I go to Unreal
So I'm currently learning Python and doing Hack the Box Academy. I have an IT degree but the job market is shit so I'm having trouble finding a job. I think my first actual job will probably be at Synack but I also may hopefully get a job at an MSP.
My first guess, is that I would aim to know Python, JS, C, C++, PHP, BASH, PS, in addition to SQL, NoSQL, and maybe another DB language. And
If I go into Synack, then Python will be a useful first language because its the best language to start with if you wanna be a pentester. Its also considered the most commonly used language in IT, which means after I graduate from any MSP I'll be able to put it as an additional thing on my resume. I know that much.
But the question is, how many languages should I learn overall for IT or for cybersecurity?
So my question is, how many languages should I know for my career? I have a CCNA and A+ certification. I'm a Kubuntu Linux user. I'm working on my CPTS from Hack the Box Academy. I'm learning Python because I know its a good language for hacking and pentesting. I also know as a backup career, its good for network engineering.
Now, the sources I read tend to say 3 to 5 languages. Does that sound accurate? When I look on Hack the Box's official blog, C and C++ are not listed as languages that penetration testers need to know but I know for cybersecurity and hacking, those are good languages to know according to other blogs and my cybersecurity teacher when I talked to him about this back at uni (I'm a recent university graduate).