r/learnprogramming • • 18d ago

how do you ‘learn to code’?

Hi all, so i’m a cs major and i know the fundamentals of coding and data structures, but i don’t know how to ‘learn to code’ for a project

for context, i’m trying to learn Flask. im using claude code to write a Python notebook that teaches me how to build what i want, but this feels really weird

i want to learn how to build the apps myself, which is the intent of the whole notebook thing, but i often feel bogged down by what claude generates

that’s when i go online to look up some kind of Flask tutorial, but im not sure what to look up, or whatever idea is in my head feels too complicated for what i know how to do. so i was curious, how do i learn these tools? do i just build and hope i understand? or do i read thoroughly? or some middling thing?

25 Upvotes

24 comments sorted by

View all comments

3

u/AstralIsles 18d ago edited 18d ago

I started by looking at other people's code and tutorials.
Start with a simple hello world program.
At first it is a copy an paste and ran the code. Then changed some things and ran it to see if the output changed liked I expected.
You need to push yourself to be able to write it without copy pasting.
Then learn what each of the keywords are in the language that you are coming across.

How do I print something to the console?
How do I hold a variable for a string vs a number in memory?
What operations can I do on these variable? Can I add or multiply them? Can I get a substring or append them?
How can I write my own functions to operate on variables?
How can I write a class to abstract away data and functions that are related?
How can I organize data: arrays, linked lists, maps, sets, queues, stacks. I need to add, remove, and get data from these data structures.
What are some common algorithms I can perform on this more complex data: sorting, searching. How do they scale with each operation (we call it Big O notation).
How do I interact with graphs of data? BFS vs DFS?
How can I do some IO for the files?
How can I do blocking IO for TCP/IP?
How can I use more than one processor? Does this language support threads or tasks or is it a single thread?
How can i do async IO for TCP/IP?
How can I create a Window and a button and detect a mouse click?
ect, ect

Sounds like you are already in the data structures step. Depending on which app you want to make, learn how to create a window that just displays hello world. Then see if you can create a button. Some languages have a built in button, some just tell you if a mouse button is down. More baby steps.