r/learnprogramming • • Mar 26 '17

New? READ ME FIRST!

825 Upvotes

Welcome to /r/learnprogramming!

Quick start:

  1. New to programming? Not sure how to start learning? See FAQ - Getting started.
  2. Have a question? Our FAQ covers many common questions; check that first. Also try searching old posts, either via google or via reddit's search.
  3. Your question isn't answered in the FAQ? Please read the following:

Getting debugging help

If your question is about code, make sure it's specific and provides all information up-front. Here's a checklist of what to include:

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

Do your best to solve your problem before posting. The quality of the answers will be proportional to the amount of effort you put into your post. Note that title-only posts are automatically removed.

Also see our full posting guidelines and the subreddit rules. After you post a question, DO NOT delete it!

Asking conceptual questions

Asking conceptual questions is ok, but please check our FAQ and search older posts first.

If you plan on asking a question similar to one in the FAQ, explain what exactly the FAQ didn't address and clarify what you're looking for instead. See our full guidelines on asking conceptual questions for more details.

Subreddit rules

Please read our rules and other policies before posting. If you see somebody breaking a rule, report it! Reports and PMs to the mod team are the quickest ways to bring issues to our attention.


r/learnprogramming • • 3d ago

What have you been working on recently? [November 28, 2026]

6 Upvotes

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.


r/learnprogramming • • 12m ago

Help needed How to i turn my code into app?

1 Upvotes

I want to make a simple music player app for my school project, but they only thought us how to make stuff in web, so i want to do something more unique for the graduation project. I dont need any fancy app hosting, just a way i can download my code and use it as an app


r/learnprogramming • • 10h ago

How do you know when you’re actually improving at programming?

13 Upvotes

I’ve been learning programming for a while, and sometimes it’s difficult to tell whether I’m actually improving.
I can follow tutorials and understand examples, but when I try to solve a problem completely on my own, I get stuck.
For those who are more experienced, what helped you move from following tutorials to confidently writing your own code?
I’d love to hear about your learning experiences.


r/learnprogramming • • 3h ago

If I need to make a local or public app what back-end knowledge should I have

3 Upvotes

I still can't understand back-end, like how do I make the server or database, do I need to learn php, what are the other options, where so i start start ?? It always felt overwhelming to learn and still is.


r/learnprogramming • • 19h ago

Resource Suggestion: Advent of Code starts tonight!

42 Upvotes

For those seeking out a more advanced programming challenge, the yearly Advent Of Code will commence on December 1st.

It's an advent calendar of programming prompts/challenges. Each evening at midnight for the first 12 days of December, a new puzzle will unlock at midnight EST. Each puzzle provides you with an input and asks you to use programming to calculate some result.

There are no limits to what languages, tools, etc. can be used. There are no prizes. The challenge is free for everyone.

The problems are often quite challenging. Even professional programmers often get stuck on some of them. This is probably not an event for folks who are just starting out with coding. But for more advanced learners, fighting with the problems and then going to the discussion threads to see the many different ways that programmers solve them can be very educational.

There's a very active subreddit for the event: r/adventofcode.

Happy coding!

Disclaimer: I am not in any way affiliated. I'm just a fan.


r/learnprogramming • • 8h ago

Need for an advice

5 Upvotes

I worked as a front-end dev intern at a company, and yesterday I got laid off. I'm still in Jonas Schmedtmann's React course, now in the intermediate section, and still learning.

Most people say you should be full-stack, so I have to learn to do backend. I don't know if I should learn them simultaneously or not, and at the same time I want to have a job as soon as possible.


r/learnprogramming • • 11h ago

YouTube channels worth following

8 Upvotes

Hello there,

I am new into the community and I am currently looking forward to improve my programming skills since it is a topic that I really like since I was in college.

so I would like to ask you guys which YouTube channel do you actually recommend because it has legit information about the SWE world that is worth looking into. some times you learn more from a video if the topic that you are looking for gets to complicated in the book you are reading, so I would really appreciate you guys recommendations.

Thank you in advance. I am really excited to be part of this community


r/learnprogramming • • 5h ago

Topic TIL code comments have their own line-length conventions instead of relying on editor soft-wrap

2 Upvotes

I recently learned that comments aren't supposed to rely on editor soft-wrap. Hard-wrapping at 80 columns with // or # on every line keeps git diff and PR reviews readable—and Neovim already handles it natively with textwidth + formatoptions+=cq + gwip

What other such conventions are out there that I should know about?


r/learnprogramming • • 2h ago

Need help on DB2 design

1 Upvotes

Problem Statement

We have a transaction history table (CARDTXNHIST) used by a banking application to display customer transactions.

​The daily batch process consists of two stages:

​Unstatemented Transactions (Code = 2) batch file → TEMP table → View → CARDTXNHIST

​Existing Code=2 records are deleted and refreshed

​Statemented Transactions (Code = 3)

​Separate batch file → TEMP table → View → CARDTXNHIST

​Statemented records are loaded after unstatemented processing

​The batch window runs approximately between 4 AM and 9 AM.

​Observed Issue

On statement cycle dates, the incoming unstatemented dataset may be empty because all eligible transactions have been statemented.

​As a result:

​Code=2 transactions are removed/refreshed

​Code=3 transactions are still being processed

​During this period, customers may see no transaction history in the application, even though the transactions still exist within the batch pipeline.

​Objective

We are looking for database/application architecture approaches that can eliminate or minimize this visibility gap while the batch is in progress.

​Solutions Under Consideration

​Retaining Code=2 records until Code=3 processing completes

​Shadow table / table-swap approach

​Composite views

​Deferred commit strategy

​Reading from staging/view sources during batch processing

​Data archival and performance optimization

​Other database design recommendations

​Questions

​What would be the recommended design pattern to ensure customers always see a consistent transaction history?

​How have similar large-scale batch processing systems solved this "delete-before-republish" visibility gap?

​Are there DB2-specific approaches (isolation levels, shadow tables, transition tables, view-switching, etc.) that would be suitable for this scenario?

​If you'd like to adjust the length or add any extra context (like table volume or specific DB2 version) before posting, let me know!


r/learnprogramming • • 3h ago

Trying to understand type of data from the windows library and getting registries attributes in C++

1 Upvotes

Good morning everyone, I'm having an hard time to understand properly the conversion i could do, without resorting an incredible amount of if else's, of data retrieved with the api windows function
RegGetValueA. From what i understood this function, given the specific attribute we are searching, will give you data from the registry of interest, to give more context a registry is something that windows uses to store specific data regarding the system, I'm not very sure though, because i mostly program on linux systems.
Given the promise i would like to explain my problem. I'm trying to retrieve for example on the following registry path:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"

an app and it's attributes for example, the first steps of getting the apps are already done if you want to check the code here it goes, but you can skip it since it works, it's just for context:

std::tuple<std::error_code, entity::ExtendedInfo> GetApplications() {
  const string sName = "applications";
  HKEY hKey = nullptr;
  // (ln) needed path in order to retrieve app data info
  std::list<std::string> hPaths{
      "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall",
      "SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall",
  };
  std::list<std::string> vKeys{"IdentifyingNumber", "DisplayName", "DisplayVersion", "InstallLocation", "InstallSource",
                               "Language",          "Publisher",   "InstallDate",    "UninstallString"};
  // (ln) registries to check to retrieve apps info
  std::vector<HKEY> hRegistries{HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER};
  std::vector<string> retrieved_apps_tmp;
  std::vector<std::unordered_map<std::string, std::string>> apps_with_attributes;
  entity::ExtendedInfo oExtInfo{sName, vKeys};
  for (const auto registry : hRegistries) {
    for (const auto& path : hPaths) {
      if (::RegOpenKeyExA(registry, path.c_str(), 0,
                          KEY_READ,  // here we set the security level
                          &hKey) == ERROR_SUCCESS) {
        retrieved_apps_tmp = FillAppsVector(hKey);
      }
      ::RegCloseKey(hKey);
      // getting attributes for app
      for (const auto& app_name : retrieved_apps_tmp) {
        std::string path_to_app = std::string(path) + "\\" + app_name;
        if (::RegOpenKeyExA(registry, path_to_app.c_str(), 0,
                            KEY_READ,  // here we set the security level
                            &hKey) == ERROR_SUCCESS) {
          FillAppAttributes(hKey, apps_with_attributes, app_name, vKeys);
        }
        ::RegCloseKey(hKey);
      }
    }
  }

  // instead of iterating again do this operation directly in FillAppAttributes
  for (auto app : apps_with_attributes) {
    if (app["InstallDate"].length() >= 8) {
      app["InstallDate"] = app["InstallDate"].substr(0, 4) + '-' + app["InstallDate"].substr(4, 2) + '-' +
                           app["InstallDate"].substr(6, 2);
    }
    // trying to force values
    // identifying number is not used in AddEntry
    oExtInfo.AddEntry(std::list<std::string>{app["IdentifyingNumber"], app["DisplayName"], app["DisplayVersion"],
                                             app["InstallLocation"], app["InstallSource"], app["Language"],
                                             app["Publisher"], app["UninstallString"], app["InstallDate"]});
  }
  //data ok, uninstall ok, publisher ok, language ok,
  return make_tuple(error_code(), oExtInfo);
}

It has to return a tuple to accommodate some other code since I'm working on a team.
This is the function that helps retrieving a vector of apps after listing them with RegEnumKeyA:

static std::vector<std::string> FillAppsVector(const HKEY hKey) {
  CHAR achKey[255];
  DWORD cSubKeys = 0;
  // DWORD cValues = 0;
  std::vector<std::string> installed_apps;

  DWORD retCode = ::RegQueryInfoKey(hKey, nullptr, nullptr, nullptr, &cSubKeys, nullptr, nullptr,
                                    nullptr,  // number of values associated with the key
                                    nullptr, nullptr, nullptr, nullptr);

  // we enumerate all subkeys until RegEnumKeyEx fails
  if (cSubKeys && retCode == ERROR_SUCCESS) {
    for (DWORD i = 0; i < cSubKeys; i++) {
      constexpr DWORD cbName = sizeof(achKey);  // reset it in order to avoid to have the last string length
      // use RegEnumKey = less arguments
      retCode = ::RegEnumKeyA(hKey, i, achKey, cbName);
      if (retCode == ERROR_SUCCESS) {
        installed_apps.emplace_back(achKey);
      }
    }
  }
  return installed_apps;
}

And at the end I've done a function to help me retrieve the attributes i need for every specific app

static void FillAppAttributes(HKEY hKey, std::vector<std::unordered_map<std::string, std::string>>& app_data,
                              const std::string& app_name, const std::list<std::string>& needed_attributes) {
  auto retCode = 0;

  char pvDataForStr[255] = "\0"; // this applies for REG_SZ vars
  DWORD pvDataForNumb{}; // this applies for REG_DWORD types

  DWORD pcBdata = 0;

  std::unordered_map<std::string, std::string> tmp_map;
  // (ln) we already retrieved the first attribute
  // if attr = language, interpret data as DWORD
  // number to string must be as integer number (10) instead of hex (16)
  tmp_map["IdentifyingNumber"] = app_name;
  for (const auto& attribute : needed_attributes) {
    if (attribute == "IdentifyingNumber") continue;
    pcBdata = sizeof(pvDataForStr);
    if (attribute == "Language") {
      // if we would use a char[255] the data would be converted badly since the language REG is a int
      retCode = RegGetValueA(hKey, nullptr, attribute.c_str(), RRF_RT_ANY, nullptr, &pvDataForNumb, &pcBdata);
      if (retCode != ERROR_SUCCESS) {
        // (ln) for data integrity the missing attribute will be empty
        tmp_map[attribute] = "";
      } else {
        tmp_map[attribute] = std::to_string(pvDataForNumb);
      }
    }
    else {
      retCode = RegGetValueA(hKey, nullptr, attribute.c_str(), RRF_RT_ANY,           nullptr, &pvDataForStr, &pcBdata);
      if (retCode != ERROR_SUCCESS) {
        // (ln) for data integrity the missing attribute will be empty
        tmp_map[attribute] = "";
      } else {
        tmp_map[attribute] = pvDataForStr;
      }
    }
  }
  app_data.emplace_back(tmp_map);
}

Now this all works, i did some tests as well, but i really hate to use the "if" to distinguish between any string that i would get with the attributes I'm searching that are all REG_SZ, so the char[255] works wonders, and the "Language" attribute that is a REG_DWORD, basically an integer, and have to resort to use a DWORD var just for it, otherwise i would get strange or wrong data (for example if i use char[255] when "language" is ox00000409 (1033) i would get something like "\t0x4" i don't know why though, if someone knows lmk).
So my request is if there's a way to do this better without losing readability in the first place, obviously any knowledge you would like to share, if i got something wrong, is well appreciated,


r/learnprogramming • • 14h ago

Resource Where to read about programming related blogs and articles?

7 Upvotes

I recently read this blog about someone building a database with zero dependencies from scratch in Rust and it was really interesting. I also want to reduce my time doomscrolling and want to read something informative when on my phone instead and this is the kind of stuff that would help me become more knowledgeable in programming. If there any popular sites that you guys use to read programming-related articles/blogs please drop a comment. Thank!


r/learnprogramming • • 4h ago

How could i decrement a value in a variable, x times over a certain period of time in C?

1 Upvotes

I'm creating an emulator of CHIP-8 in C following the Tobias' guide and I should decrement the value of delay and sound timers 60 times per seconds but i don't know how to do this. Maybe could be something in SDL2 but i want to implement this feature independently by this library so i can easily import this emulator on other devices changing just the graphics and input management.


r/learnprogramming • • 20h ago

Discussion How can I focus longer on programming?

8 Upvotes

I'm a creative person. I like creating things, and I would love to create my own apps and programs. However, I find it hard to concentrate on programming, and I found out that it's not something that I can just do whenever, for example, something like video editing. No, I have to fully concentrate on programming the whole way unless I have already learned something and I have to recall it.
I don't have ADHD. Could this be solved?


r/learnprogramming • • 1d ago

How to improve logical thinking in programming

92 Upvotes

Hey

I'm 23m working professional,

Yesterday at the office my team lead said he found a pattern in my work

He said I'm mugging up patterns and not thinking logically.

Well I do codeforces , leetcode, hacker rank to improve my programming skills but I understood that he was right

All I do is find a pattern in the problem and try to solve it

Anytime I find a new problem I'm stuck

Because I never saw that before

How to come up with my own solution?? How to improve problem solving and logical thinking???

Open to all the suggestions:)


r/learnprogramming • • 23h ago

Coding Refresher

10 Upvotes

Is there a free/relatively inexpensive resource for relearning/practicing code?

I was starting to make a lot of strides towards my projects, but after getting this Helpdesk job my time shrank and with it my coding skills.

I was mostly learning C# for unity and started a little C++ after unity pulled the Runtime fee thing, but I really want a way to be able to sit and practice code like an instrument - doing runs, scales, following sheets/tabs, ya know? Just something to help the muscle memory and build a better understanding


r/learnprogramming • • 1h ago

In the age of AI, is it useless to read programming books like designing data intensive applications, Dive into systens a gentle introduction to computer systems and Code Complete?

0 Upvotes

I still want to read all of these books, both for my own enjoyment and to increase my productivity but I feel like I would be wasting precious times on those things.


r/learnprogramming • • 1d ago

Topic I’m curious, how many languages are you “fluent” in?

26 Upvotes

Basically the title. Which language(s)? Was it work, school, or a personal project that pulled you toward said language? I’m just curious about the ways people “settle in” so to speak.

Please don’t be “clever” and say English because I said fluent instead of proficient…I beg you.


r/learnprogramming • • 17h ago

First day

0 Upvotes

Hello peeps. Just joined, First day here, and I have a personal question.

I’ve been a college student for many years now (on and off due to unexpected life changes, job losses, and ultimately a lack of financial backing.)

Because of this I’ve naturally had a lot of time to speculate what exactly I want to do. I’m a musician and enjoy computers.

My earliest memories of curiosity always return to the first time I ever encountered a broken speaker/radio receiver. I stripped it down( destructively of course) to the motherboard and played with it and probably took the housing off of every radio or broken audio device possible that year.. it’s safe to say that since I’ve always been interested in how audio works and how it’s products and things are made and how it gets used by others in their daily lives.

That said, previously, I was exploring architecture and urban planning, until my MIL convinced me to give something that blends my interest a try.

something that I could possibly see my self doing lifelong/ or atleast not eventually become annoyed by or consider cumbersome later on.

After some research and some internal assessments, music technology seemed to be that thing. Im still working out what my concentration may be, I need to finish 2 more semesters before I can transfer to the school that offers the music technology degree, but all this back story leads me to a question that I’m sure has been asked or atleast thrown around in here once or twice.

In the age of AI, can someone like me, with a rudimentary understanding of programming(python) survive the current climate of the tech industry/ world.

I know that my interest is probably a little niche, given its musical nature, but I’m fearful that that doesn’t make it exempt from the technological advancements happening right now.

I wont name the company I work for, but their AI systems have reduced my teams workload and responsibilities significantly. We all fear layoffs due to the way these systems can do 4 people’s jobs all at once.

TLDR: can a programming newbie survive the AI wave even if the systems I want to work on are music oriented?

(making new physical instruments that are possibly powered by cpu systems/ hardware/ software etc. , DAWs, plugins, and possibly DSP and things like that).

All answers welcome, thanks to those who take the time to reply in advance


r/learnprogramming • • 10h ago

How much usage of AI is okay when doing my own projects if I want to get better?

0 Upvotes

Question that has been bugging me lately:

Should I not use AI at all? Only googling and documentation?

Should I try to resolve my problem for 30 minutes then use AI?

Should I use AI but make sure that I understand what it wrote?

Is there some prompt that could guide me without giving anwser straight away so I can grow?

Does it matter?


r/learnprogramming • • 19h ago

Topic How do you learn Hosting and Deployment for free?

1 Upvotes

I have been working in MERN stack and have build some projects. But i've never really deployed any of my apps. I have searched on different platforms for resources fo learn deployment but its always tied to some paid service or a credit card information. I was thinking of building my own VPS, and somehow make it publicly accessible instead of Local Network. Can someone help me?


r/learnprogramming • • 1d ago

What programming language should I focus on as an occasional hobbyist?

6 Upvotes

As in, I sit down to code for a few hours once a month, give or take.

I've been chugging along on a text-based game in TypeScript with Vue. I'm constantly running into quirks and hidden nuances of the languages. Spending my precious hours figuring out the difference between interfaces and types, only to learn that it's pretty much personal preference, makes me feel like I'm wasting time due to the language choice.

Also the fact that I have to juggle several languages with their idiosyncracies: HTML, CSS, TypeScript, JavaScript (when it offers its own quirk), Vue, JSON. Forgetting one language then having to get back into it.

Can I have a more straightforward language? Maybe I should go to just bare JavaScript? I've used several languages in the past, including Java, C#, Python, Lua.


r/learnprogramming • • 22h ago

1st Year Tier-1 CSE: Am I too late for C++ and DSA? Already did some ML.

0 Upvotes

Hey everyone,

I am a first-year CSE student at a tier-1 college. My first semester is ending on December 4th. I am planning to start learning C++ and Data Structures & Algorithms (DSA) now, but I am worried—am I starting too late?

To give some context: I didn't learn much during the first 1.5 to 2 months of college. However, over the last 1.5 months, I have been diving into Data Science and Machine Learning. I've been studying from Data Science from Scratch by Joel Grus and Introduction to Statistical Learning with Python (ISLP).

Currently, I am quite comfortable with Python and its core libraries, including NumPy, Pandas, Matplotlib, Seaborn, and Scikit-Learn. I feel I have built a solid foundation in ML and understand the basic math behind common algorithms like Random Forests, Decision Trees, Gradient Boosting, Linear Regression, XGBoost, HistGradientBoosting, AdaBoost, CatBoost, KNN, K-Means clustering, DBSCAN, and hierarchical modeling. I am also familiar with various model evaluation techniques.

Despite this, I feel an underlying anxiety because I haven't started DSA yet. A lot of my peers are already active on platforms like LeetCode and Codeforces, or are following Striver's sheets.

Given my current progress and the peer pressure, am I actually lagging behind, or is starting DSA in the second semester perfectly fine? I would love to get some perspective and advice on how to balance my ML interest with competitive programming/DSA moving forward.

Thanks!


r/learnprogramming • • 2d ago

Cybersecurity, game development, or deep learning? I can't decide.

47 Upvotes

I'm genuinely interested in all three, and that's the problem.

I've been learning programming and recently completed MIT 6.100L. Now I'm trying to figure out what to explore next.

Cybersecurity, game development, deep learning all three sound equally exciting to me, and I can't seem to settle on one.

For those of you who've been in a similar situation, how did you decide what to pursue? Did you just pick one and see where it took you, or did you find a way to explore everything?

I'd love to hear your experiences and advice.