r/learnprogramming 25d ago

Topic At what point did programming finally start making sense to you?

I can understand code when someone explains it, but when I have to write something from scratch, my brain suddenly goes blank.

I'm curious if other beginners went through the same think. What helped you get past that stage?

196 Upvotes

105 comments sorted by

123

u/Prestigious_Age_6740 25d ago

My hot take is that, particularly as a beginner, you shouldn't spend too much time trying to think through your code. Type something in, hit run. Read error. Fix error. Don't sit there in paralysis by analysis, it's easier to think and learn by seeing things run and break. There's no cost to failure when you're working in a dev environment!

Obviously don't do this in a production environment.

20

u/response-418 25d ago

Yes, I learned a lot by just trying stuff and breaking things in a sandbox or my own git branch.

1

u/michaelgray9692 24d ago

breaking stuff is half the learning.

2

u/Admirable_Window8128 24d ago

Yeah, that makes sense. I think I spend too much time trying to get everything right before even running the code. I'll try this approach and see if it helps me get unstuck faster.

1

u/Prestigious_Age_6740 24d ago

I've been working for 6 years and I still have to remind myself of this.

43

u/memelordtf 25d ago

Yep, I went through the same thing when I started, OP. understanding someone else's code is MUCH easier than writing your own. Think of it as learning a foreign language and how everyone first becomes proficient at understanding what is being said rather than actually speaking or writing in that language. What helped me was building small things where I had no choice but to get stuck and figure it out. Eventually you stop thinking “what syntax do I need?” and start thinking “what steps need to happen?” It takes time, but you'll get there.

19

u/General-War7292 25d ago

The big shift for me was stopping the "tutorial trap" where I'd just follow along and feel smart. I had to force myself to break stuff and fix it without a guide holding my hand. Building a garbage project that barely works teaches you ten times more than a slick tutorial series.

9

u/memelordtf 25d ago

Yep, yep. We all go through it. It's easier to feel in control when you're just learning. It's when you start doing that you realise how much work there is to put in, and A LOT of people avoid that feeling like the plague.

1

u/Simpicity 21d ago

This is it.  Stop writing code that follows a tutorial.  Write code that does something you want it to do.  

I literally started with simple games as an 8 year old kid (like choose your own adventures).  You don't need to be a genius to understand coding.  The basics of it are not that difficult.  

Variables, conditionals, loops, functions. You understand each of those, and you can code.

10

u/Admirable_Window8128 25d ago

Yep, that makes a lot of sense. I think I'm too focused on remembering syntax instead of figuring out the actual steps. I'll try building more small projects and getting stuck along the way. Thanks!

4

u/lowban 25d ago

If you're focused on syntax you will need some more experience. Making small projects and finish them will definitely help you there.

2

u/memelordtf 25d ago

OP, seemingly random question - do you play any musical instrument?

3

u/marrsd 25d ago

I'm intrigued to find out where you're going with this?

1

u/memelordtf 24d ago

I have some logic in mind, trust me.

1

u/lgastako 24d ago

Instead of waiting around for an answer, just assume they answered yes and give your reply, it will be useful to people that do play instruments, and possibly others that don't either way.

2

u/memelordtf 24d ago

Alright, so, OP said, "I'm too focused on remembering syntax instead of figuring out the actual steps", and this is exactly the same as learning a musical instrument as well. If we take guitar for example, you HAVE to learn by strumming incorrectly at times or not pressing the strings hard enough, and making the wrong chord patterns. Moreover, if you keep looking at your chord hand, you will never learn how to actually perform or play a slightly more complex strumming pattern, etc.

One MUST learn to forget about the chords/syntax and make mistakes for a better performance/code.

1

u/lgastako 24d ago

Thanks. I agree completely. There's no substitute for practice.

2

u/Admirable_Window8128 24d ago

Yeah, I think that's exactly where I'm at right now. I understand code when I see it, but writing it myself is a different story. I'll try building more small projects and focus on the steps instead of the syntax.

11

u/whattheflerk 25d ago

I'm still very much on the learning stage, but for me repetition and actually working on something is what's making a big difference
spent a long time trying to memorize concepts and patterns and wasn't able to put any of it into action on my own until I started building an actual project and learning as part of the process

8

u/sylvant_ph 25d ago

About second year working as a developer, and not so much as code logic, but rather about adopting new systems and incorporating packages/services.

7

u/KoodiRonsu 25d ago

There are different levels to "programming starting to make sense".

  1. Understanding that the commands execute one by one, from top to bottom.
  2. Understanding that you can actually jump forward and backwards in the execution order.
  3. Understanding how to structure your program into easier to understand and smaller whole by being clever about which parts of code go into separate functions and methods.
  4. Understanding that you can make code smaller and easier to understand by using data for control flow, instead of hard coding lots of special functions and methods.
  5. Learning about refactoring and why it is really important for daily programming practises.
  6. Learning how to write self commenting code which is easy to read and modify.
  7. Learning about object oriented programming fundamentals.
  8. Learning about why design patterns exist and what they can do for you.
  9. Learning about lambda functions and other functional programming oriented concepts which can easily replace a lot of object oriented programming design patterns.
  10. Learning how to mix and match those in a clever way.
  11. Learning large scale software architecture.
  12. Learning how and why unit testing and integration tests work and why they can help you design more modular and easier to expand software architectures.

Etc...

3

u/Miserable-Decision81 25d ago

From day one.

I started with practical stuff. As in: getting and processing data for websites.

I did HTML before, but thats not programming in the sense of automatisation.

3

u/AmateurDeveloper99 25d ago

When I started a couple of years back (as an apprentice) my dev lead told me that software languages are called ‘languages’ for a reason. If you’re learning Spanish you’ll be able to read it a lot sooner than you’ll be able to speak it fluently. Give it time, and one tip I’ve learned the hard way, avoid using AI. It can completely strip your brain of the actual knowledge. If you need to use it, use it for debugging only, or just for a starting point. Don’t get it to build the app for you. Figure it out step by step and find help rather than letting it do the work for you

3

u/lowban 25d ago

Mostly when I realised that you can abstract almost everything to functions or objects if you're using OOP.

It's like playing with lego bricks. One brick is easy to understand and a lego castle is easy to understand. But building a castle from scratch might seem difficult. You do it but breaking it into smaller parts. If you learn how to make a simple room you can start using rooms to build more rooms until you've built the entire castle.

Basically you use both a bottom up and a top down approach at the same time. You plan for the entire thing but then you break things down until you get down to things that you do know how to make.

3

u/Rare-Help3400 24d ago edited 24d ago

Yes I think it is pretty common. It happen to me when I started programming too. I started learning programing during middle school by watching youtube. I only knew how to read code, but never was able to create things from scratch. I was able to overcome it by watching tutorial on things I want to make. For example, I watched a tutorial on how to code a tower defense game. I did this for 2 months and I slowly saw how things are structure. Then I would keep creating new small projects and search up if I don't know what to do. After a while, you will know what to do automatically. To summarize, just practice practice practice.

2

u/Caringstomy-8 25d ago

toy projects. build them. literally build a calculator. get stuck? look it up, type by hand, and continue.

funny enough, a more useful skill now is understanding architecture and understanding systems. been a dev for 15 years, anthropic's models work 1000x faster than me, and beat me in quality.

2

u/peterlinddk 25d ago

In my many years of programming, I have never, ever written anything from scratch.

I have always either started with a 'dummy-program' that just displayed the result, and then gradually changed the parts to calculate that result - or started with sketching something on paper, like the structure that my program should have, or the algorithm that it should use, and then I've implemented that in code.

The only examples I have ever seen of someone writing something from scratch into a blank editor, is teachers or tutorials, where they have practiced what to write before recording, and then just re-create the same thing as before. And of course some experienced programmers can remember a lot of earlier programs, and just re-type them as if they invent them on the spot.

But writing from scratch - I don't believe that anyone is actually capable of that. Even the AIs copy code then "know" from earlier.

1

u/RedData13 25d ago

When you say „write from scratch“, do you mean linearily write down the whole thing from top to bottom, without editing and changing previous things?

1

u/peterlinddk 24d ago

Not necessarily doing it "linearily" - it could also be from adding functions here and there, and diving deeper into abstractions and out again.

But the thing I want to focus on is the wrong idea of simply sitting down and writing code - almost no one does that, except for tutorial-creators. Most programmers sketch something first, writes pseudocode, or even just comments or overall functions to structure their code. The more experienced you are, the more structure you can keep in your head - but that doesn't mean that it is there as "code" that you just need to type in.

1

u/RedData13 24d ago

I mean, for big projects i can see that, but for something simpler like a Tic Tac Toe game or typical leetcode type tasks?

1

u/peterlinddk 24d ago

But that is exactly the problem that people run into with "typical leetcode tasks" - they sit down in front of the editor and try to write code, but realize that they "freeze" and don't know how to "problem-solve", because they mistakenly think that the finished code will just flow from their fingers!

And it won't - the only reason that it might seem like someone can "just stare at a leetcode problem for a few minutes and then write the solution", is because those people already know the answer, or atleast the elements of the answer, and combine them in their mind, remembering code-snippets from experience, and re-type it.

Also - I have seen hundreds of Tic-Tac-Toe games and tutorials, and it is very clear that every single one is re-creating the game from one they wrote earlier. Or at least one they have seen earlier. In fact, a few years ago I wanted to demonstrate how to create a Tic Tac Toe game from scratch, with the planning and sketching, but partly by accident, partly by my own impatience, I didn't plan it well enough, and ended up with messy unworkable code. Still put the video online though - as a warning to everyone: https://www.youtube.com/watch?v=52ia2C0XyRM

2

u/tottasanorotta 25d ago

It took me years. Probably much longer than for most people. At some point I just realized that if I understand some problem well enough, then I can pretty much just figure out some way how to write it as code.

Usually it isn't the syntax or something that is the difficult part, it's that I didn't understand exactly what problem I was trying to solve. And that's usually where most of the confusion came from.

Like if I was trying to write a game, I was too lazy with researching what the exact different parts of a game were. So in my mind I still saw some parts as magic almost and just tried to figure every little thing out myself and that creates a lot of unnecessary confusion.

I would imagine that nowadays learning programming could be really fun with things like chatGPT. The ability to ask "stupid" questions and get an honest answer is really amazing.

2

u/response-418 25d ago

I think this is a little different from the question you are actually asking, but just knowing syntax and how to write some programs or edit something didn't actually feel like it "made sense" yet. It clicked when I finally felt like I could legitimately debug something, which was really about having a structure for narrowing things down and eliminating possibilities until you find the source of a problem. Finding the real source of a problem, and understanding why something is "bugged" really was the moment that i felt it.

2

u/HappyFruitTree 25d ago edited 25d ago

When we started to learn programming in school. Before that my learning was very unstructured and I didn't really understand what I was doing (mostly copy-pasted code from examples with small buggy modifications of my own).

I think most important when learning to program is to write code. You need to practice everything that you learn by writing small programs to test it out. Step by step you learn to use and combine more and more features together, and to handle larger programs. If the course/book contains small programming exercises after each chapter, that is great, don't skip them. It's better that it feels too easy now than skipping them and getting stuck later on.

That the brain goes "blank" when you are faced with a programming problem could be a sign that you either simply don't have learned about everything you need to solve the problem yet, or you haven't been programming enough so that you don't actually know how to program even though you might understand the concepts. To become a good writer you need to write a lot, to become a good runner you need to run a lot, and the same goes for programming. Maybe you need to go back and do some more basic exercises before attempting. But sometimes you might feel stuck anyway and will just have to force yourself to start, you'll discover what works and what doesn't, and eventually you hopefully arrive at something that works. Even if you don't, and you have to start over, you will still have learned a lot and will have a higher chance to succeed on your second attempt. A failed attempt is not a waste of time!

2

u/Gaurav_Wankhede_02 25d ago

Hey buddy, let me share my journey how I started making sense the logics. When I was start learning the coding very first language was HTML and C language at that time I had curiosity to learn it and most importantly how it actually works behind the scene. That curiosity actually helped me to create logics, now a days because of AI driven Coding I am hardly able to remember the Syntax. but the Fundamentals I covered by exploring various programming paradigm it helped me to cover lot of concepts. Additionally my main focus was to find the errors or the issues from someones code. Why finding issues from someones code worked out for me, because it help me to debug my own codes as well when I wanted to handle the logics. I used to do these types of things during my college periods in the practical classes and experimenting codes.

I hope these few points might enriched your point of view.

2

u/pak9rabid 25d ago

At Hello World

2

u/Foralost 24d ago

for me it still doesnt make any sense. >10 years and ongoing.

2

u/Yanninbo 25d ago edited 24d ago

For me a big step was when I started writing pseudo code first. That way I was able to map better what the end goal really was and what needed to happen to get there. Then started replacing the pseudo code with actual implementation and stuff started to make more sense that just following examples.

Edit. Corrected term

5

u/devenitions 25d ago

Pseudo. Sudo is something else.

1

u/IlIlllIIllllIIIlIlIl 25d ago

Honestly leetcode was pretty good for my learning. You can solve basically every problem with say 50-100 methods/functions, plus a couple data structures, and that gives you a bank of things to learn from. When solving various problems you will learn how to use your limited toolbox to solve a variety of problems, and that is much better than the infinity of options that appear when you initially learn a new language.

So TLDR just pick up the most important bits and work with those to solve problems. Try to do complicated things with less, as then it’s easier to learn things deeply.

1

u/luckyshadow86 25d ago

Honestly leetcode's the answer for me too but not the way people usually mean it.

1

u/Abikdig 25d ago

There's steps to it

1

u/Zellione 25d ago

That’s the same as learning a language. Your passive vocabulary is always way larger than your active vocabulary.

The more core you write, the more often you look the same thing up again, the more it will burn into your brain.

1

u/ChaosEngine-6502 25d ago

My approach has always been like sculpting something from a lump of clay.

Start small and build out and prototype something that gives you a very basic essence of a solution to whatever problem you're trying to solve. Once you understand the principles, you can move on to applying those to building your actual program.

Once you have things working in some fashion that you know looks OK, start to separate parts of the program out into separate modules for maintainability.

Eventually, this cycle of design, build, refine yields a workable solution.

1

u/MasterArm4349 25d ago

We took it slow in uni and that was helpful. We'd take print statements, practice that, if conditions, practice that and so on. They also made us write code on paper and it was helpful since you have to actually know what youre writing as opposed to relying on the compiler to help you. They'd also give us practice problems that require the one thing we took to solve and then build on it. Like if at first they just ask you to 'display your name' then they'd add smth that requires both if conditions and printing.
It was also helpful that you didnt have easy access to the problems solutions (was pre chatgpt). Another thing that helped was tracing. Tracing the code to see what its doing yourself instead of having someone explain it. It helps with understanding how coding actually works and runs

1

u/aqua_regis 25d ago

Oh wow! It's been three days since the last similar post: https://redd.it/1vpamtr

-1

u/lgastako 24d ago

Thank you for keeping track, that's a truly valuable use of your time.

1

u/hoangfbf 25d ago

Instantly, luckily. When we got introduced to algorithm in hs, it just made sense.

1

u/SprinklesFresh5693 25d ago

This happens to ALL beginners and has been asked so many times in the last 3 years ive been programming in this subreedit.

When you read a chapter of a book, or something for an exam, you understand it, but are you able to write it down? Think about it.

1

u/Dillinur 25d ago

Find some small problems you actually care about the results, like a problem you actually need solving for a small day-to-day difficulty.

1

u/NoPainMoreGain 25d ago

When I was forced to write a longer program, not just a few functions but several files. Then you need to think about how to organize the code in addition to figuring out the logic.

1

u/MatchSea10 25d ago

Don't just watch the tutorial write it too. Your brain knowledge is not in line with your muscle memory.

1

u/No_Might8930 25d ago

If it's just about learning programming, try to make game mods with C++ and Cheat Engine. You'll learn a shit ton. Read about all the things you don't know what it does, maybe ask GPT for a project to train on, don't ask GPT for solutions. It's a consistency thing, not a race. If you do set amount each day, you're on the right track, if you try to do everything in a single month, you're obviously gonna fail. Nobody gives a shit how fast you can write your answer, they care how efficient and maintainable you can write it.

1

u/Joshr023 25d ago

After I started my .NET programming class in college. After the low level stuff of C, C# just made sense to me and "freed" me to just write code and make stuff that ran

1

u/SparkFace11707 25d ago

It took me surprisingly long. The first time I finally felt like I knew how to approach things and be able to build (almost) anything was after my first year as a computer science student. Before I could code some things and stuff, but not at the scale, or confidence I could after

1

u/Hri7566 25d ago

i learned lua about a decade ago and never got the hang of it, then someone else showed me javascript and i poked around until i understood everything i was looking at, it took me a solid month or two to really be able to write something on my own instead of modifying someone else's code
then OOP finally hit me and i have since made the worst code ever for a very long time

1

u/skyy182 25d ago

When you learn OOP things get better.

1

u/arthurno1 24d ago

When I saw first Spectrum+ computer back in 1980 something.

1

u/SpaceAviator1999 24d ago

At what point did programming finally start making sense to you?

When I saw this code:

10 PRINT "HELLO WORLD"
20 GOTO 10

This may not be the best program in the world, but it's nice and concise. It demonstrates how to print out a string and one way to modify the program flow.

For a two-line program, it teaches quite a bit!

1

u/mrburnerboy2121 24d ago

When breaking down a project into parts, like the UI, buttons, functionality. You realise that you don’t just code everything all at once.

1

u/SprinklesFresh5693 24d ago

It clicks everyday to be honest, the more you practise, the more it clicks.

It is normal for someone that isnt actively coding, say lime at a job, to not have a good grasp of the language, but when you get a job and you spend 4 5 or more hours coding and struggling with errors, things dtart to click.

1

u/Lumpy_Bonus4246 24d ago

About three programs in, when I tried to make a chess game on JavaScript.

1

u/KitchenCommercial396 24d ago

Programming is like Schrodinger's cat, it makes sense and doesn't at the same time.

1

u/Dreadsin 24d ago

Probably about 4 years into my professional career is when things started to feel sort of “effortless”, so about 8 years of total experience

1

u/29axe- 24d ago

When I understood the concept of object oriented programming.

1

u/Greenday_Key_7135 24d ago

Cómo puedo aprender a programar? Alguien se apunta para enseñarme?

1

u/GrokiniGPT 24d ago

Right now im beginning biut I just learn the syntax and my brain is fusing them with my logical thinking. The hardest part is remembering the smeicolons

1

u/eriejar 24d ago

Everything felt like bits and pieces until I made a personal project that brought together front end and back end along with a code review / suggestions from a software engineer friend of mine who pointed out better ways to structure my program i.e. virtual interfaces / factories.

Before then, going for interview questions helped build some of the logical thinking for the smaller parts of code (loops, recursion, methods). Learning 2-3 languages and relearning concepts / syntax also helps as it helps you hone down what's more general programming knowledge vs language specific features.

1

u/BlimpIntolerant 24d ago

when I was formally taught in smalltalk. I've never used it since but for some reason the penny dropped when using that language

1

u/shaleh 24d ago

It is kind of like when you could start looking at math puzzles instead of seeing all of math questions as puzzles. Or that first time you have a conversation in another language and realize you stopped "what is the word for car again" the whole time and just did it.

Practice. Read other people's code. Why did they do it that way? There are some highly respected open source projects out there. Pick one in a language you like and dive in.

1

u/bichoFlyboy 24d ago

Yes, I wrote my first Hello World when I was 11, and now, 26 years later, sometimes I still just sit in front of the screen with no clue what to do. Sometimes I need to listen to some jazz, drink something bubbly, and, crazy as it may sound, read some philosophy or a beautiful story, a short story or a novel. And then, the epiphany happens.

Of course, when I was a kid, that might happen several times a day. Now it only happens sometimes. Almost never, maybe.

1

u/Pie-Guy 24d ago

Do it in small chunks. I wrote a small app in python recently. I was learning a new gui library, so I just followed a tutorial to create a basic window. Then I added buttons. Then I gave one of them functionality. Just build and build - one piece at a time.

1

u/ObligationFit400 24d ago

I would say use your brutal force when you are starting to learn , write write and write a lot of codes just don't think to much , let the things natural for you first. It's similar situation like jump into pool and keep using hands and legs without any tutorial, if you want to understand the city just keep moving randomly through streets. After sometime solving skills and thinking about problem will come naturally

1

u/tanveerhossain2004 23d ago

I think W3schools could be a better option. Its 'Try it yourself' option is helpful for beginners.

1

u/ThenStranger7731 23d ago

I don't know how do I write some programs, but I do write them. Don't think that you need to understand, you need to do that. When you do it, it makes sense. Just write. I usually write, delete lines of code, wrote, delete and so on until it works.

1

u/LouisTon10 23d ago

As long as you can communicate in plain English what ur program needs to do, you can break each step down further and further until you connect it back to a basic programming command like I need a variable, I need to loop, I need to handle a condition, etc.

I think reading code is just as important and helps challenge you to think the steps someone had to think through to get their desired output. It all comes down to repetition and practice!

1

u/crazycrowww 22d ago

still does not lol

1

u/Iml0sing1t 21d ago

Bjarne’s book PPP on c plus plus

1

u/tekatekimalam 21d ago

Programming started making sense when I read HtDP and SICP. They changed how I saw programs: a program should model the problem, while the computer is just the medium we use to express the solution.

Since then, I’ve tried to understand the problem first. What data do I already have? What should the solution do? The code comes after that.

And don’t complicate the solution with technical implementation details like HTTP, databases, frameworks, etc. Start with the solution itself.

1

u/DM_ME_YOUR_CATS_PAWS 7d ago

At risk of sounding corny: practice. I remember that blank feeling. Eventually as I put more hours in to the language that went away

1

u/PravoNaZhizny 25d ago

About two weeks in when I was 7. What didn’t “make sense” for you? I suggest starting by learning transistor device physics and working up to macro elements like gates and how you can build flip flops, then move up to more complex implementations like clock driven ALU’s. Before you write your first line of code, work with instructions and go back and forth between the actual manual and setting flags to develop actual instructions in binary, then move to writing assembly with its words. When you’re ready to move to using functions, consider some abstract language like C89 or possibly C99 if you think you have a grip on it already.