/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,143,526 Subscribers

1

Enterprise full-stack development platform?

Hello,

I have been using Anvil.works, replit, and pythonanywhere for developing small web apps/tools at my company, and really love the convenience of a cloud IDE that supports things like pip integrated with a full hosting infrastructure. However, I would like to be able to publish more "official" Enterprise scale applications with better security /-authentication features, and was wondering if there are any equivalent tools that are built for such tasks/ support Enterprise use cases?

Thank you

0 Comments
2024/11/02
13:19 UTC

1

Reverse Engineering a non-public API

I know most automakers don't allow third parties to use their API or don't have a public API at all, so there are companies out there that use your login information to interact with the car's API that they've reverse engineered.

I'm thinking of doing something like this for fun for streaming services like Hulu, just to manage subscriptions. The idea is an app that can centralize cancelling and starting subscriptions across a variety of platforms. It's just for fun and learning and a slightly more interesting portfolio project.

Is this a project an individual could handle at all and what key terms do I need to be looking up to learn about this, or are there some barriers that are insurmountable? I've found some things but a lot of it doesn't seem very applicable.

0 Comments
2024/11/02
13:18 UTC

3

How to Transition from Solo Development to Working in a Larger Team?

I've been working as a developer in my tech stack for six years, mostly solo or with small teams. Now, I’m looking to join a larger team, but I've noticed that hiring managers expect me to have experience in leadership or senior roles, which I don’t have.
Has anyone else faced this transition? How did you approach it, and what skills or experiences helped you adjust? Any advice would be appreciated!

1 Comment
2024/11/02
12:05 UTC

2

Tech stack recommendation for building online site selling digital product

I am planning to build a Web app and works on mobile and desktop. Currently I am contemplating whether to use flutter with firebase or react native with django as the backend.

Which is more suitable or if anyone got any other recommendations?

0 Comments
2024/11/02
11:55 UTC

3

Learning web dev + another language?

Hey all,

So I am doing web dev now but also would love to start C#. Wondering if one should learn web dev + another language together (in this case C#) or do web dev first, then c#, then others etc.

I want to hear from the more experienced people.

0 Comments
2024/11/02
11:47 UTC

9

How hard would be to start Frontend in your 40s?

Ive been curious about learning Html, CSS and JavaScript for a while. Finally (starting my 40s) I've started some tutorials on these languages through YouTube but I'm wondering if I'm just wasting my time or not. I'd like to have some insight on other people with a similar case.

Thanks!

21 Comments
2024/11/02
11:22 UTC

2

Hello, I need help picking a project for my bachelor's project.

Hello, I'm a year 4 ECE student and I have to pick a topic for my senior project. All I know for the time being is that I would love to build a neural network from scratch that will be tied to analysing biological data. Here are some things to consider:

  1. I am fairly new to machine learning. I know only the basics of how a neural network is structured and I have a vague idea about the process of training a model. With that being said, I really want to learn a lot about the ML field during this project.

  2. I am considering 2 kinds of biological data: Images (MRIs, CT scans, etc.) or some biological indicators (heartbeat data, ECG brainwave signal data, etc.). In the end I would like my network to be able to tell the difference between a diseased and a healthy patient. I'm leaning more towards the image processing part. This takes us to the 3rd point:

  3. As far as I know, biological data is scarcely available due to patient confidentiality reasons. I want to pick a project that I can train with lots of biological data that is available as open-source on the web.

What would be your recommendations/advices? Thanks in advance.

0 Comments
2024/11/02
10:44 UTC

2

Seeking Advice on Securing a Node.js API and SQL Database for a Small WPF Desktop App

I'm looking to provision an SQL database using services like DigitalOcean, Linode, Vultr, or AWS, but there’s a good chance that I might host my Node.js API on Vercel, where I have experience deploying to it.

For security reasons, I want to set up this API to interact with the database, as my application is a small WPF desktop app that will be used by no more than three users from their personal computers.

I have experience creating a Node.js API without any security features, primarily for testing. However, I now need to secure both the API and the database.

I realize that security can be a vast and complex subject, but I'm looking for some baseline practices that will allow me to achieve a reasonable level of security without diving into overwhelming details.

What are some practical steps or recommendations you would suggest for securing the API and the database in this scenario? Thank you!

0 Comments
2024/11/02
09:45 UTC

2

Theory vs Practice?

Just new to programming, been one or two months in in.

Have made some programs with python and random.

In repo I'm currently working, I thought of implement GUI, it's a rock, scissors and paper game.

And chose PyQt as designer.

Would it be better to lean some basics about it and then do the stuff or just get it done with and look up when it calls for it?

0 Comments
2024/11/02
09:29 UTC

2

Future path.

Hi everyone! Two months ago, I started learning C# and quickly fell in love with it. I’m already exploring libraries like ASP.NET and Unity.

BUT, theres no .NET junior positions in my country. Government is offering me a chance to learn Java or Python with funding and will help to secure position.

My question is should I choose Java, which is somewhat similar to C#, or follow the trend with Python? Which language is more likely to help me secure position?

2 Comments
2024/11/02
08:19 UTC

1

transform the abstract factory into a singleton.

I'm doing an exercise on design patterns where, to avoid passing the factory to the method that needs to use it, I'm using the Singleton pattern to access it directly. I've encountered the following situation:

class HistogramFactory {
    static HistogramFactory *instance;
protected:
    HistogramFactory() {}
public:
    virtual PrintableChars *getPrintableChars() = 0;

    static HistogramFactory *getInstance();
};

HistogramFactory *HistogramFactory::instance = nullptr;

HistogramFactory *HistogramFactory::getInstance() {
    if (instance == nullptr)
        instance = new HistogramFactory();

    return instance;
}

The problem is that I can't do this: instance = new HistogramFactory(); since HistogramFactory is abstract. So, aside from making the method virtual (which I don't want to do because I need it as an interface method), what can I do? I tried making the choice of which factory to use at the time getInstance() is called, by passing an enum (like getInstance(factoryType)), but this doesn't feel correct, because on subsequent calls to getInstance(), I wouldn’t be able to change the instance, even though the method suggests otherwise.

The only idea that comes to mind at this point is to make each factory implementation a singleton, but wouldn't that prevent the use of multiple factories? Let me explain better: for example, when I use a look and feel (i.e., I have an abstract factory to create different looks and feels based on the target platform), in an application, I only use the chosen one. Therefore, it shouldn’t be possible to create more than one look and feel within the same application.

5 Comments
2024/11/02
08:05 UTC

2

Best resource for learning React

I’m working through freeCodeCamp and I’ve reached react. I’ve had no problems with anything in the lessons until now, but I’m having trouble understanding react the way it is being presented. I’m going to turn to an alternative source for learning react and I thought I might check here for any suggestions before picking one.

7 Comments
2024/11/02
07:20 UTC

2

Full stack for people that know a little bit of backend

Apologies for a question probably asked 1000x. I studied CS 30 years ago and got into management. Translate didnt program for a living. Based on little side projects I would say I am adequate in Python, machine learning, command line and can probably help myself in ES6, Java, C++ and HTML. What I don't know is how to build a modern front end, the tooling necessary and linking it all to the backend and then cloud deploy. What resources are available to get up to speed? I looked at Project Odin but it seems just too big taking into account what I already know. Any comments or suggestions would be welcomed.

2 Comments
2024/11/02
06:57 UTC

20

How to actually be a good student?

I am a first year student majoring in computer science with no coding background in high school.

In my first semester of this year, I took Introduction to programming (Python) and all I did was pay attention in the class and do the homework if there is any. I never did a personal project or something like that at all. In the end I got a B which I am really happy about it.

Now in my current semester, I am taking 1. Discrete math, and 2. Data structure and object oriented programming (Java). The leap in difficulty is crazy, I feel so overwhelm in the Java class and I just bombed the midterm and will probably drop this course. Some of my friends are even considering changing their major but I don't want to do that.

Would you mind sharing your advice. How do you keep work life balance because a single java homework assignment took me multiple days to finish (some aren't even correct) on top of other courses that I am taking.

What should I do more to improve?

13 Comments
2024/11/02
06:29 UTC

6

I want to create an app/website to randomize recipes, where do I start?

This is for my own self use since the hardest part of my week is meal planning. If I hear one more whatever you want, then i buy something and the husband says no. Im going to strangle someone. What I want to do is create a list of recipes and assign calorie values to them. Then have a generator randomize the recipes that add up between specific calorie values. I dont have any experience with coding except for some basic html/css back in the neopets day. And also making a snake game in class with java. On the otherhand, my husband wants to learn coding as the next step in his career does not necessarily need coding but would be helpful to know. He also was in the same class as me that made the snake game. Where do I start? Would a website be the best medium? An app? What language should I attempt this in?

1 Comment
2024/11/02
05:19 UTC

3

What have you been working on recently? [November 02, 2024]

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
2024/11/02
05:00 UTC

14

Where to start relearning trigonometry?

Never really used trigonometry outside of highschool and I'm wanting to relearn it now (also in the context for programming) for both a current case of mine and also future cases.

15 Comments
2024/11/02
04:53 UTC

1

EPOC X help

hello, I recently got my hands on an EPOC X from emotiv to work on some research, the truth is that I was not aware that it was so restrictive and I have to pay those expensive licenses, anyone has knowledge or has used any repository to obtain the RAW data. 😭😭

2 Comments
2024/11/02
03:28 UTC

1

Instagram in app browser video issue

When I click on a link in an Instagram description on iOS to navigate to my website, the hero video doesn’t play initially. However, if I navigate to another page and then return to the homepage, the video works as expected. This issue occurs only in the Instagram in-app browser on iOS.

1 Comment
2024/11/02
02:10 UTC

3

Odin vs Meta - front end course

So, a month ago I was searching for an online front-end course and found the Meta one on Coursera, since I didn't have the money to buy the whole course I decided to apply for financial aid... In the meanwhile and because I was tired of waiting, I looked for free courses and found The Odin Project and immediately started my journey. Flash forward to an hour ago, I finnaly received my Coursera financial aid request awnser and it was guaranteed... Should I stay with The Odin Project or should I start again with the Meta course? Thank you

4 Comments
2024/11/02
01:57 UTC

29

Start to learn Programming as a complete beginner

Hi. I am interested in programming but I am completely new to it

I watched some videos and almost everyone recommended to start with learning python so I started watching CS50 introduction to programming with python and then move to CS50 introduction to computer science

They said it is better and I would understand the concepts more efficiently. What are your thoughts is this a good approach to level up my skill?

24 Comments
2024/11/02
01:35 UTC

3

Can you append to a dictionary with a list comprehension in Python?

Hey everyone,

I am taking a college course called data analytics with Python. The problem we are given is that we need to do a cleaning with list comprehensions to single out anagrams of a word given a text file.

The first part requires a generator function that will read through the file line by line.

Then a dictionary is created with all the words in the file as keys but having empty values.

The next part specifies that we create a list comprehension to go through the file again and then append the unsorted words To the dictionary as values where the sorted words are the keys thus creating a key value relationship where the keys are the words and the values are all the anagrams of that word.

However, I cannot find a method where this can be done. First of all a dictionary cannot be used as an iterable in a list comprehension, and secondly you cannot use a list comprehension to append values to a dictionary. I have looked online for methods where this is done and I have not found any.

2 Comments
2024/11/02
01:10 UTC

2

Need Help...

I'm having trouble connecting the Style To allow my webpages to be a darker shade, Preferably Gray or light gray gradient. I'm Currently using Notepad++. I Believe it's a issue of connecting the Style Page with My main webpages and so On. But, I've been stuck on this for hours now, And I'm utterly stomped in confusion.

2 Comments
2024/11/02
00:52 UTC

2

"Often, there is a sense of curiosity about whether projects are truly worthwhile or if they will ultimately succeed. Is it common to have such doubts?

"Often, there is a sense of curiosity about whether projects are truly worthwhile or if they will ultimately succeed. Is it common to have such doubts?

1 Comment
2024/11/02
00:36 UTC

0

Getting job in the time of AI

Hi,

I'm a self-taught learner in computer science. While I've come a long way, I don’t feel fully ready to apply for a job just yet.

With all the changes happening due to AI, I’m concerned about finding a junior-level job. AI seems to be taking over tasks that used to be entry-level, and now senior developers are able to accomplish even more with its help. I’ve noticed that some companies are even laying off employees as a result.

What should I focus on as a junior to improve my chances of finding a job? Are there specific skills or areas I should prioritize in my learning? And is it likely that layoffs will continue as AI advances?

20 Comments
2024/11/02
00:08 UTC

1

Contribank: A New Way for Aspiring Developers to Showcase and Leverage Their Open-Source Contributions

Hey everyone!

I’m working on a project called Contribank and thought it might be helpful for anyone here who’s building up their coding skills and working on getting visibility through open-source contributions. Contribank is designed to go beyond the usual pull requests and basic feedback, offering a structured way to evaluate and showcase contributions. The goal is to provide contributors with something concrete that reflects their skills, which can be a real asset for portfolios, LinkedIn profiles, or job applications.

The platform works by using an evaluation system that checks contributions for quality, coding standards, and overall impact. This is especially useful for new developers who want their work to speak for itself in a way that’s easy for others (like potential employers or collaborators) to understand. Instead of just listing projects you’ve contributed to, you get a clear, measurable assessment that adds credibility to your contributions. This could be a game-changer for those trying to stand out and show real, impactful work—even as they’re still learning.

Right now, Contribank is in a prototype phase, so I’m reaching out to different communities to see if this concept resonates. I’d love feedback from anyone here on whether this would actually be helpful or if there’s anything you think could be improved. If you’re curious to check it out, here’s the link: https://www.contribank.com. Let me know what you think or if you have any suggestions—I’m open to any ideas that could make this better for learners and contributors alike!

Thanks for reading, and I really appreciate any feedback you’re willing to share!

7 Comments
2024/11/01
23:59 UTC

5

How to get started into coding while having ZERO clue/skill?

Please help.

7 Comments
2024/11/01
23:26 UTC

3

[JS] Getting XML from PlayStation Update Servers constantly fights CORS Policy

I have been trying to make a web-based clone of Rusty-PSN, which downloads updates for PS3 games. In order to find updates, you need the game's ID, and then an XML file from PlayStation servers. Although I everything working, I can't seem to get the XML file to save to a variable because fetching the XML file keeps having CORS issues or says ERR_INTERNET_DISCONNECTED.

So far, I have tried: fetch() and XMLHttpRequest. I've used no-cors() on both but they have a problem that Opera refuses to elaborate on.

Since Rusty-PSN has some comments in the source code about the servers having funky certificates, and that when you go to the link you'll see soon it says it's not secure, maybe it has something to do with a server-side problem.

Because of all this, I'm gonna give you the link to LittleBigPlanet 2's XML.

https://a0.ww.np.dl.playstation.net/tpl/np/NPUA80662/NPUA80662-ver.xml

You can replace "NPUA80662" with the ID of any other PS3 game and it should show the corresponding XML.

If the game has no updates, then it'll return nothing and if you input an nonexistent ID it'll return something about "NoSuchKey".

2 Comments
2024/11/01
22:38 UTC

8

Are Provisioned SQL Databases Considered Safe or Not?

If I provision an SQL database from services like DigitalOcean, Linode, Vultr, or AWS, and obtain the connection string, would that database be considered publicly unsafe, even though it requires a username and password for access? Additionally, if I use the connection string in my desktop app, is that okay or not? Do I need to secure it somehow from unauthorized access? What security measures should I take to ensure it's safe?

Thanks for your insights!

5 Comments
2024/11/01
22:31 UTC

0

Confusion 🤔🤔🤔🤔

I want to be a web developer am electrical engineering fresh graduate i can start video editing but am not satisfied how to decide in my personality??!

4 Comments
2024/11/01
22:23 UTC

Back To Top