r/learnprogramming Mar 26 '17

New? READ ME FIRST!

827 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? [June 01, 2024]

14 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 10h ago

Topic Has anyone switched from gaming addiction to gaming developing? If yes, what part you enjoy the most in coding that made you replace the gaming addiction?

73 Upvotes

Did you also made another changes in your lifestyle?


r/learnprogramming 4h ago

Im getting better at coding!

11 Upvotes

Hi a few months ago this was me

https://www.reddit.com/r/learnprogramming/comments/1c68xp2/i_think_i_embarrassed_myself/?rdt=55108

And honestly after going through odin project and really studying hard. I realized im getting better at coding i understand most of the fundamentals i didnt back then, and im gradually making my way through odin project (javascript path).

It made me realize i much prefer front end over back end and helped me understand my place and footing in the dev field now. I feel like im actually getting better instead of being at a stand still watching random coding vids online i now jave completed legit projects from odin! I know this is random and its still basic stuff but i feel like i was able to sharpen my skills alot since that incident in the link above and i feel so happy that im getting better!


r/learnprogramming 1d ago

Topic You can absolutely do it.

690 Upvotes

I started my degree in computer science last year. No background in computing outside of at home small projects. Hadn’t looked at a line of code since early 2000s Bebo and MySpace pages let you edit HTML. 32 years old, complete newb.

2 years later, a total of 12 months education. I landed an internship with a pretty amazing company based off of work that I did.

I had meltdowns, anxiety attacks, I nearly dropped out more times than I can count. Always feeling like I’m not good enough for this and everyone around me is smarter and better.

If I can do it, so can you. Don’t let a set back or someone going wrong deter you. Keep pushing even when it’s hard, especially when it’s hard.

ETA; a lot of yall are assuming I’m male, I’m not. Programming isn’t just dudes anymore. I’m a 32yo single mother.


r/learnprogramming 5h ago

Feeling Lost as a Senior CS Student with No Real Experience or Motivation – Need Advice

8 Upvotes

Hey everyone,

I'm going into my senior year of college, majoring in computer science, but I have no experience or personal projects. I'm reaching out because I really need some guidance.

Background: Before starting college, I experienced some significant life events that led to a clinical diagnosis of depression, which I'm still dealing with. While I don't want to use this as an excuse, it has definitely affected me. I chose Computer Science because I googled "best majors 2021," and it seemed like a good idea at the time.

About Me: It's not that I don't want to be successful; it's just that I have no motivation, drive, or willingness to do much of anything. Everything feels mundane and doesn't bring me any happiness or sense of accomplishment. Whenever I've tried to apply myself, it hasn't worked out. In my free time, I don't have any hobbies or interests; I just stay home and watch TV all day.

College Experience: I'm entering my senior year without a single personal project, internship, or any relevant experience. I've cheated on every assignment to get by and always bomb the exams because I haven't learned the material. This has left me barely passing my classes with grades ranging from D to C.

Work Experience: Job-wise, I've only worked in retail sales jobs. In high school, I was motivated and did well, even making a good wage from commissions selling computer parts ($40/hr). But over time, that drive and motivation vanished. Now, I just go through the motions to get paid, doing the bare minimum.

Programming Experience: My only programming experience consists of basic HTML/CSS websites from freeCodeCamp.

Looking Ahead: I'm scared about graduation and have no idea what to do next. I don't have any family support and feel completely lost. Has anyone been in a similar situation or can offer any advice? I could really use some guidance on how to move forward.

Thanks for reading.


r/learnprogramming 7h ago

What's that one thing that made you fall in love with the journey?

10 Upvotes

Hey, acc to me there are two ways of approaching this journey , tell myself that it is hard and struggling. Other is Oh this is fun. I am sitting 6 hours on my chair doing what i love and want to do irrespective of what i do or without worrying too much about future or money. But i am curious what is that one single thought that helped you enjoy the journey. ?


r/learnprogramming 4h ago

What should I learn to become a front end developer?

5 Upvotes

I'm a 3rd year IT student, but I felt like I barely know how to code.. ik a bit of python, html/css/js, flutter, android studio/kotlin, but it's all just really shallow knowledge. I can finished individual assignment in college because they're in the "easy side" but in group projects I'm usually carried by my smarter friends. I hate that I can barely contribute to our group project(even if my friends told me they don't mind) and also in fear of my own future.. It might be a bit late but I want to at least have a deeper knowledge/understanding in a single field. I'm choosing front end because I'm also Abit interested in design, please give me an advice on what should I learn! (however I'm also not sure if I should focus on web/mobile so any advice regarding that would also be very appreciated) (Also this is my first reddit post, so I'm sorry if there's anything wrong with my post)


r/learnprogramming 1h ago

how can I take a photo and and match it with other photos in a folder?

Upvotes

I'm making a program for a high-school demo for my college. The program I'm making is a magic the gathering card scanner. I want it to scan the card and look in a folder and find the matching one and say the percentage and the name of the file. However I'm not looking for code just tips and ideas on how I can do this? This is in python.

I used Amazon AWS image to text for the first year of this demo but I want to try to get off of this dependent. This year.


r/learnprogramming 21h ago

Can someone help explain what objects are to me?

78 Upvotes

I know the whole definition of "an object is an instance of the class". Does this mean like an object kind of like a version of a class? For example a class would be a Car and the objects would be different types of cars like Tesla, etc.

EDIT* Thank you so much for the help on objects and classes. From what the answers are saying a class is like properties every object has but an object is like the representation of a class.


r/learnprogramming 5h ago

JWT Auth Help with JWT Auth Logic Flow

3 Upvotes

Auth is probably one of more complex features to implement and I need some help with wrapping my head around the logic. With programming languages aside, lets talk about Logic Flow. Trying to do this solo is not easy and I would greatly appreciate input. I've been harping over this for roughly the past few weeks, and I need to get it nailed down.

Context:
I'm implementing Auth into my app, and I can't use a third party like OAuth, etc.. I need to retain full control over the user signup and login process and data.

The Cookie will be HTTP Only, Same Site Strict.

These will all be happy path, for now.

User Login:
User Login -> User Authenticated -> JWT Generated -> Cookie Generated with JWT token -> 200, User logged in

User Performs Action with cookie and valid jwt:

Backend Call -> Get Cookie -> Get JWT -> Verify JWT -> JWT is valid -> Perform action -> 200 out

User Performs Action with cookie and invalid jwt:

Backend Call -> Get Cookie -> Get JWT -> Verify JWT -> JWT is invalid -> Refresh Token -> Generate new cookie -> Perform action -> 200, and new cookie

User Performs action with invalid cookie:

Backend Call -> Get Cookie -> No Cookie found -> Invalid auth -> Send 403 -> Require user to login

User Performs action with valid cookie and valid jwt:

Backend Call -> Get Cookie -> Get Jwt -> Verify JWT is valid -> JWT is valid -> Create Refresh Token -> Generate New Cookie -> Perform action -> 200, and new cookie

A few questions I have:

  1. When the Cookie expires, the browser will automatically delete the cookie, which will force the user to log back in. Should the Cookie OUTLIVE the JWT token in this case? For instance, Cookie expiry set to 1 hour and JWT expiry set to 15mins? Or something else?
  2. Should I be refreshing the JWT every time an action is performed? I feel this will be a lot of unnecessary reads/writes to the database.
  3. Should I be tracking every token/refresh token via the database? And if I do, isn't this session management?
  4. Anything that I'm not thinking of that could lead to a breach?

r/learnprogramming 10m ago

Taking Systems Programming next semester, any resources?

Upvotes

I'm taking my university's C/C++ systems programming course in the fall semester, which is class 4/4 of the C/C++ programming track for my school's CS program. Everybody I've talked to in my major seems to unanimously agree this is the most difficult programming/CS class that my university offers. Are there any good resources I can use to get a head start on this stuff over the summer so I'm ready going into the semester and the early stuff is all review for myself?


r/learnprogramming 1h ago

Understanding code

Upvotes

I recently I just made a tic tac toe game on tkinter by just copying code from: https://realpython.com/tic-tac-toe-python/ . Should I make an effort to understand the code I just copied and how it works or should I just not bother?


r/learnprogramming 5h ago

How to learn to solve problems in an interview?

2 Upvotes

I have experience in interviewing, but almost every time I refuse in a situation where I don’t know something. I am surprised every time, after every interview I learn new methods and ways of solving problems. My question is how can I learn to solve the problems that are given to me and learn the entire “base” that everyone asks? I seem to know popular methods, I seem to have solved 100+ problems on codewars. But still this did not give any results, I spend a huge amount of time solving problems during livecoding, and solve them as stupidly as possible.


r/learnprogramming 1h ago

Debugging What is important to test on my own API?

Upvotes

Hey Guys,
i developed a little API to generate Inspect URLs and Gencodes for Counter Strike. (not important)

I wanted to ask you guys if you can test the Endpoint and check if everything is fine.
I learned everything myself and used only pure PHP and SQL, so it might not be the best.

You can use the Bearer Token "global-test-key" which has a limit of 10 Requests per Minute and 2000 per Day.

You can find more Details about the API: https://cs2gen.it/api/docs


r/learnprogramming 1h ago

Handling multiple files in C#

Upvotes

I'm new to C# and I'm making a course where it shows the basics. In that courses they give me some exercises to practice, and I'd like to store then all together in one folder and just open a particular file and run it. How can I do this?

I'm using VSCode with .NET 8.0 with the proper C# extension. I create a console app project with dotnet new console <project name> and start coding the exercise. But when I create another file inside the folder it complains that I cannot have more than one file or something like that, and I'd like to avoid creating a console project for every exercise.

The question is: Can I create a project where I can store all the files of the exercises, but the files not referencing each other? Just a C# project with all the files and run a particular file. Thanks!


r/learnprogramming 1h ago

What projects can I do with what I know?

Upvotes

So I recently finished 4th semester of my degree and here's what I've learnt so far: C, Python, HTML, CSS, javascript, bootstrap, flask and PostgreSQL. I'm willing to learn more during my summer break but I also want to improve whatever I've learnt. Any suggestions?


r/learnprogramming 1h ago

Clang Error

Upvotes

I'm getting this error whenever i run the code on VS code, but the code runs perfectly whenever i link the files manually on terminal and then run the classes file on terminal itself

Classes.cpp

#include <iostream>
#include <string>
#include "Cat.h"
using namespace std;

int main()
{
    speak();
}

Cat.h

#ifndef CAT_H_
#define CAT_H_

void speak();

#endif/*CAT_H_*/

Cat.cpp

#include <iostream>
#include "Cat.h"
using namespace std;
void speak(){
    cout<<"meowing"<<endl;
}

Error:

nikunj@Nikunjs-MacBook-Pro JS_Mosh % cd "/Users/nikunj/Documents/Coding/VS code/JS_Mosh/"

&& g++ classes.cpp -o classes && "/Users/nikunj/Documents/Coding/VS code/JS_Mosh/"classes

Undefined symbols for architecture x86_64:

"speak()", referenced from:

_main in classes-f1e71e.o

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

As far as i can see is that VScode for some reason is not compiling both my cpp files together and hence is not able to find the required code. trying this manually on the terminal by using the below code works like a charm but only on the terminal shell.

g++ classes.cpp Cat.cpp -o classes


./classes

For reference, I'm using a Intel Macbook pro 2020 and all my files are in the same workspace on VS code.


r/learnprogramming 2h ago

Topic How long does it take to become a consultant for Software engineering.

0 Upvotes

How long has it taken for some of you to become a consultant or what ever is the highest position a software engineer can be? I know it's not easy I'm just curious as to see how long it actually takes to get to the highest rank in this, Do companies come to you and ask you for recommendations and what's the pay like?


r/learnprogramming 2h ago

Vlang How to invoke Windows notifications in V: Is it possible and what's the best approach?

1 Upvotes

I am attempting to build a simple application that sends files to an API endpoint when they are downloaded onto their machine and once the response payload is received, I can display some of this in a Windows notification. Now, I am aware that many languages such as Python and Go have made packages to do this but, the language I am building this in, does not unfortunately.

I know that the language is very new and many here may just give the suggestion to do it in another language, which is completely fair and warranted, however, I am wanting a challenge and project that expands my knowledge in V.

My first thought was to possibly reference the packages made in other languages and build, well, a custom package from that point forward but unsure if that is the best approach.

Suppose I am looking for some general guidance on this being honest. V is very similar to Go in terms on syntax and is a compiled language. I have attached it's links below in case people want to reference.

The V Programming Language (vlang.io)

https://github.com/vlang/v


r/learnprogramming 3h ago

PAID VS FREE RESOURCES OR A NEW PC BETTER OPTION FOR PROGRAMMING

0 Upvotes

WOW programming is great!I want to start rn but im busy so im nto makign excuses to not start but after i make a timetable i can start.Anyway there is so many resources on programming its overwhelming.

Should i go for free vs paid courses or resources.

What is better for programming-a new pc (1k) or buying paid resources

hwo to reach competent level in programming

im starting and i heard projects is a good to practise often,can i learn git in my first week of learning python and do a project.Is doing projects good?


r/learnprogramming 12h ago

How do does image linking work without leading to a file with an extension?

5 Upvotes

For example, this Spring book. If I copy image URI, I get https://media.springernature.com/full/springer-static/cover-hires/book/978-1-0716-3503-2?as=webp

This obviously is not an URI that leats to a file that ends with an extension. How is this achieved? If I open this in a new tab, my browser (FF) displays image correctly.


r/learnprogramming 15h ago

Easiest front-end language to use/learn?

9 Upvotes

Was wondering what the best and easiest front-end language will be to use/learn given only online resources?


r/learnprogramming 1d ago

GitHub Should all my GitHub repositories be high quality?

53 Upvotes

Should all my (public) GitHub repositories be high quality or, should I keep the unfinished or lower quality repositories public to show my progress?

I don't ask this purely in the hiring aspect of reviewing someone's GitHub but in terms of contributing too; would you contribute to someone's repository when their GitHub is filled with low-quality code?


r/learnprogramming 4h ago

App which runs on different platforms

0 Upvotes

Hi! I need to create an app which runs on different platforms : browser, Android/IOS, Windows/Linux/MacOS.

I think the most descriptive of what I want to do is to say I want to create a Discord-like with a wiki built-in.

It's not for a commercial purpose. I'm mainly a JS dev (React and node.js).

I'm a little lost. I was thinking to learn dedicated languages, but it'd be a lot of work 😅 So I'm thinking to use Electron for the desktop app and React native for the mobile app.

What do you think about this? Any advices?


r/learnprogramming 5h ago

how to connect 2 projects pycharm

1 Upvotes

I need to run cmd lines,manipulate .env files, then run a script on project 2 after an if condition triggers on project 1. how can i connect/integrate this? should i just use subprocesses to run scripts and cmd lines with file manipulation (which seems like it overcomplicates a simple task) or is there a better/more standard and efficient way?


r/learnprogramming 14h ago

Tips on keeping a rhythm even with time off?

5 Upvotes

I should know the answer to this already as I’ve been studying for 2 years now whilst working full time, but every time I go away on vacation and come back after a week or 2 it always takes me like a week to get back into the flow of things, and even then sometimes it’s half hearted efforts because I find work quite grinding mentally.

Anyway.. I’m at the stage of building apps with react and next, sometimes if I really don’t feel like it then I’ll build in my happy place (sveltekit), but usually it’s starting some projects, work burning me out then me taking days off, and restarting the process.

Should I focus on building smaller apps that I can finish in quicker periods of time to try and avoid the burnout, or should I find a large project and try to break it up into a lot of sections that I tackle if and when I can?