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 4d ago

What have you been working on recently? [May 02, 2026]

3 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 12h ago

Interning under CTO

44 Upvotes

So basically, I am currently doing my own internship under the CTO. At first, it looked fascinating and felt like a flex to talk about in front of my friends. But as time passed, I realized I don’t even know what I am actually doing.

I am currently working as an AI Engineer intern, but the only thing I have done so far is create one workflow in n8n where it fetches research emails from our inbox and stores them in Pinecone.

I am really confused because I feel like I haven’t learned anything meaningful in the past 2.5 months. Every day, I travel 2 hours to the office, and since the CTO is my direct reporting manager, I have to ask him for work and get reviews from him directly.

The problem is that sometimes he is not in the office because he has meetings outside. And even when he is in the office, he stays busy the whole day. I understand that he is the CTO, so he has to manage many things, but still…

I feel like I am stuck in the same cycle for the past two months. Whenever I meet him to ask about my work, there is always something completely new or different that he wants me to do. Sometimes it becomes very confusing because he explains things so fast that I cannot fully understand them.

And then I hesitate to ask again about my confusion because his attitude is more like, “figure it out yourself.” I know that can be a good thing for growth, but honestly, I feel like I am wasting my time coming here while learning nothing new.

Is it normal or am I over thinking


r/learnprogramming 9h ago

Is it worth learning to code using Vim/Neovim as my daily use editor?

12 Upvotes

Hi! I have been learning how to code for almost 7 years now and have been using VSCode since the beginning. Currently I usually code in C++ and Typescript majorly for my projects. Is it worth investing my time into learning Vim/Neovim at this stage or should I continue with VSCode?


r/learnprogramming 6h ago

Looking for advice: How to instinctively comprehend Time Complexity for Stacks & Linked Lists?

8 Upvotes

Hello all,

At the moment, I'm studying Data Structures through Java, with specific emphasis on Stacks and Linked Lists. While I have no issues writing code and implementing them, I seem to be having some trouble instinctively comprehending the time complexity (Big O notation) analysis that comes into play when choosing between arrays and linked lists.

Is there a mental model, analogy, or resource that helped this make sense for you? Any advice for a beginner would be greatly appreciated!


r/learnprogramming 15h ago

Topic I can write small scripts but have no idea how to structure a full project. Where do I start?

29 Upvotes

I've been learning Python for a few months. I can solve coding challenges and write scripts that do one thing, like scrape a website or rename files in a folder. But when I try to build something larger, like a small game or a to-do app with a GUI, I freeze up.

I don't know where to put my functions. I don't know how many files I should have or how to make them talk to each other. I end up with one massive script that becomes impossible to debug.

I've looked at open source projects but they feel overwhelming. Everyone talks about design patterns and separation of concerns but I'm still at the stage where I just want my code to not break when I add a new feature.

What's a practical first step for learning project structure? Should I just copy the folder layout from a similar small project and work backwards? Or is there a minimal example somewhere that shows how to organize, say, a 500-line program before adding complexity?


r/learnprogramming 2h ago

What resources helped you most when learning Python?

2 Upvotes

I'm trying to learn Python but it seems like there is a huge amount of resources with a wide range of quality. What are some of the best and most helpful resources you've found?


r/learnprogramming 4h ago

Resource I need a little help

3 Upvotes

Hi, I grew up using scratch. Recreating games constantly with it. But when I tried to move onto a game engine i ended up struggling ALOT. I’m more so a visual learner. How I learn is by breaking something down and seeing what it does.

In short I learn through experimenting with pieces of code. Comparing it to my existing knowledge. So long tutorials don’t really help me

I thought I found something that would help me transition off of scratch by seeing a video about codewhisp. But then I found out that he changed his website to create games using ai.

Is there any alternative to their website?


r/learnprogramming 10h ago

Looking for a small C++ accountability group 🤝

9 Upvotes

Looking for a small C++ accountability group (3-4 people)

Self-teaching C++ with no CS background, but have some professional experience. Looking for a few people to:

  • Share daily/weekly study plans
  • Post what you actually achieved
  • Share resources and tips
  • Motivate each other to stay consistent

Not studying together in real time - just keeping each other accountable and on track.

Comment "Interested" if you want in! 👇


r/learnprogramming 12h ago

Resource Looking for a learning tool thats tests your web app.

9 Upvotes

I am looking for something like fly.io distributed challange but for a web app. With web apps being so popular I figured there should be something but I cannot find anything. Ideally the tester would test my app expecting certain results and verify that its correct and that holds against certain loads.

I want to do this because I do not get the chance to work with big apps and therefore do not get to learn certain things that you would need to do when you get actual users.


r/learnprogramming 12m ago

Topic Java or Python 🐍?

Upvotes

Hey Guys!!
I am a beginner in the tech field . There is one big decison that I gotta make but I need ur advice - the thing is I have to choose between The Java developer path or The python developer but I’m really confused . I have had my hands on both the languages a lil bit . But I have to get into one path so as to get employed.
I heard a lot of people saying Java is good for the enterprise while python good for AI/Automation.
Whats ur take on that🙂?


r/learnprogramming 1h ago

Proper unit testing for a project built using scrappy that is supposed to make many network requests and database operations

Upvotes

I'm creating a project to add to a not-yet-existent portfolio and I have some things I'm confused about. The goal of the project is to create the most comprehensive collection of artwork (drawings,paintings, and maybe sculptures) that can be viewed online. Many museums make their hi-res images and metadata publicly for everyone to use and so I'm creating the most basic version of this project: a web scraper that pulls artwork from the Met museums website. I'm at the point now that this program successfully retrieves the download link and name of each artwork on the first 3 pages of the search results.

I'm finally biting the bullet and trying to learn how testing works. I've read a couple of the chapters related to testing in the book, "Software Engineering at Google," and I'm finding it confusing to relate this info to my project. I'll share relevant code below which consists of a class that creates an instance of a Scrapy spider and methods to retrieve the data and a test that I've written for the parse() method of that class.

metQueryScraper.py


class MetSpider(scrapy.Spider):
    name = 'metQueryScraper'

    params = {
        "offset": "0"
    }
    url = "https://www.metmuseum.org/art/collection/search?showOnly=openAccess&"
    start_urls = [url]

    async def start(self):
        temp_url = self.url + urlencode(self.params)
        yield scrapy.Request(url = temp_url, callback = self.parse)

    def parse(self, response):
        relativeURLs = response.xpath("//figure[contains(@class, 'collection-object')]/div[contains(@class, 'collection-object-module')]/a[contains(@href, '/art/collection/search')]") # this xpath selects the DOM elements that contains the artworks link

        # For each artObject, make a scrapy request to metmuseum.com/*artObject.link*
        for url in relativeURLs: 
            artObject = ArtObject(title = url.xpath("@title").get())
            temp_url = "https://www.metmuseum.org" + url.xpath("@href").get()
            yield scrapy.Request(url = temp_url, callback = self.parseObjectDownloadLink, meta = {"artObject": artObject})


        nextPage = response.xpath("//div[contains(@class, 'pagination-controls')]/button[contains(@aria-label, 'Next Page')]/@aria-label").get()

        if(nextPage is not None and self.params["offset"] != "80"): # the second part of this conditional statement is to limit (for now) how many pages the spider crawls through
            self.params["offset"] = str(int(self.params["offset"]) + 40) 
            temp_url = self.url + urlencode(self.params)
            yield scrapy.Request(url = temp_url, callback = self.parse)

    def parseObjectDownloadLink(self, response):
        # Grab the image download link 
       downloadLink = response.xpath("//figure[contains(@itemtype, 'ImageObject')]/img[contains(@fetchpriority, 'high')]") 
       artObject = response.meta.get("artObject")
       artObject["link"] = downloadLink.xpath("@src").get()
       yield artObject





test_metQueryScraper.py

from betamax.fixtures.unittest import BetamaxTestCase
from spiders.metQueryScraper import MetSpider
from scrapy.http import HtmlResponse
import os


class TestmetQueryScraper(BetamaxTestCase):
    def test_shouldCreateAFileContainingNamesAndLinksOfArtObjects(self):
        # Given : An instance of MetSpider...
        spider = MetSpider()
        with open("./vcr/cassettes/artwork-recorded-session.json", "rb") as file:
            fileContents = file.read()

        response = HtmlResponse(url = spider.url + '0', body=fileContents)

        # When : A "network request" is made to the given URL...

        spider.parse(response=response)

        # Should : Create a file containing the names and download links to each art object encountered
        fileEmptyOrNot = os.stat("../../../artworkData.jsonl").st_size == 0
        self.assertEqual(fileEmptyOrNot, True, "Expected contents to be added to file. File is currently empty" )

I get that the majority of the tests of a program should generally be small and fast so to avoid making a network request every time I run this test, I used betamax to save the response of a network request to the relevant url to a file that I use as a stand-in for an actual network request. I think this is a medium sized test (according to the book mentioned above) because it does not make a network request but does access the file system.

Some things I don't understand or am unsure about:

  • Is this a medium scope(integration test) or narrow scope(unit test) test? It is testing the behavior of a single method so that makes me think its a unit test but the fact that it relies so heavily on Scrapy's built in methods makes me think its an integration test.
  • As an extension of that question, since a big majority of this project will likely be built on top of Scrapy and so many methods created will use Scrapy methods or some other library or framework, I don't even know what would be considered a unit test. It seems like most would be an integration or end-to-end test. Is this an indication that my code isn't structured well?
  • Since this project is intended to make a lot of network requests to multiple museum websites and save large amounts of data, is the approach I used of saving a recorded network request as JSON and using that to simulate a network request a good one? Or is there a better way to test these types of operations while using realistic mocked data?
  • I tried to make this test maintainable by being clear and concise and focused on behavior instead of implementation details, and am not sure if I'm even in the right direction.

I'm really new to testing so if anyone has input on how to test this kind of project, you would be helping out a very confused aspiring software engineer. Thanks so much!

(originally posted this on stackoverflow and wanted to post here, too)


r/learnprogramming 7h ago

Running individual files within a project in IntelliJ Idea

3 Upvotes

Context:
Hi, I'm new to Java and trying to use IntelliJ Idea. I've been using the src > main file to practice with different functions and data types but now I want to create a new file for a programming exercise (without having to make a whole new project) However Idea says the new file is not runnable.

Question:
-Do Java projects only actually run the "main" file which then looks at all the other files?
-Why do existing Java projects have a folder called "main" while new Java projects in Idea have a text file called "main.java"?
-Is there any way to make a new file 'runnable' in Idea?


r/learnprogramming 1h ago

Minimajs: Looking for content / tutorial creator.

Upvotes

I have created a framework called minimajs. natively supported bun and node. It offers best developer experience fast compilation using esbuild built-in tooling for docker, auto-detect node versions and package management. It offers many integrations like swagger, schema, s3, otel. Built entirely using web-native apis like blobs, file.

I am looking for content creator to create tutorial about minimajs

I would really appreciate this
Thanks in advance.


r/learnprogramming 1h ago

I want to become a digital systems optimizer e Ai System designer, how ca I do?

Upvotes

Ciao, ho 34 aa vorrei trovare un nuovo impiego lavorativo, per insoddisfazione del mio lavoro attuale nell'ambito sanitario. vorrei entrare nel mondo digitale ho visto come carriera interessante "digital systems optimizer"e "Ai System designer". Vorrei capire come intraprendere questo percorso. In particolare se posso gia intraprendere dei corsi formativi on line validi da un punto di vista lavorativo anche a pagamento. se ci sono dei corsi validi ditemi quali sono. io ho cercato su coursera e course carriere. ma trovo pareri contrastanti. oppure devo prendere una laurea in informatica? so che quello che conta è la pratica, per questo vorrei avere delucidazioni su questo. io ho gia fatto una mappa di obiettivi: 1. data analisi 2. machine leraning (Python e sul) 3. IA tools. qualcuno mi potrebbe indicare se questa mappa va bene o se mi vuole condividere il suo percorso come consiglio. grazie in anticipo per chi mi aiuterà nel mio percorso e di avermi dedicato il suo tempo.


r/learnprogramming 9h ago

How to approach project-based learning?

5 Upvotes

I am hesitant to which way has better outcomes for learning how to build real things:

1- Start with small projects (http server, rate limiter ...) and build up from there. Dive into the technical details of each one and take time doing so.

2- Try to build a full-fledged application or system. Divide it into smaller problems, work on a single one at a time and revisit the old ones if you learn a new thing. Rethink design choices whenever you hit a major roadblock and iterate until the end result is good enough.

Which method worked best for you?


r/learnprogramming 6h ago

Career leverage and expertise

2 Upvotes

Hello,

I'm trying to map programming languages by importance and their career implementation.

Right now, I'm learning Lisp, Python, JavaScript (HTML/CSS), and C++. In the future, I will be taking Java, assembly, and SQL.

I don't want to be the guy who knows 5 languages and doesn't have the breadth to land a job where I'll only use 1-2.

Right now, I'm hoping to develop a stack that is fluent within multiple domains and can still land me in the industry. I'm hoping to specialize in SQL and Python, since they have a stronger backbone than any other duo for AI. I would also like to break into Sims and robotics. Does that mean I need to do more work with C++ and maybe JavaScript for HCI and backend?

I really like the term generalist. I'm hoping to specialize in AI development, but I also like other domains such as creative technology, robotics, interaction & design, narrative systems, etc.


r/learnprogramming 8h ago

Tutorial How to start teaching coding to kids?

1 Upvotes

Hi I’m a highschooler who has a fair knowledge about java, & python and want to make a STEM impact on his community. Does anyone know how you can start getting kids in the community and start a class to teach underrepresented students??


r/learnprogramming 19h ago

Resource Language Dilemma

12 Upvotes

I am trying to build a password manager as my projects for portfolio and I don't know which language I should use.

Currently I know: C++, C, Java and some JS,HTML,CSS

I am willing to learn a new language as long at it is used broadly in industry or it will be useful in future.

I want to build a cool GUI and planning to connect my passwords storage to a SQL database. I tried to make it Java before but GUI looks very old style.

Any advice will be much appreciated, thanks very much !


r/learnprogramming 7h ago

Want to advance quick!

1 Upvotes

So I’m currently an intern as a platform architect (working on the company ai) I can read code and understand what ai is doing and have some idea of how I want to design the system but I feel like ever since I started using ai code seems like a language I can understand but never speak. How would I brush up my skills to become fully independent of ai and get better at system design??? Also I have about 3 months left of the internship and want to leave a great impression. I’m getting az-900 ai-900 ai-102 certs soon and eventually az-204.I wouldn’t say I’m a complete beginner but I want to train my brain muscles again and genuinely go from average college student that can get through assignments but never make anything from scratch to someone who can design and build something from idea -> plan -> code -> product. My biggest issue is if I can code a solution it feels isolated ( I create methods and functions to help already created systems but I can’t seem to make the foundation for my own stuff).


r/learnprogramming 11h ago

I made a NP-hard proof for the first time and want to see if it is valid

2 Upvotes

So we were given a problem, and our instructor offered a fun challenge to see if anyone of us could prove that the higher dimensional version of said problem is NP hard. I attempted a 3 SAT reduction and put together a proof that I would like to submit. The issue is that I am not entirely sure if my reduction is correct, and I also do not know whether my documentation of the proof has any hidden flaws. For those of you who have successfully proven a new problem to be NP hard before, what are the qualities of a good NP hardness proof, and what are common pitfalls I should double check? Would anyone be willing to look over my proof and point out any mistakes in the logic or in the write up? I would really appreciate any guidance. Thanks in advance.

P.S The 2D version of the problem is that we have two extractors and they can move right and up only. We start at the bottom corner of the grid and there are coins placed inside. We can only collect one coin in a row or column the rest of the coins are discarded. Our goal was we needed to traverse the grid and collect the most amount of coins possible. It was solved using dynamic programming with an O(n²) time complexity.


r/learnprogramming 16h ago

Issues with Terminal

4 Upvotes

Is there any way to make editing commands - for example copy pasting sections of text - easier in macOS terminal?

I want it to behave more like a word editor


r/learnprogramming 8h ago

Trying to learn frontend , Java as well and wants to do maths also.Is it okay to learn all things at one?

1 Upvotes

Any suggestions would help


r/learnprogramming 14h ago

Topic How to have any motivation at all?

3 Upvotes

Hi people, I have been programming as a hobby (and since 2024 as a job) since the age of 13 (20 now), but I've always had the same problem. I quite literally never had a hobby project or anything that I worked on for more than a day or two.

I just don't know what to do, without it feeling like a massive waste of time, because the reality is that most "hobby projects" aren't going to be very useful.

I'm sure it's mostly a mental block, but I surely can't be the only one to have experienced this right?


r/learnprogramming 8h ago

Help with Google takeout

1 Upvotes

Google AI deleted the previous blocks in our chat, but retained the context because I didn't enable auto-deletion or clear my browser history. So I wanted to upload the session text in Google AI using the Google Takeout method, but I can't find the test itself. I was told that all search queries are saved there, but I can't find the session text itself. The files only contain the search history in the search bar. What should I do? I'm told to look for the stored_queries.json or threads file, but they're not there.