r/learnprogramming Mar 26 '17

New? READ ME FIRST!

831 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 6d ago

What have you been working on recently? [December 21, 2024]

2 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 1h ago

Should I start with GUI or Code Logic?

Upvotes

I am planning to make my first executable since I am getting sick of just writing scripts. The plan is to use mySQL for the db, python for code logic, and pyqt6 for the gui. So my question is as the title says, which would be best to start out with or does it even matter and its only preference?


r/learnprogramming 10h ago

Should i learn assembly?

20 Upvotes

I have a strong background in JavaScript and Python, and I am somewhat familiar with Java and C#. However, these are all high-level languages. Should I consider learning assembly language? Since it's you and the machine, what do you think?


r/learnprogramming 6h ago

Can Godot eventually make it to being on-par with Unreal or Unity in terms of features?

8 Upvotes

I'm looking to start learning SFML and Unreal (I already know C++ from college), but I'm currently studying Go and I'm beginning to really like it. (edit: I only learned from the comments below that Godot uses GDScript and not Go. My bad, haha (someone here in reddit mentioned Go being a modern language and then also suggested I should try Godot, so I wrongly assumed they're the same language.))

In any case, I'm tired of C/C++ and I've been trying out something new like Go, Hyperscript, Kotlin... it seems GDScript also falls into that list. :)

I'm just worried Godot might go in the way of Rust game engines– how its development seems to have stalled because Rust itself apparently has innate barriers when used with game development as mentioned somewhere here in reddit.

So yeah, I don't know enough yet to make this decision. Can Godot eventually be as full featured as Unity and Unreal? Or is GDScript just too limited and therefore will never get there?


r/learnprogramming 4h ago

How do I keep a Python program running indefinitely?

7 Upvotes

So I'm fairly new to coding and I have a Python twitter bot program that I manually run once a day, but I want it to run itself once a day. But when I leave it to run itself with a timed loop it usually stops after my computer sleeps. I'm not really sure how to keep it running indefinitely and I cant find what I'm looking for online either. I use a Mac and I don't want the computer to stay awake 24/7 just for a bot, so what can I do? Is there a way to keep the terminal running even when my computer sleeps? I might be reaching here but I have the code, I just don't know how to keep it running.


r/learnprogramming 48m ago

Question about Files.lines() with try-with-resources in Java

Upvotes

I'm doing the Helsinki MOOC for Java and they've introduced using Files.lines() to get a stream to read the lines of a file. In the course they're doing stuff like this:

try {
    // reading the "presidents.txt" file line by line
    Files.lines(Paths.get("presidents.txt"))
        // splitting the row into parts on the ";" character
        .map(row -> row.split(";"))
        // deleting the split rows that have less than two parts (we want the rows to always contain both the name and the birth year)
        .filter(parts -> parts.length >= 2)
        // creating persons from the parts
        .map(parts -> new Person(parts[0], Integer.valueOf(parts[1])))
        // and finally add the persons to the list
        .forEach(person -> presidents.add(person));
} catch (Exception e) {
    System.out.println("Error: " + e.getMessage());
}

But when I'm reading the documentation it seems that it should be used with a try-with-resources so that the stream auto closes at the end of the operation and doesn't leak resources. I can't figure out another way to close the stream explicitly and the course doesn't seem to do it... at least with what I've encountered. Would it be better to do something like:

    try (Stream<String> stream = Files.lines(Paths.get(file))) {
       stream
           .streamThings()
           .moreStreamThings();
    } catch (Exception e) {
        System.out.println("There has been a problem reading the file");
    }

to ensure it gets closed? Or is the basic try/catch block going to do the same thing?


r/learnprogramming 5h ago

Paid Courses Actually good paid courses for FullStack/Backend?

5 Upvotes

Hi all,
I'm looking to pickup Java/Spring for FullStack Backend Development, as I want to break into a bigger company that utilizes fullstack technology. Any good courses for picking up FullStack/Backend out there that people can put their word behind?

I know a lot of people here say "go use X free resource!!" or "read the official docs!", but I'll be honest. I want some structure and I don't mind paying a bit more for someone to have the important things to learn already laid out in an order that makes sense. Plus the psychological aspect of knowing I'm paying for educational resources will likely drive to me make use of them and stick with it.

I already have a Computer Engineering degree, so beyond basics would be appreciated. Thanks!


r/learnprogramming 9h ago

What would be your roadmap if you start programming now?

9 Upvotes

I am not a beginner in programming I have done html & css when I started college and c/c++ in my second year and JavaScript in my third year but I wasn't consistent in programming.

Also I didn't solve too many questions I just watch 100's of tutorials and make notes. And solve questions for every topic.

When I try to build projects. I am unable to make it and get too overwhelmed.

Then after college I have pressure to do some work so I leave coding and try to start my ecommerce business but due to lack of money I quit my business.

Now i want to start programming again after almost one year. but from last two months I am unable make any progress. Whenever I try to solve any problem I become very anxious.

I don't know what should I do? Where should I start? should I do DSA to make my problem solving skills better. But that give me more anxiety. or I should do something else.


r/learnprogramming 5h ago

how to stay focus?

2 Upvotes

how do you guys keep focusing, programming is the first thing to learn for me that use laptop and pc. i found it to be very easily distracted. like i tried to found tutorial, but in the middle of it i cant help to open browser tab and browsing internet for hours.

how do you guys managed to keep focus and get the study done?


r/learnprogramming 7h ago

Topic Need help

6 Upvotes

Hey there, I m a cse student but i am unable to make logic . I use to get a lot of issues. I can't think like others do . When i solve easy level problem only 30-40% time i am abled to solve the problems for rest of the time i use to think and think and think but what i get is disappointment. I use to solve the 90% part of the questions but not fully . And i can't say about medium level problem.

I have done array string recursion And i m currently learning but the thing is even though i had done array and strings multiple times . Yet i can't make logics . I am so scared about my future. (4th sem student). Pllz help me


r/learnprogramming 5h ago

My first web app

3 Upvotes

Hello recently I finished building my first ever webapp. I delecoped a front end and a backend with a database. As of now I only tested it locally on my computer. I would like to buy a hosting service on azure for example which has a student 100$ credit. When I try to get a resource I get stuck on the database choice. I built the backend in c# and Sql server but at the moment of choosing the correct database there is not an option for sql server but there is azure sal, postgre and MySQL. What can I do?


r/learnprogramming 6h ago

Am I Remotely Qualified to Call Myself a Software Dev/Programmer?

4 Upvotes

Hi everyone, my question is mainly towards professional software devs/programmers. I am 30, have never worked in professional IT and would like to gauge my programming proficiency. I want to know if I am even remotely qualified for a junior programming job - whether it is a career option open to me.

To give you some background, I have always been very tech-savvy but mainly in the hardware department, like DIY-build a desktop and fixing computers/Windows issues, but I have never studied programming or Computer Science - hence nothing fit for the latest IT job market boom.
For university, I hold a Master in Astrophysics. I self-learnt Python many years ago, but did not have any real experience until my Master thesis in 2020. Most notably, I improved on the 3D stellar orbit fitting code that my research group already was using, I reverse-engineered it to do the opposite - to extrapolate positions based on an orbit. I also wrote a bunch of utility/automation scripts for personal use - like plotting overview charts with labels, timelines showing 50-observations...etc.

As you can already see, I was nowhere near the "professional" league, nor could any of these use cases be translated to IT experience. At the time, ChatGPT didn't exist, so I did not learn how to write "clean codes", or the most efficient ways to write something. Whatever I wrote, was based on a lot of google, stack-overflow and editing.
In the last 3 years, I worked as an Engineer without touching programming. I knew I wouldn't get hired in IT field anyway, as I never attended any bootcamps or had any certificates, and my tech "stack" is only Python, which seems to be very rare among job postings?

...Until now. Since last month, I have been working (completely solo, no support) to develop a real-time noise monitoring program in a small company, which polls data from sound meters every second, upload and store it in a SQL-database, then can be access through a website. Since I am the only person in the company who can program, this ambitious project/idea was therefore assigned to me.

As an ex-scientist, I meticulously research and plan things first. I had zero experience with SQL and HTML/CSS/JS which I found that I had to use. I figured things out (alone) every step of the way, with ChatGPT/Google/Stack Overflow/Reddit for help. Mainly I rely on ChatGPT to do the heavylifting and ask to explain new syntax/concepts.

I have been making great progress on the project and learnt much more than I could have ever imagined.

I am a very precise and inquisitive person - I am specific and meticulous with my prompts, so I almost always get GPT to do exactly what I want.
I read every line of the code it gives me, as I take it as a learning opportunity/exercise - I make comments on almost every line/loop/if statement in the codes/functions to help me keep track of the logic flow and how to write something.
I also ask a lot of follow-up questions to GPT about new syntaxes, concepts and their limitations - I test every function, every possible exceptions/scenarios that I can come up with, debug the codes myself and fix bugs/mistakes ChatGPT made (GPT has made quite a number of bugs/stupid mistakes so far).

However, I cannot help but feel that I am not a "real programmer" because 90%+ of my code was written by ChatGPT.

One of my programs has almost 1000 lines of code so far, all the logics/syntaxes used are basic enough that I can fully understand. However, for a piece of code that GPT can give me in 15 minutes, it would have easily taken me 1 week to write from scratch and debug, and I could never write it as robust and concise.

Maybe it's a delusion, but I always have the impression that professional programmers can write codes with fluency like speaking English? After all it is what they do for a living, 8 hours a day. If professional programmers are native English speakers, I would be one who still struggles with the tenses, pronounces and prepositions.
Moreover, all the job postings I have seen require a diversed tech stack such as C, C++, JS...etc. I can't help but feel that I will immediately fail any code-test in an interview.

In addition, I feel that all the things I am learning right now are so basic, they are just exercises to people who took Computer Science in their Bachelors.

By my standards, so far I have not done any "real" software engineering. I am a physicist/architect who tell an engineer to build something I designed. I may be able to come up with the plans/requirements, draw some blueprints, supervise, test, debug and fix any bugs; but I did not really build anything. At best I am a...test engineer? code-debugger?

All this being said, I have no plans to switch to the IT field currently, but I want to know if I am selling myself short. I feel that I have no chance competing with CS grads with rigorous training on the job market, but somehow I am able to miraculously develop a piece of software from scratch without prior education and senior's support, and somehow, it just works. That should count for something?
So, do you think I am remotely qualified to call myself a junior software dev/programmer?


r/learnprogramming 1m ago

How do i get better in programming exactly?

Upvotes

I mean the question is above, but what i mean is:

I am making little projects from time to time, but not 24/7. Like in 2 weeks i do a little thing here or there, then i cant achive the stuff i wanna do in the game and i drop it. And i do this since 3 years. So you might say "just do it 24/7 and you get better, stop taking these breaks between it and droping the stuff". Thats correct, but how do i improve excatly?

I look tutorials and guides, build it like in the video. I try to understand the code, but cant understand it and am instantly lost when i try to do something on my own. How do i learn Godot, Unity, Unreal Engine, C#, C++ etc. when i dont understand it?

I mean you could just say "just drop it and do something else" but i always dreamt about programming my own game. Doesnt matter how little. But even Pong took me a few days in Unity.

Do you guys have any tipps how to actually improve? Or how did you learn it? Because i am lost at this point.

Thanks in advance.


r/learnprogramming 45m ago

How to correctly set up logging in AWS Lambda

Upvotes

Hello,

I am currently struggling to set up some basic logging in AWS Lambda. I have a function created from a container image where the main.py file looks like this:

import os

def lambda_handler(event, context):
    log_file = "/tmp/application.log"
    
    if os.path.exists(log_file):
        with open(log_file, "r") as f:
            file = f.read()
    else:
        file = "File does not exist"
    return {
        "statusCode": 200,
        "body": file
    }

The logging configuration is created in another file, logging_config.py:

import logging

LOG_FILE = "/tmp/application.log"

logging.basicConfig(
    level=logging.INFO,
    format="%(asctime)s - %(levelname)s - %(message)s",
    handlers=[
        logging.FileHandler(LOG_FILE),
        logging.StreamHandler(),
    ]
)

logger = logging.getLogger("my-logger")

The logger variable is then imported into other modules that should log on various levels (info, debug, error). However, I am not able to see the logs anywhere, nor do they get redirected to the /tmp/application.log file. When the function finishes executing, it returns:

{
  "statusCode": 200,
  "body": ""
}

So I am assuming that the log file gets created because the body is empty, but not populated with anything.
What I am missing? Thanks.


r/learnprogramming 49m ago

Trying to learn the most I can in my free time. Should I only stick to fcc or should I pay codeacademy too?

Upvotes

I've been learning to code for sometime and after I finished HTML and CSS I started javascript and everything is fine but I feel like fcc isnt good in explaing very well Javascript.

But if I get into CodeAcademy it doesnt tell you where to start like fcc does. Should I pay it? I'm loving code and the frustration it brings me. I want to learn the most I can


r/learnprogramming 11h ago

were do i put my script

5 Upvotes

I am currently a beginner at programming. I wouldn't say I am completely new to computers. But I was wondering where I should write my code or script, and I don't know what Visual Studio and Visual Studio Code are or software like that. I am currently really confused about what to do since I just started programming. Currently, I am learning cybersecurity and some basic stuff like Linux fundamentals, but right now I am trying to learn how to script with C#. I am currently trying to learn how to create cybersecurity software.


r/learnprogramming 8h ago

Tutorial Time complexity of Dijkstra's algorithm when using arrays?

4 Upvotes

How to calculate the time complexity of Dijkstra's algorithm if it is implemented using arrays as data structure?


r/learnprogramming 1h ago

Dumb question about pyqt

Upvotes

When people say it's paid, it means that I can't make a profit with it unless I pay some licensez righ? So if I create a small software for personal use and/or to share with friends, I'm all good?


r/learnprogramming 1h ago

Encrypt password in bat

Upvotes

I have a bat file which sets a username and password for a service.

sc.exe config "myService" obj= "MYDOMAIN\myuser" password= "redacted"

Is it possible to encrypt the password?


r/learnprogramming 2h ago

game launcher

0 Upvotes

hello i want to make a launcher for a game i am making but the only tutorial i found is 4/5 years old and it gives me a error when it extracts the zip file, is there a different/better tutorial or if someone can give me a hint on where to go or look would be greatly appreciated

edit:

apologise, i forgot the import part due to frustration, i am using c# WPF app (.net), the tutorial i was using is this one https://www.youtube.com/watch?v=JIjZQo03YdA&t=616s, i would love it if it is possible to be pointed to ether a better tutorial or some links for me to read through so that i can try to make a game launcher


r/learnprogramming 9h ago

how legacy is .net framework? still worth learning?

2 Upvotes

I took on a freelance project. i was told that its "C#, asp.net", didnt ask any further and signed the NDA

once i open i found out it looks strange and then i realise its .net framework classic not .net core.

I cant even use vscode or cursor for it, i must use visual studio because the only server that supports is IIS.

is this stack too legacy to be worth the hassle to learn it?


r/learnprogramming 3h ago

What to do after doing Angela U web development course?

1 Upvotes

I am system engineer in TCS and i have been working here for 3 years now. I am in a data center operations team where my daily BAU is to just validate the service requests that land in our queue like server scaling, disk scaling etc. The work is very minial and there is nothing to learn. So last year, I started Angela U web development course because i was clueless and senior around me were as clueless as me so there was no guidence but u cant complain abt that. In college, I made very mundane projects like first project was using only core java and then i just got in a group where we managed to get a project made in android and learned a few things about android development. At present, I have no clue whatsoever about these technologies.

In first year of TCS, i was working from home so tried my hands on DS but could not keepup with it and eventually gave up. Then as we were handling linux servers so decided to learn linux bcoz i had no clue of linux as i did nt study much in the last year of my college(courtsey : online exams). So learned about linux OS but did nt practice much.

Then I finally went on to learn web dev from scratch and now i have almost completed the angela U web dev course.

React part is quite outdated of that course which i got to know from the reviews posted. Plese suggest what topics should I cover in React other than covered in course.

I hope someone who had already done angela u web dev course can tell what should be done completing that in order to gain confidence.

Can anybody working as a web developer in MNCs guide me like how to approach things now

which projects should i make by myself

when should I be confident enough to apply for web developer in other companies and how difficult it is going to be as i am trying to swiych from support to development roles?

I am feeling a bit lost right now and i also don't want to fall in tutotrial loop hell.


r/learnprogramming 4h ago

How do you learn to do specific tasks?

0 Upvotes

As in making a certain of game, like me at them moment.

I've found a great tutorial by Clear Code on how to make a baseplate rpg game. But then I was wondering, am I really learning anything, or am I simply copying tricking myself into thinking I am learning. How would approach making big projects? How do you which parts go into making it?


r/learnprogramming 1d ago

After learning Python and Javascript I am ready for a low level language, preferably the one with the most demand. Please suggest, C++ or Rust? TiA

41 Upvotes

I appreciate your time.


r/learnprogramming 8h ago

I'd like to learn how to achive what the picture's software is doing..

2 Upvotes

https://imgur.com/a/daZppGt

I do know about Python and I've already forked some public repositories with AI recognition projects.

I've never learnt about how to track the movement from a human of a region of the video.

Also recognize someome like they did on the video (adding a name tag).

And also counting time of a certain object present in the video (like thet did with the customers).

I'd like to learn how can I create my own program like the one of the video.

Any kind of help is accepted :)


r/learnprogramming 1d ago

Looking for a programming buddy to smash 2025

189 Upvotes

I am looking for a programming buddy who wants to utilize 2025 with consistency and kill off procrastination. I am a 2025 B.Tech CSE under grad, currently pursuing SDE internship at a good MNC. I want to deepen my DSA knowledge by learning from new sources and daily practice and weekly contests on leetcode, codeforces. Also I want to work on development part by making impactful projects and strengthen my resume. We smashin 2025. Lemme know if you are interested.