TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

14 pointsby ch00eyalmost 14 years ago
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:<p>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>P.S. Would love to hear some exercises you did to apply what you were learning.

18 comments

madhousealmost 14 years ago
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.<p>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.<p>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.<p>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!<p>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.<p>And then I found the "Learn You a Haskell for Great Good" book, and when I finished it, I was enlightened.
评论 #2592639 未加载
rajeshamaraalmost 14 years ago
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
stevep98almost 14 years ago
When I was 12 I took the Commodore VIC-20 Programmer's reference guide to spain on vacation (!) for 2 weeks. I figured out how to program assembly and hand-assembled a short program to rapidly toggle the screen color from black-to-white.<p>Hmm if I try real hard I can probably recreate it here: 169 0 141 15 144 169 1 141 15 144 76 0 32<p>Anyway, when I got home, I tried it out. It changes the screen color, but then crashed because of a mistake in the loop instruction.<p>That was definitely an AHA moment - realizing how CPU's work.
solarmistalmost 14 years ago
I had two. The first was when I was in 7th grade math and was exposed to programming for the first time. We used basic and just did some ascii art stuff. A christmas tree. But I added a clear screen and a goto and that made the tree flash and kinda twinkle. Every one asked me how I did it and I showed them (it didn't work on most of their computers, I guess the refresh rate was juuuust right on my screen). That's what made me interested in computers.<p>My other was after my first year of college at University of Minnesota (99-00). I had AP comp sci AB so I didn't need to take the first year intro CS classes, but I hung out at the ACM a lot and someone told me about quick-sort or I learned it in class and it was the most complex intricate piece of code I'd ever seen. I was mesmerized by it, but everyone else just bitched about how "crazy" it was. That's when I knew I was in the right major.<p>I guess a third one would be when every one I knew that was into computers changed their major because it was too hard and I was the only one left. That was a bit of an ah-ha moment I guess.
评论 #2642631 未加载
fogusalmost 14 years ago
After a month of plodding around with C, one night I sat bolt upright in bed and just suddenly understood pointers. I had written my fair share of BASIC and Pascal before, but I think something in my mind turned over that night. I can't explain it any other way.
评论 #2642668 未加载
impendiaalmost 14 years ago
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.<p>Then I learned Pascal, in high school, and learned basic things like procedures and local variables. With that, I learned that you should <i>never have to do anything more than once</i>. Everything I subsequently learned was basically technique for following this rule.
fmstephealmost 14 years ago
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.<p>I suspect that this is the most important learning moment - what is it in programming that excites you? (probably won't be this article :)<p><a href="http://en.wikipedia.org/wiki/Maximum_subarray_problem" rel="nofollow">http://en.wikipedia.org/wiki/Maximum_subarray_problem</a>
评论 #2592468 未加载
tritogeneiaalmost 14 years ago
I learned sporadically: I fooled around in Scheme and Java when I was a kid, and used MATLAB as a student doing research, and learned the modicum of Unix that everybody in a math department knows, but it didn't really stick. Until recently, when I realized that everything I care about scientifically needs a good programmer to implement it. So I started a learning project and quickly discovered that programming is not hard. I wish someone had told me this a long time ago. Programming is just, in essence, writing extremely clearly.
LarryAalmost 14 years ago
When I was learning to program in high school, I was thinking on how to do something ...to make the computer do subroutines, and and my brother told me about GOSUB (that hadn't been taught yet in the class), something clicked at that point.<p>After that moment I started looking for ways to do what 'I' wanted the computer to do instead of just what I was told the computer could do... and was then happily exploring stuff beyond what the teachers knew (which was not too much either, back then).
mapsteralmost 14 years ago
Started with VIC20 Basic programming. 4 hrs typing from a book, then 2 hrs de-bugging, then no storage so played the sprite game until I was ready to kiss it goodbye and power off.<p>De-bugging makes you think like a programmer. I can now look at code of a language I do not know and find where the error is by 'gestalt'<p>Props to taking a VIC20 manual on vacation to Spain. Serious nerd street cred :)
nobodyspecialalmost 14 years ago
I had the Vic-20 manual - it included everything, schematics, assembly language, etc. But for some reason I just couldn't cross the conceptual barrier of op-codes to assembly instructions. I didn't understand. A small assembly program in some computer magazine showed the assembly code, then the list of POKES to load the assembly program (it was a keyboard organ): BOOM! that was all it took...
mikey_palmost 14 years ago
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.<p>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.
评论 #2592476 未加载
Yhippaalmost 14 years ago
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.
jeffoolalmost 14 years ago
My teacher used color combinations in Visual Studio that made things unmistakable. After my first dream of sering code in those colors, it was just different. It was far less daunting, and I was much more quick to get in and start tinkering with things rather than "copy him and the book." That's when I started understanding.
pstaubalmost 14 years ago
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.
petervandijckalmost 14 years ago
When I saved some data to a database and then printed it back on an html page. Suddenly I could make real interactive websites, not just static web pages.
antirezalmost 14 years ago
X=X+1
评论 #2593872 未加载
babel17almost 14 years ago
I read this magazine called DOS, and after I bought (or, better, after my mom bought it for me) a used 8088-PC in, like, 1990, I spent about 6 months trying to get the programs in this magazine to run. I did this by typing them up into a textfile, and it just didn't work. Then, one day, it worked! It was a .BAT file. This was probably my biggest AHA moment in programming.