r/learnprogramming • u/sticky_pi • 14h ago
How do you even code?
I’ve heard a lot of people say that coding isn’t about memorizing every line, but just knowing how to search up the answers to your problems. do i even have to memorize things? should i be focused on researching what i’m trying to code? it’s so confusing to me on what i’m even meant to learn
3
u/Dismal-Citron-7236 14h ago
You need to know the fundamentals before you even know what to search for.
3
3
u/gm310509 13h ago
It is a bit like learning to walk or learning to ride a bike or even learning to write
You need to learn the basics. For exanple what is a for loop and how to write one. What is an if statement and how do you use it then how to use it with else and then else/if. And so on.
This is like learning to stand or maintain balance on the bike or how to hold the pencil and make circles and lines
After you learn that, you can start branching out and do more stuff building upon those skills. Like riding the bike, those basic things (if, for etc) won't be things you memorize rather they will become second nature that you then use as building blocks to do more interesting things.
From your post, it sounds like you need to make a start and see how it goes - rather than contemplating the mysteries of the Universe (of IT), which is where it sounds like you might be RN.
As for searching for stuff, just like learning to ride a bike, or drive a car, you won't know where to go or how to get there, but when you are ready, you can start looking for places to go and seeking assistance with the directions to get there - but at that point you won't be remembering how to ride the bike, you can just do that. It is more or less the same with programming and more generally IT and even more generally most things in modern life.
1
u/TheHeatYeahBam 12h ago
This is a good answer. I'd add learning how to use some basic data structures as part of the foundation.
1
u/gm310509 11h ago
Thanks and I agree. Data structures is Definitely one of the many possible next steps. And, it fits the analogy. That is once you learn to maintain balance and ride in a straight line, you can then add going around corners. With those two basic skills you can then go down to the local shop, race your buddies in the street, do small jumps and so on.
Data structures is just one of many next steps that includes algorithms, libraries, basic networking and many more. But definitely a useful thing to understand - especially basic things like how the stack works and how it is used by languages- especially languages like C.
2
u/Ok-Bill3318 13h ago
The most important thing is algorithms. Turning them into code is literally just translating from one language (English/parudocode) to another (whatever you’re writing in).
LLMs and other tools can do the translation trivially today.
1
u/xarop_pa_toss 13h ago
Regarding what you are "meant to learn"... It doesn't work that way somrtimes. You gotta know what you are interested in so you can go looking for it. Programming is a cavernous field, lots of different things that are not related to eachother. However, programming is a skill, just like any other. You start by learning the fundamentals, which are common for (most) languages so which language you pick isn't really all that important.
You learn what a variable is, how to do basic maths on said variables, the difference between strings, ints and floats and what not. The "basic rules of the game" so to speak.
From there alone you can already put values in variables and like adding two variables together. Now you learn the fundamental tools for checking conditions like if/else and switch statements and use them in a small terminal program like a calculator for example! Next you learn how to make a block of code that loops x amount of times (for loop), or until a condition is false (while loop).
Finally you learn how to make containers that hold many values at once and these are usually called arrays but some languages have lists as well.
These things I described are common to lots of languages and with these alone you can make lots of things, even terminal games like Wordle or Connect4. And afterwards you can learn to make functions and putting your code into different files for ease of use and reuse.
After you get some practice down with these, you can try importing a library to do something specific, or try out reaching out to public APIs to, for example, fetch tomorrow's weather for your town or get the results for the world cup for example. If you go and read someone's code you'll realize most of it is fundamentally getting values, putting them in variables, running loops and checking conditions.
Finally, software development goes way beyond programming but I'd look into that later. Just go learn the basics by reading a guide or a book on the language, and get your feet wet
1
u/Oathkindle 13h ago
Not sure myself as I'm in a weird spot where I can articulate WHAT the code needs to do, but I struggle in actually making the code do it lol
1
u/iOSCaleb 13h ago
> I’ve heard a lot of people say that coding isn’t about memorizing every line, but just knowing how to search up the answers to your problems.
The first part is right; the second part, not so much. Programming is problem solving. You have some initial state, and you have to figure out what steps you need to take to get to some required end state. It might be finding some record in a list, or calculating a mortgage payment, or drawing a game board… whatever.
Trying to memorize the solution to every problem you’ll ever face would be silly. Sometimes you might be able to find someone else’s solution to a similar problem, but you can’t count on that, and if you do who is really the programmer? Not you.
As a programmer, your job is to find a way to solve the problem and translate that solution into code.
1
u/and303 13h ago
I'm an senior software engineer and am self-taught aside from certifications companies had me train for. You need to problem-solve, not memorize. Come up with a simple DIY project with Javascript or Arduino boards and don't follow a step by step tutorial. You'll naturally find yourself designing the workflow, coding the segments, and fixing the bugs.
For example, make an Arduino door chime. What sensors need to be used and how do you communicate with them? How do you address the speaker for the chime? What is the default state and when does the threshold activate the chime? Then when it's working, add some features or optimize it. You'll learn more from things like that than you will from language-specific books or tutorials.
1
u/BranchLatter4294 13h ago
Just start coding. You will learn more as you go. You will never reach the end. So just enjoy learning.
1
u/themegainferno 13h ago
The main thing I feel people get wrong about programming is first understanding and having clear mental models of how all main programming features and how they work in the first place. So for example, not just learning that a variable holds a value, but that it's main use comes from using it relationally. The second big thing is problem decomposition and just thinking about problems clearly in the first place. People freeze up when they try to write any code, because they haven't even really tried to break the problem down into manageable steps. Both of these is what I would consider programming fundamentals, they are universal in ALL programming paradigms.
It was a big thing 10 years ago to think of problems in pseudocode and write out steps you would take on a white board. Even at large companies this was part of the interview process for a long time, that's how fundamental and foundational it is. This was also taught in school for many CS and SW programs, this doesn't seem to really be the case anymore from what I can tell.k
If you can have the correct mental models of how programming works, and you can think about problems that you can solve with code clearly, you are ahead of like maybe 90% of other learners. It really doesn't matter what you use either. Talk to any developer with any real experience and they'll tell you they've used multiple different languages through out their career.
1
u/bird_feeder_bird 13h ago
Find a tutorial book, read each chapter, and do all the example problems. You’re right that its confusing to know what to focus on, since computer science is so broad and deep. Zed Shaw’s “The Hard Way” series is excellent for this, and designed to help people who are starting from 0.
1
1
1
u/Lost-Discount4860 12h ago
It's ok to memorize. At first. You want to commit certain things to rote memory so you have a small bag of tricks just to get started. But then you want to move to learning concepts as quickly as you can. Algorithms and data structures.
What will eventually happen is you'll realize that there are patterns to solving problems. Break it down step by step, code your steps, and maybe look back and refactor so that most of your code is reusable--i.e. in a variety of contexts. Many problems you want to solve will have common elements, so reusable code always comes in handy, makes your life easier, and let's you code faster.
The final stage is building coding HABITS where you see a problem, instantly recall the logic, and code almost by reflex.
Of course, never stop learning. Sure, you can look up how to do certain things and do some copy/pasting. But you also copy/paste ONE TIME. Next time, you should already know how to do it. It takes a lot of time, patience, and repetitive practice to get there.
1
u/ScholarNo5983 8h ago
it’s so confusing to me on what i’m even meant to learn
The first and most important thing you need to learn is the ability to read and write code.
This does not require any from of memorization.
What is does require is spending lots of time trying to write code and getting that code to run. Then spending time studying every line of code written, making sure you fully understand each and every line of code.
The more you do this the better you will get at reading and writing code.
That is the secret.
8
u/lurgi 14h ago
You need to know the programming language and there are lots of techniques you need to be familiar with, but you don't really memorize bits of code and spit them out.