Live data from Hacker News

Ask HN: When was your "ah-ha" moment when learning how to program?

news.ycombinator.com

1–10 of 28 posts

Ask HN: When was your "ah-ha" moment when learning how to program?

#1
Non-technical business guy here, I'm currently learning PHP, I've watched screencasts (Lynda)and I'm now going through PHP 101: for absolute beginners (http://devzone.zend.com/node/view/id/627. I'm starting to understand what's going on but, still have a loooooong way to go. Regardless of that, my question to everyone at HN is:

How long did it take you to reach your "ah-ha" moment when you first learned how to program? And how/what did you get to that point?

P.S. Would love to hear some exercises you did to apply what you were learning.

Re: Ask HN: When was your "ah-ha" moment when learning how to program?

#2
I started programming in 1991. Initially I didn't understand any thing. Then after couple of months every thing made sense. The only thing in programming is practice. If you don't get 100th time you should try 101st. If you don't get it in 1000 times try 1001 time. The only way you can get any thing in programming is practice practice and practice. This is not rocket science eventually you are going to get it. The only thing you require is patience. Always start simple. Then slowly try to learn harder things. These days you have lot of resources available online which makes it very easy for one to learn programming

Re: Ask HN: When was your "ah-ha" moment when learning how to program?

#4
This might sound silly but I get that "a-ha" moment quite a bit. It happens to me when I do something that the big boys do like persist data to a database using an ORM tool or implementing something as simple as an MVC app. I would keep testing different things and emulating things you've seen in real life so you too can continue getting that "a-ha" moment.

Re: Ask HN: When was your "ah-ha" moment when learning how to program?

#5
It's such a gradual process that I never experienced any sort of epiphany or "ah-ha" moment. The best way to learn it is to use it in real world scenarios; just 3 months at a job where I had to program/figure things out taught me more than a year of practice tutorials.

Re: Ask HN: When was your "ah-ha" moment when learning how to program?

#6
I've had a couple of "ah-ha" moments during my career so far. The first was when I noticed that "hey! I can WRITE programs myself!". That was one of the happiest weeks of my life: my father showed me how to write a very simple C+4 BASIC program, a dancing stick figure on the top-left corner of the screen. I spent the rest of the week drawing different things and 'animating' them. That was somewhere around 1987 or so.

For the next few years, I played around with C+4 basic, didn't do anything serious. But in 1991, we got our first PC, and I tried to port the stuff I wrote on the C+4 to gwbasic, and later QBasic, but didn't succeed. So I dropped basic, and tried Turbo Pascal. That was my second ah-ha moment, when I discovered its help.

By 1998, I was reasonably fluent in Pascal and 386 assembly, but then my harddrive crashed, and I lost everything I wrote and collected since '91. That's when I installed Linux, and started to poke around with Perl (we had internet at school, and it was full of perl scripts. I choose perl because that's what I found the most resources for), and I discovered regular expressions: third ah-ha moment.

The fourth ah-ha moment was when I started to play with esoteric languages, which in turn resulted in learning a couple of other, real and interesting languages aswell. And then I realised that hey, I can program! And I don't care what the language is, once I knew a few, I could very easily learn another!

That moment was when it dawned on me, that programming is something much deeper, and something much more than simply writing code in one's language of choice.

And then I found the "Learn You a Haskell for Great Good" book, and when I finished it, I was enlightened.

Re: Ask HN: When was your "ah-ha" moment when learning how to program?

#7
Data structures. I could understand control flow, looping, etc, but until I took the time to understand data structures, I was always copying example code and trying to guess at what would work.

You can self teach yourself alot by learning as you go, but until I took the time to specifically study data structures I hadn't made it over the hump, my 'ah-ha' moment so to speak.

Re: Ask HN: When was your "ah-ha" moment when learning how to program?

#8
I taught myself GWBasic on an old computer, and wrote awful spaghetti code. I actually wrote a game where every map square had twelve lines of code "Print '....XX...X....X'" that would together print what that piece of the world map looked like. The allowed line numbers went up to 65,535, and as I was planning the game I planned out how I would use all of them.

Then I learned Pascal, in high school, and learned basic things like procedures and local variables. With that, I learned that you should never have to do anything more than once. Everything I subsequently learned was basically technique for following this rule.

Re: Ask HN: When was your "ah-ha" moment when learning how to program?

#9
"a pointer is just data that tells you where something is." Once I had that thought, programming was just so simple in concept.

Second one was when I realized that there are a shitton of libraries for doing things. Until then I just didn't realize it, I don't know why. Once this happened I just understood the beauty of abstraction, toolage, and code reuse.

The final one is when I realized that my code is only awesome if my co-worker can take it over 100% and not hit me with a baseball bat. Funny story, good lesson.

Re: Ask HN: When was your "ah-ha" moment when learning how to program?

#10
I don't know if it's the Aha moment you are after. But in my programming 101 class the lecturer outlined the maximum-contiguous subsequence problem (which sounds very boring). Solved it once and then solved it two more times each time making it more efficient. That was my 'aha' moment that I decided I wanted to be a programmer.

I suspect that this is the most important learning moment - what is it in programming that excites you? (probably won't be this article :)

http://en.wikipedia.org/wiki/Maximum_subarray_problem

Post reply on HN