/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,590 Subscribers

0

Why do some believe that using "Asynchronous I/O + Direct I/O" instead of "Zero-Copy" is better for efficiently transmitting small files?

Why do some believe that using "Asynchronous I/O + Direct I/O" instead of "Zero-Copy" is better for efficiently transmitting small files?

1 Comment
2025/02/01
13:13 UTC

1

I have always been interested in ethical hacking—how it works, programming languages, etc. But I have never pursued it, and I am in a completely different profession. Is it possible to learn it on my own without any prior experience, or do I need a university degree?

I don’t have to pursue it professionally, but as a hobby, it seems interesting to me. Is it even possible to learn it if you have no prior knowledge and literally have to start from scratch? If so, where do you begin?

Some might find this question silly, especially those in the profession, but since I’m curious I have nothing to lose.

1 Comment
2025/02/01
13:04 UTC

0

Want honest review for genie ashwani youtuber java full stack developer course

Please give honest course review

4 Comments
2025/02/01
12:53 UTC

0

Can anyone get me free dsa sources

Need dsa sources to learn in c++

5 Comments
2025/02/01
11:46 UTC

1

Need help in increasing my level in python!!

Hi,

I am good at the basics in python and also writing code on my own for my projects (with little help tho) but the problem is i usually go by brute force method for logics, they work but not really efficient (and also I tend to make my logics a bit complicated, I understood this by seeing other people codes being a lot simpler for same problems), . I need help in improving my coding skills and improve my thinking in implementing logics.

Any good resources or practice tools or a plan for where to start and how to go would really be helpful.

Thanks!!

2 Comments
2025/02/01
11:46 UTC

4

Looking for a C cheat sheet

I've got my final exam in programming basics coming up soon, it's open book given that you don't use AI and all of your recourses are local and don't require the internet to be accessed.

I'm just looking if anyone here has or knows a C cheat sheet that covers stuff like output format and storage class specifiers, reading/writing files, most useful functions and how to use them from the most common libraries, ect. before I go on to make my own

3 Comments
2025/02/01
11:32 UTC

1

How do I improve my problem solving skills as a average programmer?

[Excuse my bad english]

Hello!

I'm currently a programmer who knows how to use C#, Java, JS, C, C++,Lua.

Not exactly a master at them tho.

Anyways, my goal is to improve solving skills as I'm pretty poor at it, and I've tried brilliant but alot of the courses require money, and I need a free interent source.

3 Comments
2025/02/01
10:25 UTC

0

I need help on why my image is not rotating 180 degree on being hover

This is my code

```

<div class="relative h-\[29vh\] w-\[29vh\] rounded-full p-\[6px\] bg-gradient-to-r from-\[#8118c4\] via-\[#030125\] to-\[#3bbbd5\] perspective-\[1000px\]"><div class="h-full w-full rounded-full p-\[2px\] bg-white"><img src="My-image.jpg" class="h-full w-full rounded-full object-cover transition-transform duration-500 transform hover:rotate-y-180"></div></div>

```

2 Comments
2025/02/01
10:16 UTC

0

Using AI to find the reason for errors as a beginner

I need some insight. I am a beginner and if I get stuck on a problem in my projects even with countless searches, I paste the error code to LLMs and make it explain to me why it happens. I try to see what is the reason and go find the solution myself. If I still can't, I make it suggest solutions for me. Is that an okay approach? or will it hinder my learning process?

8 Comments
2025/02/01
10:02 UTC

2

Does Nextjs's SSR work with custom servers?

I'm quite new to nextjs and the concept of csr, ssr, ssg... From my understanding, when a nextjs application is created, it creates and uses its own server to handle server side rendering. I also understand that it is common to use nextjs completely for the frontend and backend of an application.

But how would you use, let's say, a custom Express.js as the backend? Would ssr still work with the express server that would essentially be replaced the out-of-the-box nextjs server? Or is it common for developers to deploy and use both the servers, allocationg the nextjs server to performing ssr but using the express server as your main api?

1 Comment
2025/02/01
09:55 UTC

1

Am I Using AI Wrong?

A.I.s can be helpful learning tools when used properly but at the same time they can also be detrimental for our learning progress especially when we rely on them too much. I have been using ChatGPT to help me understand lessons that seem too complex for me to grasp. I would ready through and try to understand the lessons. I would then ask ChatGPT to break down and simplify the lesson's contents and then give me some practice exercises to ensure I understand the concepts. I don't move on until I know for sure that I have a good grasp on the current lessons. Is this considered cheating and detrimental to my learning progress?

2 Comments
2025/02/01
09:52 UTC

1

CSS Selectors

Newb question. But struggling to understand when to use the different selector types. Probs just need more practice to get it memorised, but does anybody have any other tips, useful hints on how to get this simplified in my mind! (.), (#) etc etc

4 Comments
2025/02/01
09:38 UTC

1

How do I improve on my programming?

I am 15 years old and I would say that I am at an intermediate level with Python. I'm trying to become very good at it, while also becoming familiar with other languages. Which steps do you think I should take to improve, I have thought about taking Harvard's CS50 or their Python programming course.

5 Comments
2025/02/01
08:02 UTC

1

Advice on keeping C# BE or trying something else?

I have spent 7 years doing Angular FE, C# BE, SQL Database.

I am debating what BE process I should do and replace with if any. Currently I am starting a new project using React as the FE for website and application deployment. I have in the past enjoyed using ABP Framework for C# on BE.

My problems now I would like to improve:

-If I stuck with ABP, upgrading ABP is a pain or least on previous versions it has not been super exciting to deal with ever.

-Improve processes of adding Roles and Permissions in BE.

-Speed up the process of demoing new features if possible.

-I really liked using ngswag with Angular to automatically give me api proxy so that I did not have to write services manually in FE. This is a side topic but just a thought to consider depending on my BE route I take.

I am debating the following options:

-Continue using ABP Framework

-Choose a new other option

-Headless Drupal CRM (friend suggested it but do not want to use php)

-Headless JS/TS CRM (Strapi maybe)

-DNN or Evoq

My main goals would be to have:

-Authentication JWT

-Roles

-Permissions

-Public API

-Dev/Test/Prod instances for BE

-Ability to still be able to create custom functions like any normal case in C#, like maybe fetching a list of cars, then filtering the cars, pagination of cars, storing images of cars. Just random things I would write in the BE I thought of.

-LTS of course for BE choice

1 Comment
2025/02/01
07:39 UTC

1

Any better way to think about this design problem?

Say you have two request methods, they each use a request object {a, and b} that's almost identical to the other, only their composition differs by an object property that's a similar name but two different objects.

So a has properties, one of them being fProp custom The properties on b match exactly those of a, but instead of fProp custom, it contains xProp custom.

My idea was to just make the two classes, a, and b inherit from a base class that contains the similar properties, only a specializes in fProp custom, while b specializes in xProp custom.

Before I even call any request method, I use one method that builds up the request using data shared by both, so I build up the base calss. This method eventually designates which request method to call, I can call aRequest using the a object, or bRequest using the b object. When I specialize, I call a function that combines the base class' values I've built up, and either fProp or xProp to build either the aRequest or bRequest. Then, I send them along their respective request method.

For some reason, this feels clunky? I'm leaning towards class a and b just being two separate models that just happen to look almost the same. This way, my method just builds a payload of common information and finally builds the request object when we specialize.

thoughts?

2 Comments
2025/02/01
07:14 UTC

2

Give me a crash course in googling my problems that i face in programming?

I used llms all the time to help me. My teacher is against it due to hallucinations. He said that theres no coding problem that cant be solved by googling. I am only aware about the things to look out for is checking when the stackoverflow ans was posted n make sure its not too long ago

5 Comments
2025/02/01
06:12 UTC

1

Java web app in tomcats error

I have a Java JSP Servlet web app running on Tomcat. Why is it that when I restart the Tomcat server, everything starts working again? For example, I might be able to log in successfully right now, but after some time, I can no longer log in with the same credentials due to a "wrong credentials" error. However, when I restart the Tomcat server, I am able to log in again

1 Comment
2025/02/01
05:35 UTC

3

What have you been working on recently? [February 01, 2025]

What have you been working on recently? Feel free to share updates on projects you're working on, brag about any major milestones you've hit, grouse about a challenge you've ran into recently... Any sort of "progress report" is fair game!

A few requests:

  1. If possible, include a link to your source code when sharing a project update. That way, others can learn from your work!

  2. If you've shared something, try commenting on at least one other update -- ask a question, give feedback, compliment something cool... We encourage discussion!

  3. If you don't consider yourself to be a beginner, include about how many years of experience you have.

This thread will remained stickied over the weekend. Link to past threads here.

2 Comments
2025/02/01
05:00 UTC

2

I want to thank my teacher

I want to make an easy coding project for him as a thankyou but i want to make it a bit funny aswell. My comp sci teacher helped me sm throughout the course and also would talk to me about random stuff. He also helped me with physics problems. Please give me some ideas. Btw I am gr 11 and i was learning java with him but i could also create a website.

6 Comments
2025/02/01
04:55 UTC

2

transfering credits from open source computer science degree to apply for comp sci masters in a "real" university

Hi folks (I currently have a non-STEM degree), is it possible to take github computer science courses and transfer them or use them as a prerequisite to gain admission for a masters program in computer science or any other related discippline? Have any of you done this before? thanks

2 Comments
2025/02/01
04:45 UTC

1

Can I modify this icon to my liking?

I have this code that shows an icon in the browser: My doubt is if this icon can be modified to have it to my liking (its color, its size, if I want to put text inside)

If it is possible, is it by means of code or do I need an editing software like Photoshop?
I copied this code from the Internet, and I have never handled these tags before. I was looking for ways on how to insert icons to a web page.

<svg       viewBox="0 0 97 24"       xmlns="http://www.w3.org/2000/svg"       width="69"       role="presentation"       alt=""       data-testid="NintendoRacetrackLogoIcon"       size="69"       color="currentColor"     >        <path         d="M17.945 14.157l-4.85-7.838H9.609V17.59h3.486V9.752l4.85 7.838h3.456V6.32h-3.486l.03 7.837zm27.554-4.04V8.993H43.68v-1.52h-3.395v1.52h-1.849v1.124h1.85v7.473h3.394v-7.473h1.82zM23.341 17.56h3.364v-7.474h-3.364v7.474zm0-8.932h3.395V6.319H23.34v2.309zm59.17.942c-2.728 0-4.941 1.883-4.941 4.192s2.213 4.193 4.94 4.193c2.729 0 4.942-1.884 4.942-4.193 0-2.309-2.213-4.1re92-4.941-4.192zm1.364 5.772c0 1.185-.698 1.67-1.364 1.67-.667 0-1.395-.485-1.395-1.67v-3.16c0-1.184.697-1.67 1.395-1.67.666 0 1.364.486 1.364 1.67v3.16zm-10.73-4.891c-.547-.304-1.123-.608-1.91-.669-2.426-.212-4.305 1.945-4.305 3.92 0 2.612 2 3.554 2.304 3.706 1.152.516 2.607.547 3.88-.274v.426h3.334V6.32h-3.334c.03 0 .03 2.4.03 4.13zm.03 3.342v1.336c0 1.155-.789 1.458-1.334 1.458-.546 0-1.334-.303-1.334-1.458v-2.673c0-1.155.788-1.458 1.334-1.458.515 0 1.333.303 1.333 1.458v1.337zM34.616 9.752c-1.122.03-2.031.516-2.698 1.124v-.79h-3.365v7.474h3.365v-4.922c0-.638.697-1.367 1.607-1.367.909 0 1.546.73 1.546 1.367v4.922h3.364v-4.071c0-2.947-2.546-3.798-3.82-3.737zm27.433 0a4.075 4.075 0 0 0-2.698 1.124v-.79h-3.365v7.474h3.365v-4.922c0-.638.697-1.367 1.606-1.367.91 0 1.546.73 1.546 1.367v4.922h3.365v-4.071c0-2.947-2.546-3.798-3.82-3.737zm-7.063 4.101c0-2.309-2.243-4.253-4.971-4.253-2.759 0-4.972 1.884-4.972 4.193 0 2.308 2.213 4.192 4.972 4.192 2.273 0 4.213-1.306 4.789-3.068H51.44v.455c0 1.367-.91 1.671-1.394 1.671-.515 0-1.425-.304-1.425-1.67v-1.55l6.366.03zm-6.123-2.643a1.391 1.391 0 0 1 1.182-.668c.455 0 .91.213 1.182.668.212.365.212.82.212 1.458H48.62c0-.637.03-1.063.243-1.458zm39.921-3.493c0-.365-.272-.547-.818-.547h-.758v1.914h.455v-.79h.242l.364.79h.515l-.424-.851c.273-.091.424-.273.424-.516zm-.879.273h-.242v-.547h.212c.273 0 .424.091.424.274 0 .212-.12.273-.394.273zm.03-1.58c-.94 0-1.727.79-1.727 1.732s.788 1.732 1.728 1.732 1.727-.79 1.727-1.732a1.73 1.73 0 0 0-1.727-1.732zm0 3.13a1.413 1.413 0 0 1-1.394-1.398c0-.76.637-1.398 1.395-1.398.757 0 1.394.638 1.394 1.398 0 .76-.637 1.397-1.394 1.397zM84.148 0H12.64C5.062-.03 0 5.438 0 11.97c0 6.53 5.062 11.939 12.67 11.939h71.508c7.608 0 12.67-5.408 12.67-11.94C96.818 5.44 91.726 0 84.148 0zm-.03 20.993H12.671c-6.033.03-9.7-4.041-9.7-9.023 0-4.983 3.698-8.993 9.7-9.023h71.446c6.002 0 9.7 4.04 9.7 9.023 0 4.982-3.668 9.023-9.7 9.023z"         fill="currentColor"       ></path>     </svg> 
2 Comments
2025/02/01
04:45 UTC

5

Need some advice while studying computer science

Hey guys, so i am about to enroll computer science degree major in software development. I was wondering what are the things that i can or should do while studying my degree to better prepare myself and increase myself of landing a job after graduated? Any tips and advice are appreciated. Thank you in advance.

6 Comments
2025/02/01
03:34 UTC

1

It's 2025. What is the best platform today for building a database front-end? Web-based, like Angular, or form-based, like UWP, or something completely different?

My skillset needs updating, since I have been building .Net form-based apps for the last 15 years. What is accepted as the best platform for new front-ends today? Given how much effort is required for setting up a web server that is secure from attack, am I better off just moving towards a newer form-based front end platform?

3 Comments
2025/02/01
02:21 UTC

1

Looking for a Partner(s) to learn Python with the aim of creating a Portfolio

Hello!

A brief introduction. I go by Wulfen, currently in my last year of pursuing a bachelor's in Computer Science. Through my previous years at an online university I have learned that a degree is just not enough to get hired. You need some practical work to show potential employers what you are capable of, and I am looking to really get into the mindset of making a good portfolio for future employers.

I want to learn Python - and I consider myself intermediate at best, and I want to find a partner (or some partners) to learn together and build skills with. We will start with Python from the ground up if needed, and do some coding exercises together from websites like hackerrank, or codewars. We will exchange best practices, logic strategies, and support each other where one may be stuck.

As for the requirements, all I ask is that you see yourself learning at least for the immediate future (half a year or a year from now), have the dedication and willing to put the effort and at least an hour or a couple of hours a day. Timezone, age, and other things like that are really not important.

I have created a discord channel which is valid for the next 7 days - https://discord.gg/7RaPVRtD

Ideally we would be around 2-10 people.

Please feel free to join and we can start organizing after the link expires!

I am excited to learn together!

0 Comments
2025/02/01
01:15 UTC

0

Does this video cover most of the grounds for PyTorch and learning the basics / next steps of AI?

https://www.youtube.com/watch?v=V_xro1bcAuA&t=66936s

I'm great with maths and have been a programmer for years, my next step is to learn AI.

Else can anyone recommend me a video going into AI, Deep learning, Machine learning (I learn best with videos) and such?

Thanks!

1 Comment
2025/02/01
00:29 UTC

1

Want to give shout out to Scrimba.com for their react course

I’m really surprised how it is not heard at all. I’ve been doing their react course and it’s really good. If you are starting react do check out scrimba.com

0 Comments
2025/01/31
23:52 UTC

3

Assistance with connecting to MongoDB

Would greatly appreciate any help connecting to a database right now, I've read the docs and cannot figure out what is wrong. Attempted Stack Overflow and it wasn't terribly helpful.

Here's some of my code. I'm attempting to connect to MongoDB. I have data in there and it's ready to be accessed.

mongoose   .connect(process.env.MONGODB_URI)   .then(() => {     console.log("connected to db");   })   .catch((err) => {     console.log(err.message);   });   

MONGODB_URI=mongodb+srv://<MYNAME>:<MYPASSWORD>@cluster0.8dmao.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0

If something has been wrong, it's thrown up the err.message, but otherwise it doesn't console.log anything, and then doesn't connect. What am I doing wrong? Can provide more code if needed. And any help is always appreciated.

7 Comments
2025/01/31
22:38 UTC

19

Is it just me in the boat? Hear me out:

I am a full-stack developer with 6 years of experience- and very proactive and passionate about it "At WORK" enjoy solving issues- making things work and vibe in my seat to my R&D periods. And I was lucky enough to switch work 3 times, one of them as 6 months mission contract- so very things are stable.

Now the question is- an abundant number of recruiters would require proof of concept on git profiles and portfolios which is understandable- However, I'm in a position where I'm at a disadvantage- I have the competency at work- but to prove it to recruiters requires me to provide hours outside of work dedicated in that as an "Investment"- but the time I allocated or the lack of thereof is not enough- and I'm aware of that.

I'm just wondering is just me in the Dilemma- where I enjoy the profession but not enough to make git contribution nor create or have ideas about "useful" projects. I do some R&D there for sure- but often recruiters focus on fully running the end products.

I work my hours with love- I enjoy it, then enjoy life- learning is one of them, but not enough to attract or be relevant to recruiters. Especially when you're a full-stack developer but most of your 6 previous projects are Data analytics related projects as a hobby.

The Dilemma.

7 Comments
2025/01/31
22:07 UTC

149

How Do I Rebuild My Coding Skills After Relying Too Much on AI?

I started learning how to code a few years ago, but I didn’t take it seriously at first. I built some small projects by following YouTube tutorials but never truly mastered the fundamentals. Then I stopped coding for a while, and when I came back, AI tools were everywhere. I started using them daily for learning and projects, which, in hindsight, was a huge mistake.

Now, I can read and understand most of my schoolwork (high-level languages, not full codebases), but if you ask me to write something from scratch, I can’t. I don’t remember syntax well, I don’t know what steps to take next, and I feel like I’ve lost my ability to think through problems without assistance. I know how to use pseudocode, but when I try to translate it into actual code, I get stuck.

I feel like I’ve become too reliant on recognition rather than recall. I can read code easily, but I struggle to write it, and it’s frustrating. I want to break out of this and become a strong, independent coder.

What’s the best way to relearn coding properly? Should I go cold turkey on AI and stick only to documentation? How do you guys approach learning in today’s environment?

I still have two years left in college, and my goal is to become an elite coder. Any advice would be greatly appreciated.

69 Comments
2025/01/31
21:48 UTC

4

I’m new to programming and started learning c++

Basically the title, however recently I really wanted to learn a programming language and I’m willing to learn more but I’m having trouble looking for good resources to learn and also sometimes I feel intimidated that there are so many things TO learn that I wonder if I’m investing my time correctly on the current thing I’m practicing, im watching a YouTube tutorial that’s six hours long and everyday I practice every topic in there I’ve already gone through an hour of that video from the YouTuber Bro code and his c++ video, but I hope someone with professional experience can help me out or anyone well versed into the world of programming , I would very much appreciate it.

    I was considering going to college due to a more structured learning environment even though I know I can be self taught at home it’s currently really difficult for me and I’m hoping it’s just because I’m new to programming, also one of the main reasons I wanted to start programming was because I wanted to make video games but if someone has suggestions I would very much appreciate it thank you.
7 Comments
2025/01/31
21:45 UTC

Back To Top