

Ask HN: How did you learn to code? - bkudria

Did you learn in middle school? High school? Later? How did you get started with computers and programming?
======
evanmrose
I learned over the past 6 months. Basically just read up on w3 schools,
php.net and other online sources. Started hacking away at already built apps
to extend them and eventually was facile enough to build my own from scratch.
I still suck but I can definitely put together enough to get a reasonable MVP
out. Will it scale? Who knows.

The toughest part for me coming from a completely non quant/non-cs/non-
programming background was learning how to think like a computer. Basically,
how to break problems into smaller subsets and solve them. The second toughest
part was learning the rules and conventions (i.e. what CAN and CANT you do
with the language youre using in the frame of the problem you're solving and
eventually what IS and ISNT completely foolish in terms of memory
usage/speed).

Good luck if you're on that path! I started out as a "business founder with an
idea" and realized how hard it was to get anywhere with that so I learned to
build my own ideas out.

------
humbledrone
I began learning how to program sometime in middle school. I had a TI-82
calculator, which was programmable via TI BASIC. It did not, however, have a
data port, so all the programs had to be written on the calculator itself.

My friends all had TI-83 calculators, with data ports. They had all kinds of
cool games that they shared back and forth.

I thought one of the games, SNAKEGAME, was really cool, so I figured out how
to copy it to my calculator. I opened up the BASIC source code on my friend's
TI-83, and manually copied the whole thing, character by character, into my
TI-82.

Of course, along the way I made a few typos, and so when I first tried to run
SNAKEGAME it blew up with a vague error. I went back through the program, line
by line, looking for differences between my version and the original. When I
finally got the game running, things were... odd. I hunted down the remaining
typos, and in doing so I discovered a few things. I found out that I could
just change a number in the source, and the snake would be longer. Or faster.
Or he'd do crazy things.

This was basically my enlightenment. I started changing one thing after
another to see what it would do, and eventually I became fairly familiar with
TI BASIC. I looked at the source for other games, and eventually started
making my own. At first, they were ridiculously simple, but eventually I made
a couple that were slightly entertaining.

After that, in high school a friend lent me a book about C++, and I struggled
through it. I wrote lots and lots of half-assed, totally crappy, unplayable
games, and eventually started learning other languages and getting better.

------
gliese1337
As seems to be common, I had my first exposure to programming through BASIC,
looking at programs I got from my older sister's friends or copied out of old
magazines. My 7-year-old mind didn't quite grok the difference between psuedo-
code and real code, though (for which I blame the BASIC language). Then LEGO
started selling the RCX; finding LEGO's graphical programming environment
overly constricting, I learned NQC, which lead to real C and a little bit of
FORTH to program robots. That path eventually exposed to the basics of neural
networks and some other basic ML systems. Then I got frustrated with not being
able to make my parents' Windows desktop do cool things like my robots could,
so I discovered Webmonkey (rest in peace) and taught myself JavaScript and
Perl over a couple of weekends, and started writing all kinds of silly DHTML
games and scientific command line calculators and file compressors /
encrypters. A couple of years after that, I got on my middle school robotics
team, and continued writing C code for microprocessors. Then I tested out of
introductory CS in high school, passed the AP test without taking the class,
and went on to Computer Architecture, Intro to AI, and Computational Physics,
and serving as an assistant student administrator in the high school CS lab.

And that's probably far enough past getting started to make a good ending
point.

------
duiker101
i always loved RPGs so i tried rpg maker, than i fell in love with a small app
to make RPGs for the Nokia 6630, than i started using vb to contribuite to an
open source project to make MMORPGs, from that to now, when i wanted to do
something i looked to online resources and i studied by myself.

1)want to do something

2)search online tutorial/examples/similar apps

3)TRY TRY TRY TRY TRY TRY TRY TRY

4)back to 1

~~~
gcb
almost same here. except I it was a trs80, not a mobile phone.

------
drofnas
Being a web programmer, I actually started by using the WYSIWYG editor in the
old Netscape Navigator (v2.0 I think). I simply created a simple HTML page,
then viewed the source code to see what it was doing. This was my freshmen
year in High School.

During my junior year our math teacher decided to start a Visual Basic
programming class, which I quickly jumped into that class. Then progressed to
reading lotsa books, online tutorials, etc.

100% of the knowledge I use today was all self taught, but those first bits of
<HTML> is all it took to get me hooked.

I also did some basic BASIC programing on my TI-82, so I could put all the
random math formulas into it so I just needed to enter X and Y and it would
tell me what Z was. Being that we were allowed to use the calculators on the
tests :)

Being biased towards the web side of things, I think HTML5/CSS3/Javascript is
a great (instant gratification) way to start learning programming.

------
eogas
I "started" in middle school when I discovered a little BASIC interpreter on
my 68k Macintosh Performa called Chipmunk BASIC:
<http://www.nicholson.com/rhn/basic/>

In 7th grade or so I started tinkering with Java on the same 68k mac. I
believe I understood and realized the importance of OOP in 8th grade or so,
which for me was the "aha" moment when I decided that this was what I wanted
to do for the rest of my life.

I type this, now, as an intern at a software company, configuring Team
Foundation Build for my little internal project that will go out to the devs
on Tuesday. I love my job.

------
Rust
Stupidity. I didn't RTFM. I wanted to copy a game from one disk to another. So
I printed it out (it was in AppleSoft BASIC), then started typing it back into
a new file on a new disk. Around page 5 zillion (often even having my parents
read the code out loud while I typed it in), I realized that all I needed to
do was LOAD the program, swap disks, and SAVE it. As it turns out, reading
that much BASIC was enough to give me an understanding of it. Then came Apple
][ assembly language, COBOL, and my first game (a Choplifter clone, but with a
fighter jet instead) around age 12. Since then, and like many others, I've
self-taught whatever I needed to know.

------
ghurlman
4 steps:

    
    
      - I learned how to draw a line
      - I learned how to turn
      - I asked the teacher how to "do things over and over" (loop)
      - I taught myself to draw a circle
    

That was day camp, when I was 7, learning LOGO. After that, it was learning
how to load things into high memory writing elaborate menu'd boot batch
scripts. Then BASIC, middle school classes with Pascal, taught myself C & C++
from books, and then classes on C++ in college.

All self-taught after that - I don't think a single employer I've had has ever
paid for a proper training class of any kind.

~~~
bartonfink
It always bugs me to hear coworkers complain that employers don't pay for
training. We work in an industry that makes it almost hilariously easy to
self-study, and most of the things I'd really like to have paid training for
are either too new or too esoteric for that training to exist.

~~~
ghurlman
I think the complaints are valid - after all those employers are reaping the
benefits of all that learning. That said - lack of paid-for training is never
an excuse to stop learning.

~~~
bartonfink
True, to the extent that those employees share their outside experiences with
their work. I prefer to look at off-the-job training as an investment in
myself. It may not make my current job pay more, but it will make it easier
for me to get a more appealing job next time I'm on the market.

------
forwhatitsworth
I learned how to code when I was 12. I first learnt how to pick apart html
code in the early days of the web, then grew interested in making code that
would dynamically generate content. Tore through php2 and the rest is what I
am.

No language after that truly felt different, besides the differences in syntax
and quirks. I picked up the concept of OOP from C++ and thats the end of my
story. I've never read a programming book in my life.

------
cstrouse
I started in middle school with TI-BASIC apps on my TI-85 calculator to help
me in math and physics classes. Then I moved on to VB .NET a few years later
when I got to university. Pretty much I did it all with scratch-my-own-itch
problems as they cropped up.

It progressed as such for me (mainly due to course progression at school): TI-
BASIC >> VB .Net >> C >> PHP >> C# >> Python >> Ruby

------
pacomerh
Back in the late 80's I won a free pass to a 1 semester programming course in
Gw-basic, from there I thought it was super interesting and studied Computer
Science at the University where I learned how to program in Pascal and some
Java. After that I just bought books and learned by myself some PHP, CSS, AS3,
etc.

------
hullo
In middle school, with library books; first something about text adventures in
basic on an XT clone (wish I could find the actual title, it was in the kids'
section), moving on to Turbo Pascal on a 386sx/33, probably high-school time
frame at that point.

------
MatthewB
I wanted to build a text-based RPG in high school. Ended up falling in love
with coding and been doing it ever since. Whenever I want to learn a new
language I usually buy a book about it, get half way through, and then just do
my own thing from there.

------
MatthewPhillips
First learned in middle school (never stopped learning). Trial and error.
Never taken a coding class. Tried tutorials some times but I lose interest
learning that way, I prefer to learn through a project.

------
bauchidgw
when i was about 8 years there was a german magazine called "ASM" (aktueller
software markt) there were games and software reviews (and an awesome letter
column) and ... lots and lots of basic code for simple c64 games. as i had no
money for games (hey i was 8 years old) i started typing..... after i got the
basic principles it was only a small step to my own programms. ( mostly games
and drawing programms at that time)

i kinda miss dead tree magazines with actual working code ... maybe we should
start a github magazine?

------
pixeloution
On an Apple II+, I programmed a simple game in Apple Basic when I was maybe 10
or 12 years old.

