/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,145,781 Subscribers

1

Personal website for blogging/portfolio (absolute beginner)

I am a content writer with no real portfolio, don't ask. I'm fresh out of uni and I don't have any pieces available online. I thought about creating a personal website where I could maybe publish a few thought pieces, mock up a social media campaign for a brand or two etc. I don't even want to use it for freelancer purposes, it's more for sending it as a portfolio when I apply for jobs.

Now, I have no experience in coding. Or website building. Nothing. But I'd love to build the website myself. Not to mention I'm not 100% sure how to make it SEO friendly, but I guess that would be the next step.

Could you recommend ways for me to build a website? Where? How? What's hosting?

I've seen a lot of similar posts but people in comments just drop random (to me) names and I don't even know where to start. I heard Wix/SquareSpace are not the best for SEO and are on the pricier side, so I'm not sure about them.

I've seen Wordpress mentioned a lot too but then people talk about some hosts etc...

I do want to learn how to build it myself, maybe in the future I would hire someone, but for now, I'm broke. I still want it to look nice tho.

I would be so SO grateful for some advice and guidance

0 Comments
2024/11/09
21:05 UTC

0

Help for a beginner

Guy's, please I need help with the geany program, every time I write something it gives me ''error 9009'' does anyone know how to solve it?

0 Comments
2024/11/09
20:25 UTC

0

How to get better at solving Dynamic Programming problems?

Hi. I'm a high school student and I'm working on learning how to solve Dynamic Programming problems. So far I've solved problems like the Rod Cutting Problem and the 0/1 Knapsack Problem. However at times I have difficulty identifying the correct recurrence relation for more complex problems. Does anyone have any recommendations for approaching DP problems? Thanks!

1 Comment
2024/11/09
20:11 UTC

1

AI Tools Ruining the Learning Process

Hey there, I'm a 3rd year Software Engineering student and has now done significant coding and learning during these past 2 years. Everything was going fine. I got coding assignments and semester projects, I struggled, I coded stuff and I submitted. Most of the times, things went as expected. Other times, not as much. In the end, I got to learn new things.

Well, that was until recently. We started getting to work with Web Technologies and considering the ease of access and other obvious reasons, seeking help from AI Tools was allowed for lab tasks. I took the phrase 'seeking help' differently from my fellows. Or rather they did. While I tried learning and figuring out the generated snippets, my fellows were already done with all the tasks. Basically copying and pasting the tasks done by the tool rather than coding it themselves. This early completion set the bars higher for what can be called average. This gradually influenced my thoughts about using AI and caused conflict internally within me. Yes, AI boosts efficiency but we are not coding for a company making value for them. We are here to learn and copying and pasting snippet ain't helping with that. But, since we are graded based on what we submit, it was only natural to switch to what everyone was doing. I got into this bad habit of just getting things done by AI tools.

The realisation hit me when during a lab examination, no AI Tools and not even a smart code editor was allowed. Just that good'old Ubuntu text editor for a Programming Course. The recklessness of relying on AI made me pay the price. I could not do great there. It almost felt like I was left handicapped. Worst feeling I've ever had.

I made a mistake. Or is using AI like this normal? I'm so confused. When I talk about this to my fellows, they laugh it off telling me everyone does it. The skills I have are indeed fading due to the low amount of code written and thought about.

The amount of thinking, writing and testing code what I used to write went down drastically over the last few months. I could've learnt a lot. I have the concepts. But the reliance on AI is setting me at a rather risky spot, making me seriously concerned.

I tried re-doing tasks at home but considering the university's tough schedule, it got difficult to continue.

How do I genuinely balance this out. Can someone relate to this scenario?

I appreciate any help. Sorry to make it too long. Just wanted to address an issue that I thought many other people can probably relate to. Thanks..

5 Comments
2024/11/09
19:55 UTC

2

Python: How to make a list from a string while not making a list from every character of that string

For context, I am making a library management system for a computing science assessment and I have a bunch of strings that look like this:
"[""Books"" ""Literature & Fiction"" ""Poetry""]"

My question is, is there any way to turn that string into something like this?
["Books", "Literature & Fiction", "Poetry"]? I tried using split() but that gives me the same thing but within a list at index 0.

Thank you in advance!

5 Comments
2024/11/09
19:37 UTC

1

is recursion a must?

i find recursion extremely hard to wrap my head around. is it a must? or can you just use iteration for everything?

9 Comments
2024/11/09
19:23 UTC

0

What more can I add?

HTTP Server/Framework in Java.
repo: Github
Anybody interested to continue this?

2 Comments
2024/11/09
19:10 UTC

3

Is there a DSA course that's enough for everything?

I've been trying to find a DSA course but i don't know what to pick, so many sources are being recommended on different posts but I don't know which one is enough and I'm trying not to watch multiple courses

1 Comment
2024/11/09
19:00 UTC

0

guys which is correct method please explain

Math.round (52.92*10)/100

5.29

Math.round((2095 + 799 + 1899 + 499) * 0.1) / 100

5.29

3 Comments
2024/11/09
18:49 UTC

2

do you think AI is helpful for writing good code?

personally I just use it as a search tool and checking syntax quickly never to write functionality, but i was wondering what's your take in this subject, is it harmful for a beginner to learn with AI?

21 Comments
2024/11/09
18:44 UTC

2

Design Patterns or Spring boot. Goal is to become a better backend developer

What are the most important Design patterns to learn and is it really necessary to study them?

I am done with java basics(OOP included) and have built some console applications like ticctactoe, library management syystem etc, should I move to springboot?

The goal is to become more proficient on my job as a backend developer

2 Comments
2024/11/09
18:30 UTC

1

Is there something similar to MOOC.FI online programming courses for Javascript?

I only did a little bit of it but I really enjoyed how instead of just following a Udemy guy's videos (for example) and then just typing what the bloke said you actually go through the learning process and then have to write code from scratch/blank to solve some problem they had for you in order to successfully move forward to the next module

And there was no option to scroll back up to see how you did previously because you had never done that in the previous lessons in that module so you really had to think it through yourself

2 Comments
2024/11/09
17:50 UTC

5

Why Emplyers ask to install win10 and run a sample web3 project for a technical interview

I've been going through a few interviews lately, and some of the interviewers have asked me to use Windows 10 to run a Web3 project as part of the technical interview. My main laptop runs Linux, and my secondary one has Windows 11 Pro. I’m curious, though why the preference for an older OS like Windows 10? It feels a bit suspicious to me.

5 Comments
2024/11/09
17:46 UTC

1

Python practice problems

My brother is struggling with exams for his introductory python course in college. The exams include hand writing code, and multiple choice for “finding the output” for certain blocks of code.

Would anyone know any beginner to intermediate friendly resources with practice problems like this? I would say leet code, but some of the easys are kinda tough for a beginner

The course doesn’t seem to offer many practice problems for exams

1 Comment
2024/11/09
17:26 UTC

1

creating chat app, but i got issues like 'buffer is not define' when a applied socket io, i tried everything and nothing is working out

socket__io.js?v=0a4a4d59:655 Uncaught ReferenceError: Buffer is not defined
at ../api/node_modules/engine.io/build/parser-v3/index.js (socket__io.js?v=0a4a4d59:655:24)
at __require2 (chunk-LK32TJAX.js?v=0a4a4d59:18:50)
at ../api/node_modules/engine.io/build/transport.js (socket__io.js?v=0a4a4d59:1366:21)
at __require2 (chunk-LK32TJAX.js?v=0a4a4d59:18:50)
at ../api/node_modules/engine.io/build/transports/polling.js (socket__io.js?v=0a4a4d59:1475:23)
at __require2 (chunk-LK32TJAX.js?v=0a4a4d59:18:50)
at ../api/node_modules/engine.io/build/transports/index.js (socket__io.js?v=0a4a4d59:1988:21)
at __require2 (chunk-LK32TJAX.js?v=0a4a4d59:18:50)
at ../api/node_modules/engine.io/build/server.js (socket__io.js?v=0a4a4d59:2922:24)
at __require2 (chunk-LK32TJAX.js?v=0a4a4d59:18:50)

1 Comment
2024/11/09
16:53 UTC

0

just started learning Java after Python

what in the world???

9 Comments
2024/11/09
16:50 UTC

51

an ignored topic for a beginner dev ; now covered in an open-source, 100% free mini-course

Over the years I have realized that beginner developers see terms like -- password hashing, rainbow tables, salting, public keys, private keys, RSA, encryption, PBKDF-2, and so on. But there isn't a proper learning resource for them.

In the past years, I have helped MDN as an open-source documentation contributor and helped freeCodeCamp in creating their public key cryptography curriculum. So I've got a clue what I am talking about.

I recently got some free time so I decided to develop a mini-course on one of the most ignored topic of your dev education -- cryptography. The course focuses only on those essential concepts that come into picture of daily developer life. No unnecessary math. It stays to the point and practical.

Here's the link to it -- https://cryptography-for-devs.github.io

It's really fully open-source and 100% free course, its a no BS thing: https://github.com/Cryptography-for-Devs/Cryptography-for-Devs.github.io

Let me know if you find value in this, if beginner devs find real value then I will expand the course further. It will stay free forever, no matter what!

5 Comments
2024/11/09
16:33 UTC

0

need help

im basically from finance background and i have no idea where to start please help me out

4 Comments
2024/11/09
16:19 UTC

5

how does Plagiarism in cod works?

I wanted to know how does Plagiarism works in terms of coding questions.
Like according to me if there is same logic for a question then many coders would be having the same logic and most will be using same syntax.
So how does Plagiarism would detect the wrong one there?

11 Comments
2024/11/09
16:10 UTC

2

Ideas to get Datasets for Computer Vision Project in E-commerce

Hey i’m dipping my toes into ML and want to build an model which compares to picture and decides if it could be the same product.

Do you have any Idea how to get Datasets without label them myself ?

How big should the dataset be in order to achieve notable results ?

2 Comments
2024/11/09
16:09 UTC

2

Where should I ask broad and abstract software design questions?

stackoverflow.com is a great resource, but they have strict rules against abstract, theoretical and subjective questions without specific code examples.

r/learnprogramming is great for beginner stuff, but when I ask anything more complex, I tend to get lots of upvotes but no answers.

softwareengineering.stackexchange.com seems to be the right place, but activity there is minimal, I typically get 10-15 views on my question and no answers.

So, my question is, what is the best place for asking broad, abstract and potentially subjective questions about software architecture, contemplating different ways of structuring my application and it's UI, various approaches to making it intuitive for the users, and so on?

For some of these broad yet important questions I would even consider paying to get an answer, but I can't seem to find a place where one could get such service.

Any advice?

6 Comments
2024/11/09
15:23 UTC

2

Recent Graduate in Coding, Feeling Lost on Which Path to Take – Advice Needed!

I graduated in 2024 with a BCCA degree, and I'm currently trying to figure out my next steps in coding. I have over two years of internship experience working with Odoo, Python, SQL, Java, and Excel, and I’ve built skills in data analysis and automation. Some of my main accomplishments include:

  • Developing and customizing 10+ Odoo modules to improve efficiency
  • Building automated Excel tools for financial accuracy and efficiency
  • Creating a Python-based data scraper to extract business-relevant data

I also have knowledge in Linux, PostgreSQL, and XML. Recently, I’ve felt like I'm losing touch with what I've learned, and I'm not sure which coding path to pursue. I’m considering fields like DevOps, data analysis, or Python-based development, but I'm not confident about which one is best for me.

Plus, I can't find any job or even an interview.

Has anyone else felt this way or found a strategy to choose the right path in coding? Any tips or resources would be greatly appreciated!

Thanks in advance for your help!

2 Comments
2024/11/09
14:54 UTC

0

Anime Fighting Game Style Code Editor with Effects and Sounds – Saw It on Instagram Reel, Can’t Find It

I saw an Instagram reel showcasing a code editor with animation and sound effects in an anime or fighting-game style (like Dragon Ball fights). Each letter I typed triggered effects and sounds, and even the cursor movements had these effects, making it feel like a battle scene. The caption mentioned something like 'code editor like Dragon Ball fight,' with a GitHub download link, but I lost the video. Does anyone know where I can find this editor or something similar to this?

0 Comments
2024/11/09
14:40 UTC

1

How Does YouTube Download Work in Web Browsers?

Hi everyone,

I’m curious about how YouTube’s offline video functionality works in web browsers. Here’s what I’ve observed and would love to get some technical insights from the community.

Recently, I downloaded a video from YouTube using the web version. The video is quite long—about 3 hours—and I was able to watch it offline without any issues once it was downloaded. What puzzles me is that despite the video’s large size, the browser’s cache and storage didn’t show a significant increase in size.

Web browsers typically have storage limits for offline data such as cookies, cache, and local storage, often ranging around 5 MB for these purposes. Given this limit, I’m wondering how YouTube manages to allow such large video downloads and playback in a browser. I’ve tested this across different browsers, and it works perfectly.

Some technical points I’m interested in:

  1. How does YouTube circumvent browser storage limits to enable large video downloads? Is it using some form of server-side storage or special techniques?
  2. What mechanisms are in place to manage and retrieve these offline videos without significantly affecting local storage?
  3. Are there any JavaScript or web API methods YouTube employs to handle this efficiently?

I would really appreciate any technical explanations or insights into how this works.

Disclaimer:(this is repost ) I don’t have YouTube Premium. I’ve noticed that in my current country (where YouTube is automatically set to a local version), I’m able to download videos and watch them offline without ads. This could be due to the fact that there are fewer advertisers here, and many people don’t speak English or use Latin script.

Thanks in advance for your help!

2 Comments
2024/11/09
14:35 UTC

2

How Does YouTube Download Work in Web Browsers?

Hi everyone,

I’m curious about how YouTube’s offline video functionality works in web browsers. Here’s what I’ve observed and would love to get some technical insights from the community.

Recently, I downloaded a video from YouTube using the web version. The video is quite long—about 3 hours—and I was able to watch it offline without any issues once it was downloaded. What puzzles me is that despite the video’s large size, the browser’s cache and storage didn’t show a significant increase in size.

Web browsers typically have storage limits for offline data such as cookies, cache, and local storage, often ranging around 5 MB for these purposes. Given this limit, I’m wondering how YouTube manages to allow such large video downloads and playback in a browser. I’ve tested this across different browsers, and it works perfectly.

Some technical points I’m interested in:

  1. How does YouTube circumvent browser storage limits to enable large video downloads? Is it using some form of server-side storage or special techniques?
  2. What mechanisms are in place to manage and retrieve these offline videos without significantly affecting local storage?
  3. Are there any JavaScript or web API methods YouTube employs to handle this efficiently?

I would really appreciate any technical explanations or insights into how this works.

Disclaimer: I don’t have YouTube Premium. I’ve noticed that in my current country (where YouTube is automatically set to a local version), I’m able to download videos and watch them offline without ads. This could be due to the fact that there are fewer advertisers here, and many people don’t speak English or use Latin script.

Thanks in advance for your help!

0 Comments
2024/11/09
14:35 UTC

0

Thinking about studying system programming

How do you think, is it reasonable to study and work in this field, will it be still actual in few decades? The most interesting programming field, in my opinion, but I am not sure, if it will exist in the future, or absolutely changed with AI

6 Comments
2024/11/09
14:34 UTC

1

What textbook to choose

I have the option to select 1 out of 3 books in my university. What would you choose in my case given that i already own C++ How to Program by Deitel ?

  • C How to Program by Deitel
  • The C++ Programming Language by Bjarne Stroustrup
  • Programming: Principles and Practice Using C++ by Bjarne Stroustrup

I'm thinking of going with the C book because I don't have any books for C

1 Comment
2024/11/09
13:35 UTC

1

Getting into mobile development, any way to debug live from a Hyper-V VM?

So I got a big machine and a weak laptop. I set up a big Hyper-V VM with GPU and stuff to connect to from my laptop while out and about to game and develop

Now that I got into mobile development and been googling a bit about being able to debug the app live on my phone from the VM, but the solutions with wifi debugging or using some sdk tools didn't really get me anywhere

Question is, should I just keep trying to get it to run with one of those ways or are there any alternatives?

0 Comments
2024/11/09
13:28 UTC

1

Curious on Web Development

Hello newbie here, I am interested in Web Development in programming as I saw my friend work on a certain website. How do I learn and start from to be able to do that?

3 Comments
2024/11/09
13:24 UTC

2

finance major wanna shift to programming

So, I’m 22 years old on my last year in finance in uni. Took 2 elective programming courses but they are mostly related to finance and they teach python. Im not really satisfied with my major, I feel like it doesn’t fit my way of thinking and it’s hard to get for me even though I’d been called a smart and successful student in high school (especially in maths and languages), also does not fit my interests. After taking these coding classes I found out I actually enjoy it and prefer it to finance, even though it’s beginner level and mostly related to stocks and stuff. People I’ve talked to during my internship recommended learning SQL and positions like business analysts if I dont like finance that much. I just feel like I might want to fully transition to IT and as much coding as possible.

I would appreciate any insights and advice on what steps to take and to what extent I can do this. Thank you in advance

3 Comments
2024/11/09
13:21 UTC

Back To Top