Live data from Hacker News

Ask HN: How did you learn to code?

news.ycombinator.com

1–10 of 23 posts

Ask HN: How did you learn to code?

#1
I'm fairly new to HN, and have recently started teaching myself to code. So far I've used Codecademy and General Assembly's DASH tool. I've also heard good things about One Month Rails.

What would you all recommend as far as inexpensive online resources? Or would you suggest I save up the money for a hacker bootcamp? Thanks!

Re: Ask HN: How did you learn to code?

#2
I hate to be "that guy", I think that taking courses online is a waste of time.

1. What do you want to learn? Web development? Systems programming? Native application programming (whatever the platform)? Figure out what your target is.

2. Go to your local book store after you solve no. 1, pick a book up that involves that general topic, and read a few pages to see if it works for you. Don't buy a "learn x in y hours/days" book. Buy something you can use as a reference.

I've found that it is easier for me to focus and understand things when I am not actually trying to do them at the same time.

3. Specifically about Rails: I'm not hugely qualified to speak about Ruby, but the friends I do have that use Rails daily have always told me that Rails has grown pretty hard for newbies to jump into immediately. Of course, I could be wrong. I wrote a small project using Sinatra, which is a really easy way to jump into using Ruby & writing a web app at the same time.

I wouldn't recommend putting any money into bootcamps. You can teach yourself everything you need to know. The majority of bootcamps I've seen are fairly expensive for someone without any real understanding of what they're getting in to, and I would go as far as to say I have seen 0 that would teach anything useful beyond "learn language x", which you can do on your own - every popular language has excellent documentation. You should want to learn the fundamentals, and try to figure out how to apply that knowledge to any language or situation you come across.

(Hope that helps a bit.)

Re: Ask HN: How did you learn to code?

#3
I spent a lot of time teaching myself (in the 70s). Then college courses, where I learned about data structures, algorithms, structured programming (all the rage, back then, a precursor to objects), and many other subjects. Then grad school, and more research, and then a few startups. I kept improving through all of it.

tl;dr: Do it, study it, do it some more. Do it a lot.

P.S. "One Month Rails" sounds like something you'd want to do later in your career. If then.

Re: Ask HN: How did you learn to code?

#5
apart from actual coding, suggest a foundation like in CS 101. ie algorithm books (eg O(n) binary/sort) kind of things, perhaps Design Patterns. for lower level, Kernighan and Ritchie c language is a bible. structured and functional (eg python) type programming are good to understand. there are tonnes of cookbooks on the technologies you decide. LAMP and thin b'ends seem effective for most web systems initially anyhow.

rails an phython are sometimes thought of as next generation languages. Java/C+ suffer greatly from the amount of scaffolding to do something simple like have a object used between layers. Python and I believe rails, says it will do stuff like setter/getters (scafolding), you concentrate on the logic. php also has some great use, they are untyped languages. typing for java/c++ can be argued as not as necessary as one may think, thats where python, php, and I believe perhaps Rails (dont quote me on that) say again, concentrate on whats needed and not having to type everything. if the web results in a string, then no need to declare that throughout your stack.

anyhow, my 2 cents. not the fastest path necessarily, but over time you may want to have good code, useable by others and designed reasonably so its not as hard to get to next steps like scale...

Re: Ask HN: How did you learn to code?

#6
The title is a bit misleading :) I guess you don't want to hear about my experiences with GW-BASIC :P

I think that, whichever choice you take, being motivated and actually doing stuff will be the best :)

You have to decide on what you want to do first (do you have a startup in mind? working as a programmer? why do you want to learn to program?).

With programming, just taking classes definitely doesn't cut it, the joy is wanting to make the computer do something and overcoming the obstacles to get there (and hopefully getting several "aha" moments along the way).

I think that if I had to start today, there are lots of awesome online resources (but I don't know them, so I can't recommend any). No idea about hacker bootcamps.

Re: Ask HN: How did you learn to code?

#7
The best way to learn is to have a need to learn. What made you initially want to learn to code? Is it a business idea? An idea you had for an app or game?

There are many different types of programming; as well as many different levels.

Web programming isn't going away for a while, and it can be useful for doing quite a lot of things. I wrote a quick start guide for beginners like yourself [1] a while ago, that you might find useful.

I didn't even know HTML six years ago, and have been working full time in the industry for almost three years now. I started out trying to force a piece of forum software into being a community-based website. I quickly got into writing custom add-ons for that forum software. I just kept moving further and further up the food chain until I got to where I am today: being paid to build multiple, complex web applications.

The toughest part about learning something completely new is not knowing the right questions to ask. It can be insanely frustrating at times. But if you can stick with it, all the anguish, self-doubt, and sleepless nights will be worth it. If you really want something, you can do anything.

[1] https://degreesofzero.com/article/70

Re: Ask HN: How did you learn to code?

#8
I apologize for the length of this post, I post this only because this might bring a perspective that might be a bit new here: of Linux in India way back then.

If its not appropriate here I wouldnt mind at all if its downvoted so that it does not take visible real estate. This is from a mail I wrote some time ago.

--

As you would know my background is not in EE or CS but in manufacturing where we had very little hands on experience with computers. We had a course where we learned FORTRAN and that was about it. In those days, a pc magazine used to distribute redhat in a CD. I think the first one I got my hands on was version 5.2. The mighty 486s in college used to command a lot of respect, and as lowly undergrads we weren't allowed to touch them. I owe Linu[x|s] and Stallman a lot of gratitude because much of what I learned about how a computer works was not from a course but actually digging through the linux and GNU system.

This was also quite normal for all linux users then. The whole point of using Linux was to figure out how things work and change things to your liking. "Change" meant editing a file and compiling, not pushing mouse buttons. If you wanted a system that worked [or not], there was always windows. It was very confusing to hear anyone complain that not everything worked right out of the box on Linux. The whole point of Linux then was then to poke around and re-tool it, it was not even expected that everything will work. It was a rudimentary car, that came with an excellent set of tools, a workshop and a manual.

If I were to choose a single word to desribe the linux user base that would be "curiosity". A lot of that has changed, now many use linux not because it allows them to learn and tinker, but because its a better windows. I dont begrudge the fact, it shows Linux has matured.

One of my first forays into personal programming was because of a printer. Printing would always make me cringe because I could not get economy mode or two-up. I barely new C. Over multiple trips to the printer room to check if the patch worked, I finally got it to run. In the process I learned the the entire path from the point one types "lpr filename" to the bits dumped on the network. I also learned how pretty code can be. Deutsch's ghostscript code is one of the most beautiful C code around, atleast to me then. I think only way to pick up good coding style is to read good code.

To give an example how bad the scenario was then: if you wanted to install something that was not on the CD, doing an apt-get install (or rpm) was out of question over the 2B/s dialup we had then. So I had to hack up a p2p file distribution system for rpms. It did signature verification and multiple parallel downloads of the same file broken up into chunks. All I can say is that it did not become napster :) But I learned a lot. Till before that I did not much know what a network even was.

I wrote it in TCL (writing that in C would have been way beyond my league) and contributed a patch for TCL's FTP client. Given that I was a complete novice, and that this worked at all and that I, a complete clueless newbie could actually contribute anything was unimaginably gratifying for a manufacturing engineering undergrad.

TL,DR Was taught quite a bit by the GNU and Linux sources

Re: Ask HN: How did you learn to code?

#9
Heh, "programming for dummies". That told me about how to run QBASIC from my windows disk, which was a pain. Where I really got started was when the aforementioned book told me how to do web programming, based on local files. At that point, I was feeling the power. Someone told me about C++, and I got "C++ For Dummies" for my thirteenth birthday. I wanted to do games, which led me to DirectX and then SDL, and also gamedev.net, from which I learned a metric crapton.

I stumbled on python a few years later, when I started playing with Blender. The online tutorial for that was pretty good (at least for me, having programmed before). If you want advice, you might start there and see how far you get.

Re: Ask HN: How did you learn to code?

#10
Buy and read "Structure and Interpretation of Computer Programs" aka SICP. Download a Scheme environment and do all the exercises. Use the multitude of resources to make sure you actually understand how, why, what.

Hacking with Ruby, Python, C#, Java, Objective C, etc, etc is fun, exciting but you won't learn the foundation stuff which sooner or later comes up as a stumbling block.

Post reply on HN