r/CodingForBeginners • • Aug 18 '26

How do you actually learn to code ?

hi everyone,

I’ve been studying computer science for about 5 years now (currently in engineering school). Over the years, I’ve touched a bit of everything: web dev (HTML, CSS, JS, PHP, SQL), and more recently Java, C, and Python for data science.

The problem is, I feel like nothing truly sticks.

Whenever I try to build something on my own, I hit a wall. I inevitably get lost in the docs, end up turning to AI to understand what I'm doing, and still feel like I'm not really learning. I know the basic syntax, but even in Python, I would struggle to design and build a moderately complex project from scratch.

I feel like I'm just skimming the surface of different languages without ever developing genuine problem-solving intuition.

How do you actually retain syntax, built-ins, and core concepts without constantly relying on external help? How do you break down a problem and structure your code from scratch on your own? Did you go through this phase, and what was the turning point that made things finally click for you?

Thanks in advance !

35 Upvotes

37 comments sorted by

View all comments

Show parent comments

1

u/northward_42 Aug 20 '26

This sounds easier to me tbh than the today's state of the art. How complex programs were you writing back then? How many people were you competing against? How great was the pressure to get results fast?

I imagine it as coding closer to assembly thinking about the logic on hardware level with no frameworks that change every 6 months, with all the time in the world to dive deep. Sounds like the promised land to me.

2

u/Dismal-Citron-7236 Aug 20 '26

You have no idea.
The punch card typing machine has no "erase" key. You hit the wrong key on keyboard, the wrong holes are punched on the card. That card is instantly wasted. As student homework generally takes a about 200 to 500+ lines of Fortran code. A card can record only one line, 'mind you. So that's a lot of cards. We take the cards in a deck box to the clerk (an old lady), register our student ID, and get a receipt for it. The staff would place student card decks to the card reader machine later, when they have time. So I generally come the next day to see if the output is ready. If done, they would hand me the result, which would be my cards and a bunch 132-column form teletype print-outs, containing my source code, the diagnostics, the output, and how many points left in my account. Yes, they charge the card-reader usage and print-outs so we have to store points in our accounts in advance. Since I was still a student, you can't expect me to always write 100% correct code, so the output form often contains a long listing of error messages. So I would need to go back to my "coding form" (you can google what it is), compare that to the error report, and rewrite a new coding form again. By "rewrite", that means actually using paper and pencil, remember there's no PC back then. And then I'd try my best to reorganize my cards, recycle whatever can be reused, and go to the card punching machine to type new ones and insert them into the deck in the correct order. One misplaced card would mean incorrect program logic, we wouldn't want that to happen. If I ran out of empty cards, I need to go the clerk and buy new ones. They sell it 100 cards a bunch, costs me about 1 USD (1980). And then I submit my cards again, hopefully to get a better luck on the result. And that's the process. Often it would take a week or two to finally get a single homework done correctly.

2

u/mjmvideos Aug 22 '26

Not to mention the JCL cards that had to go in front of the deck. And at least a couple time forgetting to add them. Then your whole submission errors out and you have to wait another whole cycle to then find out you had a typo.

1

u/Dismal-Citron-7236 Aug 23 '26

Yup. The good-old days nightmare is now fond memories.

1

u/Dismal-Citron-7236 Aug 20 '26 edited Aug 20 '26

This sounds easier to me

Far from it. Without an access to see the result in real time like the modern programmers enjoy every day, debugging programs was a nightmare back then.

On time I had this very trivial mistake in code. What's on my coding form is this: (I can't remember the exact details now, but it's something similar as the code below)

      DO 100 I = 1, 20
     Xsomething something
100   CONTINUE

Fortran IV has these "wonderful" features:

  1. It is a fixed format language. Columns 1~5 are reserved for line numbers (so you see there's a 100 which is a defined line number)

  2. It's case insensitive but we often type statement in capitals, that's the convention.

  3. Variables are predefined so we don't have to declare them.

  4. However, variables also have preassigned types, variable names starting I ~ N are integers, A ~ H and O ~ Z are for real numbers.

  5. So in my example I have a loop (starting with DO statement), it says the loop ends at the 100 CONTINUE. CONTINUE is the keyword which marks the ending of a loop. Actually, CONTINUE is just a placeholder, it can also be used as the target of a branch statement. and I = 1, 20 specifies that the loop should use the control variable I and iterate on it from 1 to 20.

  6. Inside the loop I do something. the X on the 6th column is there to mean it's a comment. Anything appears on column 6 which is not a empty space would make the line a comment.

So, what went wrong this time?

Fortran IV language ignores spaces (from column 7 to 72, columns 73~80 are reserved for sorting and diagnostic purposes). So, if I write:

      DO 100 I = 1, 20

It is no different from:

      DO100I=1,20

Actually I often make use of this because when I need to write a very complex expression which might be too long to fit in from column 7 to 72, I would remove the space to squeeze the expression in, at the cost of readability, of course.

And this time, what I actually typed is:

      DO 100 I = 1. 20

Or in Fortran's perspective:

      DO100I=1.20

You should see the problem now, it actually means assign the real number 1.20 to a variable D100I, which starts with letter D so it is a valid real number. Fortran compiler happily takes that as a valid statement, but the code supposed to be inside the loop body is only executed once, not 20 times.

Why didn't I notice it? Because on my coding form, written by myself manually with my pencil, it was clearly stated that it's DO 100 I = 1, 20. Why didn't I see that on the punch card and the output report form?

  1. The university punch card machine was shared by many students so its ribbon wears off quickly. On this particular card which keeps the line, the character . printed on the card was very faint that I can barely make it out. It looks like a , to me, but it could also be a ., I couldn't tell. But since the way it was printed on the card as DO 100 I = 1X 20, my mind inclines to think it's a comma there, not period. Human mind is good at seeing things in a whole picture, not at the scale only an ant can tell the difference.

  2. How about the print outs I receive in the following day? Unfortunately, once again, the printer is also used intensively so its ribbon is also very faint. And that . on paper looks suspiciously like a comma, could be a smudge from the smear of the ribbon so I couldn't tell.

So I spend hours after hours trying to figure out what went wrong to my logic. I even doubted maybe the Fortran IV compiler had a bug.

So how did I eventually figured out it was actually a ., not ,? Well, eventually I dug into how the Hollerith card's punch holes are coded, and the holes are encoded in EBCDIC encoding. For ,, the holes should be on rows 0, 3, and 8. For ., they should be on rows 0, 2, and 8. And this particular card which I typed DO 100 I = 1X 20, the holes for X are on rows 0, 2, and 8. So it's actually DO 100 I = 1. 20 (eg. DO100I = 1.20), not the expected DO 100 I= 1, 20.

And it took me 3~4 days to figure out a misplaced hole on the card.

So, debugging back then was a feast. No kidding.