

Ask HN: HOW did YOU learn to program? - FPSDavid

Did you read a book? If so, which?<p>Pick it up as you went?<p>Another way? Do tell.
======
mindcrime
A combination of ways, spread over many years. And I'm not done learning, so
there almost isn't an answer to this question. But to try to hit the
highpoints:

1\. I bought a copy of Herbert Schildt's "Teach Yourself C" about 1993/1994 or
so. Downloaded a shareware C compiler from a BBS and just started writing
code.

2\. Bought more books on C, C++. Upgraded to Borland Turbo C++ and started
writing C++ code. Toyed with writing hobby projects like a D&D character
generator, but mostly just worked through examples in the books.

3\. Took an "intro to programming logic" class in college.

4\. Graduated from the community college and transferred to UNC-W as a CS
major. Took "Intro to Pascal Programming" and "Intro to C Programming" and an
Assembler course during my first semester or two.

5\. Kept studying C and C++ in my spare time, even after dropping out of
school. Started dabbling with different libraries like OWL and MFC. Learned
some Borland Paradox.

6\. Dabbled a bit with other languages for kicks... downloaded freeware or
open-source compilers and did at least "hello, world" in all sorts of obscure
languages.

7\. Went back to the community college to do a degree in computer programming.
Took two semesters of C++ and two semesters of RPG/400 plus some other
interesting stuff.

7.5 about 1998 or so, started dabbling with Java just a little, but wasn't
sold on it.

8\. By 2000 I was a modestly competent C/C++ programmer, but with no real
world experience and no undergrad degree. But thanks to the dot-com bubble, I
was able to get a job as a programmer anyway, once I left the confines of
Hicksville and moved to the RTP area.

9\. Spent a year or two doing mostly C and C++ and Visual Basic development.
Transferred to a different community college to finish the A.S degree I'd
dropped out of to move to RTP in 2000. Took two semesters of Java, a semester
long class on Enterprise Java, a semester long class on JMS, two semesters of
Visual Basic, two semesters of Oracle Pl/SQL and some other stuff I forget
now.

9.5 By now I'm writing Java almost exclusively at my day job, developing web-
based e-commerce systems.

10\. Graduated, went back to that same school to do an A.S. in High
Performance Computing. Started my first open source project somewhere in this
timeframe. Took 3-4 semesters of classes on MPI programming, OpenMP
programming, HPC security, Beowulf Cluster building, an Operating Systems
class, etc.

11\. graduated, kept working mostly in Java. Have worked mostly in Java ever
since, with the exception of a stint at Lulu where I wrote mostly PHP and
Python.

12\. Started another open source project somewhere back around 2006. Mixed in
with all of this going back to the late 90's, BTW, is an interest and
association with open-source, including building Mozilla (Mozilla, mind you,
not Firefox) from source and reading over it's source, trying to understand
it. Tinkered with OpenOffice and some other random crap here and there as
well.

12.5 Gave some talks on various topics at the local Java User's Group, Linux
User's Group, etc.

13\. About a year ago, launched the open-source project that I'm hoping to
build a startup around. This time it's built in Groovy and I'm moving more and
more towards Groovy, while still writing Java at my $DAYJOB.

14\. Organize the TriJVM Hack Night meetup, where various people get together
to hack on various "stuff" in any of the many JVM languages. I usually use the
Hack Nights as an opportunity to spend a couple of hours working on Scala or
Clojure. I'm really starting to get into Clojure.

15\. Started writing overly long and detailed answers to questions on HN when
I could be coding. Shame on me.

As far as books go, there have been many over the years, but I always got a
lot of mileage out of those "Dietel and Dietel" books. People seem to either
love those or hate them, but they seemed pretty good to me. Bruce Eckel's
"Thinking in C++" was a good one as well. The Robert Sedgewick books are good
for algorithms stuff. I own a copy of SICP, but still haven't gotten around to
working through it. But I will, one day... yes, one day I will. After that
I'll tackle TAOCP (if I live long enough!)

There are all sorts of opportunities and avenues to learn, so just take
advantage. I also forgot to mention going to Users Group meetings (as an
attendee) and I learned a lot from many Tri-JUG meetings or Tri-LUG meetings
(among others.) And of course there are tons of videos and great lectures up
on on Youtube and other sites. Lately I've been going through that
Stanford/Google one on Data Mining and reading the Head First Statistics book.

If there's a point to all this, I'd say it's "Just keep learning."

------
iuguy
I don't quite know how I learned to program. I was very young when I first
started using Commodore BASIC on the PET. I remember learning BASIC before I
had a computer of my own. I would write programs at home, then type them up at
school on a BBC Micro.

I remember using the back of the manual for my friend's ZX Spectrum to learn
how to write machine code (effectively in the form of poking bytes directly
read from DATA statements, then saving the code out to tape). I wrote a tool
to dump out the bytes from code I loaded - in effect using it as a
disassembler. I actually cracked the Elite loader for Scooby Doo this way and
found hidden messages in there.

Later my parents finally caved in and got me a Multiface 1 after I had my own
spectrum, and I started cracking games, writing pokes for kids at school.

I eventually moved to an Amiga and picked up AMOS as I hated GW-BASIC. It was
there I first tried Emacs, but preferred MicroEmacs. I learned enough 68k
assembler to crack a few games using a friend's borrowed Action Replay but
never had my own so didn't get enough time with it to do much. I wrote a few
demos for the Amiga, but they weren't widely released (with me living in rural
England with no direct BBS access anymore it wasn't like I could upload a DMS
file somewhere), although some went around the local schools, colleges and
towns.

I also wrote games for the Archimedes and Amiga. When I got a PC I started
writing for that too. Eventually I got an Internet connection of my own. I
hated the PC, wanted my miggy back but Commodore was long gone and this was
the future. I eventually installed this new fangled Linux thing and it came
with free compilers - sweet! Over the space of a few weeks I learnt how
syscalls worked, how memory management worked and eventually started writing
shellcode, then exploit code and tools. After I got married I started dropping
off a bit, but I'm amazed at how many languages I can program in (I have no
idea how many, but it's a lot), not including the dead ones.

So my general way of learning was reverse engineering the language (because I
generally lacked documentation) but slowly became more along the lines of
reading books, tutorials, and picking things up as I got access to the
Internet.

------
Bossman
Started with making text adventure games on my TI-83 calc back in freshman
year of HS. I was curious as to how games worked and wanted to make my own.

After that, I took a programming class (the first one my HS offered) in Java.
It was fun. By the end, I had made a tic tac toe game, a game of hangman, and
a couple other smaller projects (was only a semester).

Then, since my school didn't offer any other programming classes, I took an
independent study so I could work on learning C++. I didn't get too far with
it because there was no structure to it (I used the book and tried to make
cool games that often didn't go very far) and I didn't have anyone supervising
me that knew C++ or OOP (the guy who sat in the room with me during the study
only knew Visual Basic and wasn't a great programmer at all). I did end up
making a program to solve limits and basic derivatives of functions for my
Calculus II class, though. That was helpful.

From there, I went off to college and started a software engineering degree.

------
bartonfink
I originally "learned" when I was a kid by watching my dad do his college
homework in his office and asking ?'s. I was homeschooled, so he took this as
an opportunity to explain how things work, what a compiler did, etc. I
remember telling him that object oriented programming seemed "stupid" because
it's redundant if you have to program everything to do the same exact task
(e.g. programming each item in your house to pick itself up). I really enjoyed
it and I think he did too because he spent most of my life telling me I'd be
great if I chose to work with computers.

However, I stopped soon after he graduated college in '89 and moved onto other
pursuits because I "knew better". I was about 22 when I started taking CS
courses in college, so in a sense that's my "real" learning to program moment,
but it's FAR from my first introduction to programming.

------
RiderOfGiraffes
At age 17 in 1978 our local Tandy (Radio Shack) had a TRS-80. I managed to
find out how to list the program that was running, read the
(minimal/inadequate) "manual" and started to modify the existing programs.

I purchased a Model I (16KB) and started to run things in BASIC for real, and
got seriously fed up with the (lack of) speed. I somehow, somewhere got a Z80
book and started to write code in assembly. That was too slow, so I wrote a
compiler.

That way I learned both BASIC and Z80, pretty much entirely self-taught from
books that didn't really have much. I might still have them somewhere - I
should try to dig them out. I certainly still have the TRS-80, and its
schematics. I've been trying to work out if I should replace the dud AND gate
that corrupts data when it reads from the screen memory.

------
soulclap
I started with Basic on a C-64 when I was a kid, mainly using the official
manual if I remember right. When I went on to the Amiga, I didn't code
anything for a few years and eventually wrote some extensions for bulletin
board systems such as AmiExpress and CNet.

On the PC I did about the same, coding add-ons for PCBoard, mainly by
decompiling other add-ons and learning from them. Later on I started with
C/C++ (and some x86 assembler) and that's when it started to become more
serious. I got a programmer job, moved on to Java, web development and many
more languages.

I wonder which language 'kids' are learning first these days though. Looking
back I'd say Basic was a perfect starting point but it's pretty much gone
these days, isn't it?

------
sagacity
Attended a 2-month COBOL programming course while doing my graduation back in
'81. Used to get (small) weekly time slots on an IBM mainframe for trials of
code (written on coding sheets, punch cards and all).

Then, taught myself FORTRAN, BASIC and PASCAL by reading books from the
library. 1st ever really working program I wrote was for a CASIO programmable
calculator that had BASIC like programming language. Next 'upgraded' to an HP
41cv calculator. Next came a Sinclair ZX 81 followed by a TRS-80 Mod IV (128
KB) where I learnt (on my own) to write _serious_ BASIC code. C, assembly and
hacking in earnest followed with my 1st IBM PC clone - a Tandy 1000 (1985).

That's it from me.

------
Suan
Its debatable whether it counts as actual "programming", but one of my first
related learning experiences was designing starcraft and warcraft 3 maps.
While I almost didn't write any _code_, I nevertheless had to construct
conditionals, triggers, events, loops etc through the GUI which probably
helped a lot when I started actual coding during my Java class.

Plus it was so fun too - I could make something quite tangible and "braggable"
(a custom game map I could play with friends) without too much difficulty and
syntax overhead. Sometimes I wonder if such game map editors should be
utilized more in teaching programming to students; they certainly got _me_
interested in programming.

------
geophile
\- Intense, hands-on experimentation from age 11, starting with programmable
calculators (this was in 1969).

\- Undergrad courses, including assembly language (IBM 360) and data
structures/algorithms with Knuth vols 1 and 3.

\- PhD, (not much programming, but lots of fundamentals).

\- Tons of programming in industry, including several years working with
people far more experienced than I was at the time.

\- Try to work like the best people you can find. I find that I was not
influenced by code so much as clearly written, well-reasoned documents that
boil a problem's solution down to a very clean abstraction.

~~~
sagacity
> I was not influenced by code so much as clearly written, well-reasoned
> documents that boil a problem's solution down to a very clean abstraction.

Hear hear. Even back in the days when the availability of coding talent was
not so plentiful nor coding tools so powerful, I used to tell people that
thorough _system analysis_ is a lot more important than just code.

------
smashing
I'll relate as a list of steps which worked for me. BTW, I am not profit
driven, but I am goal driven with self-sustainable for-profit enterprises
being one of my goals.

1) Read/Skim through the iOS Development Guide 2) Start using XCode and IB via
the templates 3) Build and run simple projects which solve problems in which I
am interested 4) Expand simple projects to use online API's and free
webservices 5) Upload to iTunes Connect 6) Profit

NOTE: I am leaving out the cost of overhead on the assumption that the scope
was within the HOW problem-set excluding HOW-MUCH.

------
robflynn
I was 12 years old and wanted to play video games on our 386. However, being
the typical 12 year old, I had no money. I had some cheesy little DOS
helicopter game and decided that I wanted to do something like that.

I pulled up the source code to GORILLAS.BAS and played around with it for a
while to learn the BASIC syntax and, instead, ended up making a silly little
text mode game where the smiley face (char 0x01) had to eat the diamonds.
Watch out for those flying dollar signs. They're dangerous!

------
_delirium
The thing that motivated me to really write programs on my own and experiment
with them was the fact that the mIRC chat client had a built-in scripting
language (a custom language, which in retrospect was a mixture of nutty and
interesting). As a high school student who frequented IRC, writing some
scripts for my client was a compelling use-case.

I had been briefly introduced to Logo and BASIC as a kid, though, in some sort
of after-school program.

------
dools
I started at age 21 in my first year of university. I did 6 months
introduction to C as part of my Batchelor in Mechatronic Engineering - and I
was hooked from day 1 :)

------
Rabidgremlin
BASIC programming guide that shipped with Vic-20 (I was about 7).

Later on C64 BASIC books and the very cool Usborne Publishing game programming
books: <http://www.acornelectron.co.uk/manuals/cats/usborne.html>

Did computer science at school and then did a 3 year degree in Information
Technology.

Been coding for almost 30 years... wow

~~~
soulclap
Damn, I am really curious about the contents of these 'vintage' game books
now.

~~~
Rabidgremlin
Check out
[http://www.commodore16.com/php/images/books/downloads/Comput...](http://www.commodore16.com/php/images/books/downloads/Computer%20Battlegames.pdf)

Basically a BASIC listing that you typed in, instructions how to to tweak the
app for various microcomputer flavors of BASIC and then challenges/hint of
tweaks you could make to the game.

The later ones like this one
[http://www.commodore16.com/php/images/books/WriteyourownAdve...](http://www.commodore16.com/php/images/books/WriteyourownAdventurePrograms.pdf)
were way more in-depth

~~~
soulclap
Great, thanks!

------
th0ma5
I started always with each language with a specific goal. With Pascal I
started with a book, but every language since then, I've mostly got the basic
structure down, and then used the reference for the language to find what I'm
looking for. For Python, I used the main tutorial that is on their site.

------
mtrn
I was 9 and I stood in a department store in Berlin. I remember nothing
interested me in this building filled with products, except a C64. Shortly
after some failed attempts to type something into the interpreter, I started
reading on the BASICs. From then on it was mainly read-trial-error-read.

------
mediacrisis
I started with QBASIC in middle school, but then picked up HTML once my family
got our lightning fast 56k modem, and thus a web nerd was born :] I dabbled in
Visual Basic and C++ in high school, but ultimately decided to pursue web
programming (XHTML,CSS, LAMP).

------
markszcz
Google and read a little to see if the syntax was different from what I'm used
to. Brute force. Get stuck.

Repeat.

I have found that if I read to much about the language I would greek out and
spend more time thinking of what if and not produce.

------
tclviii-yc
APL Interactive Approach ... Mr Gilman took us through it 2 afternoons a week
at the Bell Middle School ... we wrote the programs out longhand and got 15
minutes a week to type it into 2741 terminal hooked to a 15 cps acustic
coupler

------
kolinko
In elementary school, I started with Turbo Pascal.

I remember that I had bought a book or two and did simple exercises my teacher
gave me.

------
petervandijck
Commodore 64 basic was the first.

10 PRINT "Peter"

20 GOTO 10

Awesome!

~~~
Rabidgremlin
I remember adding a ";" to the end of the Print statement and being absolutely
mesmerized by the pattern the scrolling text made :)

~~~
petervandijck
Same here! And then fill the screen in interesting ways.

Ah the wonders of "goto".

