Hacker News new | ask | show | jobs
by ajuc 5199 days ago
I don't know, I can only tell you what worked for me. It was "just doing it", without worying about style, guidelines, whether this will scale, is this the best practice, I just wanted to do something, I wrote the code that was the least resistance path to achieve it (I wrote 5x5 word guessing game in TurboBasic - I didn't knew how procedures worked, I did not knew that there was while loop, so i wrote one for nested into other for with the bigges numbers I could put there and worked, it was basically one big loop with if for each case, and a few variables. I should be ashamed of this code, but I was proud, because it worked. It was magic. I've shown it to my friends and parents, and everybody, and I felt so great.

I've tried something harder next time. And I've found about arrays - so I don't have to name my variables X1, x2, x3, x4 and check them with ifs, so I used arrays, then I found out about procedures, etc, etc. Then I used that to write next simple logic game, and so it went.

Whe you have something that works, it's easier to see why you need arrays, or functions, or loop without counter :) And it gives you motivation.

Anyway - good luck.