
How I Learned to Program - b14ck
http://rdegges.com/how-i-learned-to-program
======
cletus
The one point I really disagree on is Linux.

Sure learning Linux will most likely teach you something about the platform on
which anything you write will probably be deployed but that's really marginal
(IMHO).

You get things done (programming included) by getting all the roadblocks out
of your way. Linux is (IMHO) a roadblock. The OP claims it teaches you
researching skills by giving you problems everyday you need to find solutions
for. This is true in the same way that refusing to buy food of any kind
teaches self-sufficiency.

To get things done you need to get in the zone. This means eliminating
distractions. Trying to figure out why copy and paste doesn't work (and it
turns out that it's because you're using OpenJDK instead of the Sun JDK) very
much takes you out of that zone and then wastes time to boot.

This might be more useful later on (maybe) but learning to programming? No
way.

To me, the best development platform is OSX. Why? Because it's (BSD) UNIX that
is a pleasure to use that (mostly) doesn't have the aforementioned problems.
My only real beef is that if you're used to using a program on Linux or
Windows the keyboard shortcuts will generally be different on OSX (due to
following the OSX conventions).

And as much as people (myself included) like to rag on Windows (in my case:
the complexity), the fact is that modern Windows (Win7) is actually a pretty
pleasant experience. Some things (eg git) suck but Cygwin can ameliorate a lot
of those problems.

~~~
kragen
To my taste, Linux puts a lot less roadblocks in my way than MacOS does. Maybe
my complaints that follow are simply due to my ignorance, in which case I hope
you will take the time to correct me, but as far as I know they're real
roadblocks.

I want to see the source to the ls command? dpkg -S /bin/ls; apt-get source
coreutils. I have no idea how to do that on MacOS. I want to be able to
compile it? apt-get build-dep coreutils, which IIRC will install the compiler.
The equivalent on MacOS involves signing up for a developer account with
Apple, signing a contract that promises God knows what, and downloading a
multi-gigabyte disk image. Even after installing, gcc still isn't in your
PATH, and won't work properly with the platform SDK without a verbose
-isysroot option. I want to make executable the file named gooba somewhere
under my current directory? chmod +x $(find -name gooba). Apple's find
requires an explicit `.` and maybe an explicit `-print`, I don't remember. Got
performance problems on your machine? On Linux you have htop, dstat, iotop,
powertop, and latencytop, none of which have MacOS equivalents as far as I
know. Even plain old top has keystroke commands to switch between sorting by
CPU and sorting by resident set size. As far as I can tell, doing that on
MacOS requires restarting top with different command-line options. And there's
no package-management system, so if you're building a server-based app, good
luck installing the same versions of the same libraries on the server that you
tested against in development. Or on your new dev box. And the server's
probably running Linux anyway. Also, where the fuck is strace? Dtruss is a
fucking piece of shit.

Admittedly XCode is a pretty nice IDE, but there are a lot of nice IDEs out
there, and most of them run on Linux too. And I'd love to have dtrace on
Linux.

~~~
pooriaazimi
If I had to choose between a pretty and easy to use OS (that lets me write
programs in peace and not have to manually fix everything from Terminal), and
the ability to manipulate my OS's "ls" command, I'd choose the pretty OS every
day. I wish we could have both, but now that we _have_ to choose, that's my
decision.

But that aside, I'm not sure about the rest of your complaints. I just created
couple new folders and 5-6 files named gooba and gooba2 and typed 'chmod +x
$(find . -name gooba)' and everything worked (gooba's are executable and
gooba2's are not). I don't think that extra _dot_ is that bad and I actually
like it better (it's more logical).

Also, you can install package managers such as: MacPorts[1] or Homebrew[2] or
Fink[3] (I prefer Homebrew). Then you can install htop, iotop, ftop, and a
million other unix apps.

in 'top', if you press 'o' (order), and then 'cpu', it sorts them by CPU
usage. You can even set a secondary key by pressing 'O'. And you can always
"alias top='top -o cpu'" in your .aliases.

[1] <http://www.macports.org/ports.php>

[2] <https://github.com/mxcl/homebrew>

[3] <http://www.finkproject.org/>

~~~
kragen
> If I had to choose between a pretty and easy to use OS (that lets me write
> programs in peace and not have to manually fix everything from Terminal),
> and the ability to manipulate my OS's "ls" command, I'd choose the pretty OS
> every day. I wish we could have both

Fortunately, you can: just use a current Debian on well-supported hardware.
(Until a year ago I would have recommended Ubuntu.)

> I don't think that extra dot is that bad

There are a zillion things like that in MacOS that are just that little bit
harder to use, for no good reason. Requiring five extra keystrokes in `top` to
get an actual list of the top processes is another example. You can come up
with justifications for why the roadblocks are there, or rationalize that
they're not that bad, but they really add up.it

It's like Apple's vaunted relentless focus on user experience just doesn't
extend to programmers.

> Also, you can install package managers such as: MacPorts[1] or Homebrew[2]
> or Fink[3] (I prefer Homebrew). Then you can install htop, iotop, ftop, and
> a million other unix apps.

If you're comparing MacPorts, Homebrew, and Fink to Debian or Ubuntu, I think
you haven't used Debian or Ubuntu. I didn't realize iotop and htop had already
been ported to MacOS, though. That's cool. Thanks for letting me know.
Powertop, latencytop, strace, and dstat no, though, I guess?

------
KingOfB
Wow, I never had any post summarize my growth as an engineer so well. Except
for the writing and community bit, that's come a bit late.

I remember the day I realized that I could have windows and play heretic all
day, or install linux and tinker all day. Linux quickly won.

The biggest skill I learned from linux is to never expect things to work, and
to expect the internet to fix things. My round trip time from not working to
google and back to working is by far my most valuable asset as an engineer.

And still, almost every day I leave work I think "God that was awesome!". I
hope that never goes away.

Oh, and so +1 for 2 hour nr epic SC battles! Except it was under wine, and man
did it quake!

------
Luyt
Nice read. Did you also always wanted to open things to see how they work?
When I was 6 or so, I asked my mother if I could open our hamster to see 'how
it worked inside'. Maybe if I were allowed that, I'd be a surgeon now instead
of a software developer!

------
samaraga
The author speaks of writing some small scripts. I write some small scripts
for my use for small tasks, if I come across any problem. Just in case, does
anyone know a place(website,book etc.) where such small task scripts are
collated so that anyone can use them like small assignments?

Advanced Bash Scripting Guide by Mendel
Cooper(<http://tldp.org/LDP/abs/html/>) has some good scripts which I have
come across for some practice but it isn't ordered. Any others ?

~~~
AbyCodes
<http://bashcookbook.com/>

~~~
samaraga
Thanks for the suggestion. Another O'Reilly book to read!!

------
spencerfry
No offense to the author, but I was expecting more of an in-depth process
article rather than an overview. Every "How I Learned to Program" article is
fluff filled and really only inspiring rather than action orientated. I've
never read a truly step-by-step guide on how someone has learned to program.
Maybe I'll write it.

~~~
tete
Step by step guide?

Get something you want to program. Get a reference. Program.

I am actually happy that someone told me pretty much this. It took a while
until I realized how true this was. Just get something you want to do and keep
that in mind when reading the reference. I know most people will start making
tons of mistakes and writing really crappy code, but that's exactly what
learning is about. Starting out with nothing and getting better. One learns
from mistakes. Somehow people tend to forget this. Lots of people seem to be
embarrassed making a mistake, causing them to don't do anything at all or not
giving in that they are making mistakes. One can't learn that way.

I think the article sums it up pretty well and every programmer I know did it
that way, well other than learning programming in school, which I myself don't
really consider "learning to program", because I never met any person that
actually learned programming ins school, meaning if they did they didn't ever
program again.

~~~
spencerfry
Yes. A step-by-step guide. It can be done. I'll prove it.

------
polyfractal
This is probably going to raise some ire, but am I in the minority of people
who are tired of "How I learned to program?" type posts showing up on HN?

You learned how to code. Great, I am legitimately, truthfully happy for you.
It's a very cool skill/career path and a wonderful feeling when you have the
ability to create something on your own.

But...do we really need to read that on the frontpage? Am I the only one that
finds these types of posts uninteresting?

It has almost become a cliche to wake up and find a frontpage _"How I learned
<language> in <time> as a <non-programming profession>"_

~~~
jseliger
_This is probably going to raise some ire, but am I in the minority of people
who are tired of "How I learned to program?" type posts showing up on HN?_

You're probably not the only one, but I rather like many of these posts, and I
think they're useful for the large minority or small majority of HN readers
who don't program. They're also handy encouragement to non-programmers in
general: someone says "I could do it," describes how, and perhaps that'll act
as an impetus and example.

Sometimes I learn something new from these kinds of posts.

------
nazar
I've been using linux for quite a time, and I personally love it. But I'm
afraid average person(non-programmer)reading this blogpost will think that
linux is something so fundamentally broken, you need to accomplish such
trivial tasks as copy/paste throug hours of pain and suffering. Its not like
that. Linux provides both normal and advanced modes of accomplishing stuff,
which is an advantage over other OSs like for example windows, which only
gives you one way to do stuff (which is almost always rudemtary for a power
user).

------
jthomp
Great article. I especially like the focus on writing. I've been writing for
as long as I can remember. I used to spend time between assignments in class
and homework writing short stories when I was a kid. That is partially why I
became a programmer as well. Started out writing little TI-83 apps and moved
on to Windows apps and now I am a full-time web developer (mostly Ruby on
Rails stuff) and I absolutely love coding.

------
rbanffy
I started with - don't laugh - a TI-55 calculator. It had no conditional jumps
(that would be the TI-57) or jumps other than to step 0. It also had, IIRC, 32
steps. I managed to program it to solve second-degree equations.

Then I moved on, briefly, to a Sinclair ZX-81 clone and then stayed with an
Apple II until the late-80s. I rented an MSX from the phone company as a
videotext terminal. It was a steal at about US$ 7/month.

------
bellbind
Well, all this is a bit of a fairy tale to me. Sure programming on my free
time with friends, always wanting to know more, to go further, that's true it
_is_ fun and I'd say it's a way of life. Now consider: process, deadlines, the
annoying management guys.. All this is exhausting and boring, it takes away
creativity and fun. Not everything is bright and shinny like that article
seems to state. The guy actually designing apps is not necessarily the guy who
will code them, etc. There's a lot of frustrating realities out there that are
better to be known and accepted than ignored.

Also, see [http://developers.slashdot.org/story/11/05/11/0358233/is-
pro...](http://developers.slashdot.org/story/11/05/11/0358233/is-process-
killing-the-software-industry)

~~~
boofar
So it's not the fault of programming or any other activity per se, but that of
the stressful (work) environment.

~~~
bellbind
What I'm saying is that programming for fun on your free time is _absolutely_
not the same as programming to pay the rent, and this is not straightforward
when you start learning computer science (and that's what this article is
about, right?). You _have_ to respect a lot of things that stops you in the
creation process, because the goal here is not to do cool things but do as
you're told, to take decisions not for your entertainment but for your boss.
Sure there are people that do whatever they want at work, but it's relatively
rare. And this, my friends, is just my humble opinion.

~~~
babarock
Let me put it this way. On a regular week day, I spend around 12-14 hours a
day programming (that might change with a kid on the way), only 10 of which
are done for my boss. The point is I don't program to make a living. I just
make a living by doing what I do best.

In other words, programming to me means so much more than what I give my
employer. Just like the article says, it defines a way of life, that puts
knowledge, learning and improving on top of everything else.

------
jmsduran
Nice article, I second that programming is a way of life. Although I'm in my
early 20's right out of college, I look forward to how much knowledge &
experience I will amass, and the radical transformations this industry will go
through, 10 - 20 years down the road.

> "On linux, if you want to copy a file from one box to another, you use scp
> or rsync"

No, not really... I just SFTP at the moment simply cause I find it more
convenient (granted, I'm not a Linux power user in any way).

~~~
mjwalshe
yes rsync for single files is over kill

~~~
kragen
That depends on the size of the file, the size of the updates, and the speed
of your connection.

------
fr3ddo
What about <http://www.codecademy.com> ? Modern day way to learn to program or
waste of time?

~~~
BurnZeZ
Looking at this for about 10 minutes, it seems pretty intuitive. I don't know
much about javascript though, so someone with more knowledge would be better
answering your question.

------
grokaholic
Thanks for writing this up. Read the whole thing, took it to heart. Right now
I'm making the leap to web developer in a year, without prior experience.

Was wondering what milestone achievements I should hit in Linux, given my
goals? Goal details here:

<http://news.ycombinator.com/item?id=3552656>

------
pooriaazimi
Completely off-topic: Shouldn't the title be 'How I _Learnt_ to Program'? It's
a serious question (I don't live in an English-speaking country and my English
is not great).

~~~
PeterWhittaker
You may be interested in
[http://www.sciencedaily.com/releases/2007/10/071010132314.ht...](http://www.sciencedaily.com/releases/2007/10/071010132314.htm)

tl;dr - infrequently-used irregular verbs get "regularized", frequently-used
irregular verbs, e.g., "be", "think", will likely stay irregular forever.

(I remember reading about changes to the English language that happened to be
underway about the time the printing press arrived, and how the press "froze"
that process, leaving us with the mess of pronunciation, spelling, and verb
endings we have today, but I've been unable to find an appropriate reference,
so I offer the article about the Lieberman study in its place.)

~~~
ranit8
Would that be a sign Americans have been reducing usage of the _learn_ verb? I
guess that correlates with the amount of posts here about the problems of
American education.

------
syntaxfree
Ah, to be young and naïve again.

------
hackermom
I learned by typing in BASIC program listings from computer magazines on my
VIC-20 in the mid 80s. That slowly transitioned to modifying programs to see
what would happen. At some blurry point the trial and error shifted to me
actually understanding the language - and more importantly, the realization of
programming logics - and starting to use it intuitively to write my own
programs.

~~~
Estragon
Similar story for me, except after BASIC it was Forth and 6809 assembly (and I
had a TRS-80 Color Computer) and after a while I grew obsessed with data
compression algorithms. Man, I used to love browsing old copies of _Byte_.

------
voodoochilo
i agree, but how can one write passionately about being a programmer and
programming without giving due respect to one of the most influental and
dedicated programmers of all time - richard matthew stallman - by speaking an
entire article only of "Linux" and not of "GNU/Linux"?

~~~
vasco
I never had to #DEFINE RESPECT_STALLMAN before I allocated memory or some
such, but maybe that's why my programs were always so inefficient and pasta-
like this whole time!

~~~
voodoochilo
hm, i do this #define in every program, but mine look the same as yours.

