Note: These are almost a decade old. Reproduced as close to memory as possible
My first memories of programming aren’t actually C. They were GW-BASIC, and later on, LOGO. I don’t remember any of my BASIC – but I do remember the look on my computer science teacher’s face in 5th grade when I managed to draw a flower with LOGO when everyone else was doing rectangles and lines. I vividly remember it – you draw an arc for a certain length, then stop, draw another arc in the reverse direction for the same length – and you have a petal. Then you just offset your next arc by a few degrees, repeat the previous thing, and you have another petal. Do this a few times such that
offset-degreese * count = 360 and you have a flower. That I could just modify the variables
offset-degree to draw flowers as big, and with as many petals as you want – it blew my mind. This was in 5th grade – and I immediately started pestering my parents to put me in a programming language class outside (I had already gone to classes for coughMS Officecough and DOS back then). And the SSI nearby happened to be teaching a reasonably cheap
The first thing I remember still is someone telling me “you don’t need to type out clearscreen(); – clrscr() would do”. This was TurboC, and to me, at that point of time, a ‘good program’ was one that had a
getch() call at the end and a
clrscr() in the beginning :)
Unix/C/C++ course – I don’t remember any Unix in it. And the C++ was disinteresting to me, because I saw no point in inheriting mammal from animal or car from vehicle. So I went about writing ‘C++’, which was basically C but with
cin instead of
scanf() (I wouldn’t understand classes and how/why they were useful until I read Hardcore Visual Basic 5 and saw the ways classes are useful and how much it sucks that VB doesn’t have them).
I had written a program called
DOSTutor then (end of 5th grade, I guess?). It had screens and screens of text that ‘taught’ you DOS commands, and then ones that made you type them in and ‘checked’ it. Initially I had written it as a long series of
scanf() statements. Suddenly some bulb went on and I realized I could cut my program size by about 90% if I separated code and data, and put the data (screen text and responses) into arrays. The feeling you get when you can reduce code drastically with no reduction in functionality (+ easier to make ‘fixes’) is quite incredible :)
But nobody ever used that program, so I wouldn’t consider that my first ‘program’. I spent the next year or so messing around with random
nosound() calls producing ‘music’ (including a few times when my code hit the
sound() call, but crashed before the
nosound() call – thus making the PC Speaker whine constantly, without any apparent way to turn it off. I used to just reset the computer then – until I learnt what exactly a
DOS System Call meant. Then I wrote another small program that just called
nosound()). I also remember messing around with BGI Graphics, mostly taking the example programs for
graphics.h and modifying them to make somewhat-pretty figures.
My first ‘real’ program was an implementation of a variant of Book Cricket. It even had a stored High Scores file. It was my stint at a ‘programming center’ (SSI, for those who remember), and I kept it in a Network Drive that I accessed using ‘Map Network Drive’. The amount of fun that was had when I discovered
rand() was quite something. It even beeped when you got out!
I lost it all in a server crash. Just do ‘Map Network Drive’ once and it was no longer there. I think I came home and cried :(
What was your first program?