
Ask HN: How Can I Learn Programming From The Ground Up? - todayiamme
Most of the people here on HN have extensive coding experience, and are deeply proficient in creating working code that actually does the job. I do know that reaching that level of proficiency requires years of dedicated keyboard bashing, but as a new entrant something has been bothering me.<p>I've been trying to make a web app in PHP, and I bought one of those popular books on it (http://www.amazon.com/Beginning-PHP5-Programmer-Dan-Squier/dp/0764557831/ref=pd_bxgy_b_img_a). It was quite okay, but it didn't give me what I was looking for. I want to actually <i>understand</i> what I am doing from the grounds up. For e.g.I wish to understand how TCP/IP works. So, that I know what is happening to my HTTP request after I send it and how I can take advantage of its capabilities. I also wish to understand other things like understanding how an RDBMS is implemented. So, that I can make better code to access data from it more efficiently are also a part of this.<p>In general I want to know <i>why</i> I am doing what I am doing. Some of this knowledge requires years of actual experimentation to gain, and I am ready to do that, but what I am looking for is a good platform from which I can start.<p>Can you suggest any ways/resources to do this? (This also applies to programming in general)<p>P.S. - I put this up on HN because there is a lot of noise out there, and it is hard for me as a n00b to differentiate between seemingly good advice/resources and actual good advice/resources.
======
zedshaw
Well, I'll take this time to pimp my little free book on learning Python:

<http://learnpythonthehardway.org/>

It's a book that teaches programming assuming no programming knowledge, and is
organized into exercises you do one per week or faster if you want. It's
basically a book you'd read before you try any of the others, teaching you the
stuff that other programmers forgot they learned.

~~~
sr3d
I actually spent last night reading through your book. I've been programming
for a while now, but I'm by no means a hardcore programmer (ruby and
javascript make me feel too comfortable). But I did pick up a few tricks from
you, especially the rules for if-else-if. Good stuff. If there's one thing I'd
like to read more is coding tips like that. Anything else up your sleeves Zed?

------
kranner
A fantastic book that goes from putting logic gates together, to wiring chips
in software, to implementing a virtual machine, assembler, compiler, etc is
"The elements of computing systems." Highly recommended. There are exercises
in every chapter that you _must_ do to understand the next chapter.

<http://www1.idc.ac.il/tecs/>

An introductory video is called "From Nand to Tetris in 12 Steps" and is at
<http://video.google.com/videoplay?docid=7654043762021156507>

------
golwengaud
So, in essence, you want to learn everything there is to know about computers
and computing :-) . I have a similar impulse -- whenever I see some program,
protocol, or even hardware device, I want to learn enough about how it
operates to form a good, thorough mental model.

Some immediate, relatively practical steps: \- If you're not running one of
the free Unixes, start now. I learned an enormous amount from first trying to
get coLinux to work on my windows box and then actually installing various
distros. That was four years ago, and things have gotten much easier (hardware
support, guided installation, etc.), so you won't learn as much as I did, just
as I didn't learn as much as the people who did it in, say, the mid-90's, but
it's still worthwhile.

Distro: I currently run Debian, but I think for the purpose of learning, it
(like a whole class of similar distros, like Ubuntu, RedHat derivatives, and
even OpenSolaris) is too easy: it doesn't force you to keep learning past the
basics in order to get it running and keep it running. Slackware
(<http://slackware.com/>) and the BSD's (<http://www.freebsd.org/> ,
<http://netbsd.org/> , <http://openbsd.org/> ) are probably good; I don't have
any personal experience with (Gentoo <http://www.gentoo.org/> ), but my
impression is that it would work.

\- Learn the Unix ecosystem: the command line and associated tools, the init
system, daemons, etc. The "do one thing, and do it well" philosophy makes for
programs that are easy to understand; once you understand that kind of
program, it becomes much easier to look at, say, a browser and think about the
components required to make it work.

Books/articles: \- ESR's "How to Become a Hacker"
(<http://catb.org/esr/faqs/hacker-howto.html>) tries to answer a question not
unlike yours. \- ESR's /The Art of Unix Programming/
(<http://catb.org/esr/writings/taoup/html/> ) explains the philosophy of Unix:
why things are the way they are. \- /Structure and Interpretation of Computer
Programming/ (<http://mitpress.mit.edu/sicp/> ) is a fantastic book on how to
think about programming. One of my favorites.

On my to-read list: \- John Lions' commentary on Unix (see
[http://en.wikipedia.org/wiki/Lions_Commentary_on_UNIX_6th_Ed...](http://en.wikipedia.org/wiki/Lions_Commentary_on_UNIX_6th_Edition,_with_Source_Code))
for a deep understanding of Unix circa 1976 \- Donald Knuth's /The Art of
Computer Programming/ for a similarly deep, low-level understanding of a whole
bunch of really important algorithms and data structures.

~~~
todayiamme
Thanks for replying! :)

>>>If you're not running one of the free Unixes, start now. I learned an
enormous amount from first trying to get coLinux to work on my windows box and
then actually installing various distros. That was four years ago, and things
have gotten much easier (hardware support, guided installation, etc.), so you
won't learn as much as I did, just as I didn't learn as much as the people who
did it in, say, the mid-90's, but it's still worthwhile.<<<

That's on my to-do list too. As soon as I get my own computer I plan to
install a BSD or some UNIX variant suitable for my hardware. (No. I don't own
a PC. I borrow people's laptops to work on just like this one)

>>>I currently run Debian, but I think for the purpose of learning, it (like a
whole class of similar distros, like Ubuntu, RedHat derivatives, and even
OpenSolaris) is too easy: it doesn't force you to keep learning past the
basics in order to get it running and keep it running. Slackware
(<http://slackware.com/>) and the BSD's (<http://www.freebsd.org/> ,
<http://netbsd.org/> , <http://openbsd.org/> ) are probably good; I don't have
any personal experience with (Gentoo <http://www.gentoo.org/> ), but my
impression is that it would work.<<<

I've been thinking about choosing a distro and I've ended up quite confused at
times. For me there are two sides to this. For the purpose of learning things
Ubuntu is too easy (I've forced Ubuntu installs on some poor human beings),
but at the same time if I keep something to permanently work on then I would
prefer a system which isn't taxing to work on. Although, I will teach myself
the command line for fun (just like you said), but I don't want to spend my
time doing things through it.

Sometimes, I just need a different environment to work in. An environment
which doesn't get in the way of my creative flow. For example, if I am writing
an essay/code and I have to switch to command line to type in a long command
to access some book somewhere in my system then in the heat of the moment
command line would just drive me crazy. During those times I just have to get
that stuff out of my head and anything else is an agonizing diversion.

Hence, maybe I'll just end up multi-booting my system.

>>>books/articles: - ESR's "How to Become a Hacker"
(<http://catb.org/esr/faqs/hacker-howto.html>) tries to answer a question not
unlike yours. - ESR's /The Art of Unix Programming/
(<http://catb.org/esr/writings/taoup/html/> ) explains the philosophy of Unix:
why things are the way they are. - /Structure and Interpretation of Computer
Programming/ (<http://mitpress.mit.edu/sicp/> ) is a fantastic book on how to
think about programming. One of my favorites.<<<

Thanks a lot for those resources!

I actually watch MIT's 6.00 lectures, and they simply rock.

Do you know any other good resources online?

Anyway, thanks a lot for commenting!

~~~
golwengaud
Distros: that's exactly why I've ended up with Debian, over and over again.
I'll install something else, spend a weekend getting it working, learn all
sorts of interesting stuff, and then get frustrated at all the little things I
have to do to make it a satisfactory experience. I then go back to Debian,
where everything _just works_. (I tried Ubuntu once; it was just different
enough from Debian to really irritate me, but not enough that I was really
learning anything.)

>>>For example, if I am writing an essay/code and I have to switch to command
line to type in a long command to access some book somewhere in my system then
in the heat of the moment command line would just drive me crazy. <<< See, for
me it's the opposite: the command line is perfectly natural, almost more like
an extension of myself, but GUIs drive me nuts. I think that's just a
personality thing.

Other resources online: you seem to have already discovered MIT's OCW. I know
other universities (e.g. Yale) have similar programs, but they're nowhere near
as extensive as MIT's, and they tend not to have what I want. I've also found
course websites from all sorts of universities useful.

If you can get access to a good research library, that's enormously helpful,
as a lot of things (e.g. TAoCP) just aren't online.

And of course Wikipedia is awesome; I often use its "references" and such for
textbook recommendations.

------
tkahn6
I understand _exactly_ where you're coming from.

But you have to define further what you mean by "programming from the ground
up".

Do you want to learn computer science? Do you want to learn machine/systems
architecture? Do you want to learn how to write cleaner more logical code?

All three?

The world of computer science/programming is absolutely _huge_.

There are so many ways to go about it depending on what you're looking for or
the type of learner/person you are. Do you have the patience to sit down and
study theory or do you want to intermix theory with coding?

It's a long road but clearly you're interested. If you want to chat further
I'd be really happy and interested in helping you. If you have Skype or
something we can exchange contact information. My email is in my profile.

(Also, interestingly there is a free book called "Programming From the Ground
Up" which teaches you assembly
[http://nongnu.askapache.com/pgubook/ProgrammingGroundUp-1-0-...](http://nongnu.askapache.com/pgubook/ProgrammingGroundUp-1-0-booksize.pdf)
)

~~~
todayiamme
Yes, in essence I want to learn all 3.

>>The world of computer science/programming is absolutely huge.<<<

That's precisely why I asked HN. :)

>>>There are so many ways to go about it depending on what you're looking for
or the type of learner/person you are. Do you have the patience to sit down
and study theory or do you want to intermix theory with coding?<<<

I actually really don't know what type of learner I am. On one hand I don't
have much problem in understanding things. On the other I struggle with some
issues that make it really hard to get stuff done. What I do know is that I
need space to imagine things for myself, and work things out until I am
absolutely sure that I understand something.

Whenever I study theory a million different ideas pop into my head. It's like,
oh I can do this with this, or maybe I can make this with this and so on. I
know it's not practical to chase down every path, but it definitely helps me
to implement some of them. Whenever I fail in doing that I realize just how
flawed my realization was. So, then I can go back to the drawing board and
just start over again.

>>>It's a long road but clearly you're interested. If you want to chat further
I'd be really happy and interested in helping you. If you have Skype or
something we can exchange contact information. My email is in my profile.<<<

Thanks a lot!

