Ask HN: Okay okay, I'll learn to program...now what?
Nearly a year of daily hn visits (spent reading the stories I understood) I've come to a realization: Knowing a programming language seriously reduces the barriers to entry for a tech startup.
So the big Q: Where do I start? Do you have any resources to break down my options (Languages for Dummies?) and help me decide what, and how, I'll go about this.
Background info: I've programmed in C, C++, and VB, but nothing more than what an entry level course would teach. I'm rather adept in CSS, but that doesn't really count. Seriously, it doesn't really matter where you start. I don't want to be pessimist, but you've got so many things to learn that the important here is not where you start but the determination that you will put in to continue working days after days. That said, I suggest you start with something fun because it will motivate you. Example of that might be a simple dynamic website (using php, python, ruby, or whatever else you might like).. Also fun is creating a small game (Using some excellent libraries for beginners). You told us what you knew about programming, but you didn't tell what was your strength in other fields in life. Again, I suggest you start coding something related to other fields you're pretty good. To give you a personal example, I first built a website about dragon ball because that's what I liked when I was younger ;-) Also, I made some chat robots because I pretty much liked IRC. That was my really first projects. (Done with pure html and mIRCscripts! The real important thing is to start somewhere.. once you create something, it motivates you to learn more and more. For instance, I switched from mircscripts to C++, then learn a dozen of languages for fun and now, I live from that :) However, it might never have happened if it wasn't about those dragon ball web pages that I had so much fun building. Ha! I started out building dragon ball websites too. geocities FTW Python. Do not do the official guide. Do not read the documentation. Do something that forces you to program examples of increasing difficulty. In short, do this course: http://cs.northwestern.edu/~akuzma/classes/EECS110-s10/index... All the labs and assignments are online. You get to make maze solvers, generate fractals, implement Conway's Game of Life, lots of genuinely fun stuff. Just work through it and tell yourself you are doing it for fun not for work. You'll be done before you know it. Good luck! If you do start with Python I found Zed Shaw's Learn Python The Hard Way to be incredibly helpful when I first started learning to code some months ago. I like the link I posted because it's an intro to Computer Science in addition to Python. So in addition to introducing more and more complex Python, the problems you have to solve are meant to symbolize actual areas of CS research instead of text-based adventure game development. And your code often gets to control graphical libraries to spice things up. When talking about python I found http://diveintopython.org/ to be an excellent book for beginners. Supposedly it's pretty dated, though; see the author's comment here: http://www.reddit.com/r/programming/comments/bv9gt/dive_into... I would recommend http://diveintopython3.org/ instead. The MIT course for Intro to Comp. Sci is pretty good too. There's a bunch of people working through it on my website, Curious Reef, if anyone is interested: http://curiousreef.com/class/mit-opencourseware-600-introduc... I began with "Dive into Python" and switched over to Zed Shaw's "Learn Python The Hard Way" after 20 pages. His concept works great for me, somehow I manage to come up with enough discipline to actually do every exercise and the extra credits. Pick a project first, something that you would love to FINISH. Then research the best language to use to reach that goal. That being said, when I started, I made due with what I had. QBasic. Then a borland C compiler. Then Java. And then I just started experimenting. It didn't matter to me, I just loved to create things. Bottom line... you have to love building a complicated puzzle and you have to be able to drive yourself to finish a project. This "okay okay" business basically says to me.... you're in trouble already. Yes, yes, yes! This is exactly it. Reading through programming books and tutorials gets really dull. You need a reason, a cause, a mission. Come up with a project that excites you and learn around that. This makes the tough slog worth it and drives you toward interesting challenges you might not otherwise pick up. Damn iPad and my fat fingers voted you down. Sorry mate. Good advice otherwise. Once I get off my iPad I'll search for the python tetris project that is pretty good for people in his situation. I agree a project is essential. You need to decide what you want to build, or at least what you want to build first. From CSS, an obvious way to go is Javascript or PHP, or better yet both. If you think that you don't want to build a specific thing, but instead want a birds-eye armchair view of the essence of what programming is about, don't waste time; try SICP: http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussma... But odds are that you'll quickly find that you don't actually want to be a computer scientist. ;) You want to build something. So find an example of the thing you want to build, learn what it was built with, then learn to program that. Bonus advice: Whenever you don't know what else to do, learn about Unix, find a new feature of your text editor or version control system, or study regular expressions. Someone told me to try SICP when I was first trying to learn how to program and it was an incredibly frustrating and deflating experience. The process goes something like this: Okay, SICP sounds good. They're using LISP. How do I make a LISP program? The internet says SLIME is THE way to go and I'd be an idiot to try any other development environment. Ok, I guess I'll just install that... (3 weeks later)... okay that didn't work. Screw this, I'm learning PHP. Dr. Scheme might have made things easier. Especially because SICP uses Scheme and not Lisp. That said, the first term of my freshman year of college used SICP as the textbook. I banged my head against a wall for the first six weeks and had an epiphany in week 7. It's the best feeling in the world when functional programming finally makes sense. Everything is hard in Scheme/LISP world. As a first programming project for an isolated person without collaborators or teachers, SICP is death. It will be months before the autodidact can accomplish something that he can feel proud of. Nothing will kill interest faster than beating your head against the wall in isolation for months in your spare time without any tangible progress. I believe people that say it's awesome and I look forward to tackling it someday. But it is not a good way for a person to dip his first toe into programming. I think it's worth trying for a couple of weeks. If it doesn't start to click, then come back after a few years of imperative programming, at which time it won't be as easy as you'd expect (or so it is reported) since you have to learn the very different functional paradigm, but you'll appreciate it all the more having accumulated plenty of scars from side effect caused bugs. That said, if you have something you want to build starting with a project and an appropriate language and ecosystem (including instructional material) is very good. I myself started out in a high school punched card IBN 1130 FORTRAN "IV" course, but soon started a project that really got me going. I didn't try SICP until half a decade later; by then I was an experienced imperative language programmer (mostly C by that point) and fairly experienced in Maclisp and Lisp Machine Lisp. At which point it really made sense, both in terms of being able to understand the material and why it was really important. This is not at all what doing SICP was like for me. It was fun. There is an interesting idea on every page. The exercises are challenging and interesting. "Everyone" was wrong when it comes to SICP. The standard environment for that is the MIT Scheme distribution (http://www.gnu.org/software/mit-scheme/) which includes a version of EMACS named Edwin which runs in the same process as your Scheme. It's trivial to install (at least on Windows, haven't tried Linux) the whole package and get up and running for the purposes of SICP, which have almost nothing to do with LISP/Scheme (at least in the first few chapters). SLIME is supposed to be the way to go for a complicated LISP like Common Lisp or perhaps a richer Scheme or Clojure, but SICP is trying to teach you programming, CS and the like, and what you learn from about Scheme is incidental (well, until you get the the metacircular interpreter magic). Yes, this is exactly what I was trying to say, though I would never want to say it so bluntly up front because, well, some people love SICP. Of course, some of us loved statistical mechanics and vector calculus as well. There is no accounting for taste. Learn PHP. You know more than you are letting on, because you evidently understand exactly why PHP is a big success. Get some stuff done. I assure you that the websites you build with PHP are real websites, and the money you earn with them is real money. Given that I work at a Drupal company, I would be remiss if I didn't suggest that learning to build sites with Drupal is a great way to learn to work with PHP, Javascript, a web stack, et cetera. The community has lots of people who are coming from just the same place that you are. Pick one language to begin with and spend as much time possible trying out beginner material, building small things of your own (no one has to use them), and learning how to find information for yourself online. I suggest Python, check out these resources: I'll be "that guy" and say start with JavaScript/HTML5 plus a NoSQL database system like CouchDB. The reason is, this combination (like it or not) has a very good chance of completely taking over a wide spectrum of applications within a couple years (web, mobile, tablet, server, and desktop). Java and especially Ruby might be trendy now, but I am starting to believe the days of mega-sized application layers are numbered. JavaScript + HTML5 + touchscreen stuff on the iPad is already hot, and not to mention really fun to play with and learn. Python. Its easy to learn, powerful, mature, has lots of people willing to help you and has bindings to almost anything you can think of. Lots of great advice here. It's refreshing to see that, largely, people aren't just pushing their own language of choice, but are saying (quite rightly) that it doesn't matter. Like dpcan, I started on basic, then qbasic and moved up from there. You asked about breaking down the options. Something which I've only fairly recently realised, is that languages differ in more ways than just syntax and built-in modules. As I see it, the three main 'types' of language are: Functional languages are based on a more mathematical model, and if you've studied maths they'll probably make a lot of sense to you. They're still seen as largely academic languages, but they are used in some real-world scenarios, and they have devout followers. It's a powerful paradigm. Object-Oriented purports to allow you to model the real world more closely, but the degree of success is debatable. Personally it's my favoured approach; to me you can lay out your model really simply with an OO approach, which in turn lends itself well to separation of concerns, reusability and modularisation (i.e. you don't want to build your login system and have that also handle thumbnail uploads, they're different concerns, they should be handled in different parts of your code) Procedural, to me, is really a necessary evil en route to OO. So, yeah, I thought a broader view of language types might help, rather than a specific view of particular languages. I think of those as more like programming styles. You can program C in a functional style (although the language is not your friend). You can write FORTRAN in any language. I found personally that event-driven programming (signals, triggers, listeners) is different enough to be considered another style. Synchronization, causal sequences of events, and a clock, used for GUIs or workflows, requires a different sort of thinking than functional, procedural, or OO. I knew I'd miss one ;) The amazing and terrible thing about programming is that you can learn enough about it without physical contact with another human being. I suspect that content about programming on the web shows a huge bias towards being technology based -- if you considered all the possible topics and ideas in the world and their popularity, the ratio of popularity-on-the-internet to popularity-IRL is probably highest with technology and programming. Well, you'd have to exclude porn and other taboo topics for which the anonymity aspect of the internet, rather than information sharing aspect, causes their ratio to explode. That was a bit of a tangent. My original thought was that there are several thousand lifetimes worth of programming knowledge online, and it's getting more and more organized by the minute. Google and StackOverflow will be your best friends. It may take you some time to learn how to ask the question, but beyond that you should be able to find solutions to any problem that you run up against. With this in mind, it's important that you actively apply that knowledge. Learning is one thing, doing is quite another. I've often times postulated to myself that there's probably some optimal ratio of studying vs. doing, in all things. Then, I realize there's more to it than that -- there's the context switching. If you spend 5 years learning, then 5 years doing, you'll never learn as much as if you spend 1 day learning and 1 day doing for 10 years straight. Learning and doing feed off of each other. So, learn and do. Find something you really want to work on, and try to build it. When you run up against a wall, which you most definitely will, it's time to learn. Once you're ready to give it a shot, do it. When things start getting too complicated, you're probably doing it wrong. Start over, make things "cleaner" (this becomes a 6th sense after awhile), and you'll find yourself naturally creating patterns that you become comfortable with. Like any other skill, it's really a pleasure to see your abilities progress. Have fun. The best you can do is to Teach Yourself Programming in Ten Years.. http://norvig.com/21-days.html PS. I'm not sarcastic. Actually, the article contains the best advices for a programmer I ever read. Maybe you just don't have to rush things.. www.tryruby.org Each language tends to have particular problems it's most used to solve. They may not even be what the language is most suited for. Figure out what sort of programs you want to write, then search on that to see what others use. There'll be overlap, so look at the resources, figure out which seem to make the most sense to you, then pick the language that matches. At first, your choice of language isn't all that critical so long as you start out with some resources you've turned up that'll let you get some of those first projects completed. Then you'll be good enough at formulating ideas then implementing them to make a more informed choice. Either you'll be comfortable enough with your chosen language's idiom to solve problems even if they don't necessarily align with the language's strengths, or you'll have a better basis to pick a new language that addresses your problems with the first language. After some initial discomfort, if you've picked well the new language will start to feel handy and expressive in a short while. Any of the major languages can be taken on by the new programmer, I usually recommend one of Ruby, Python, JavaScript, Java, or Groovy. The resources for beginners are good, the user communities are supportive, and they're all expressive enough to create powerful programs. There are lots of other good languages--no knocks on them--these are just my favorites presently. I teach programming to non-programmers, BTW. Once you pick a language, come back and ask for resources for that language. ;) You want to do the minimum work to accomplish your goal (life is short), not learn a programming language for pedantic purposes. I'm using OfBiz, a Java web framework, right now, and its suitable for my purposes, but I don't know what your objectives are. You may be interested in Ruby, Django, Tapestry or ASP. Thanks for so many replies! I'm going to spend the next few hours dissecting all of this information and then dive into research. The take away message I got from seemingly everyone was to first decide WHAT I want to build, then find the best language. Teach myself using fun, interesting examples, and keep plugging away no matter the difficulty. Also, I should take full advantage of the wealth of information that can be found online. Lastly, since I'm already in the web-design field (for the one person that asked I own my own small web/graphic design firm), I might wanna stick with PHP or Java (or Python / Ruby). Again, thank you. If you're used to web stuff, you can go pretty far by really learning HTML/CSS/Javascript in a deep way, then adding in an extension library like jQuery. You can program cool, fun programs in the browser with Processing.js, a simple, cool graphics drawing language. Check out the exhibitions and learning stuff. If you're doing web work you need to do two things: 1. Buy a Linux or Mac computer, because all the standard parts work quickly and simply on those platforms and are difficult to run on Windows. That, or have a remote computer where you do your dev work. 2. Learn Ruby or Python. It doesn't matter which. People on HN seem to love Python, but there's no substantial difference if you're using them to build web applications. Why buy a new machine? http://www.microsoft.com/web/webmatrix/
http://virtualbox.org #1 is really good advice, and not just because of the pretty hardware. It's really easy (from my experience anyway, as a relatively new developer) to get derailed by having setup issues, so opt for something that removes as much friction as possible I can't help but think that if you don't know where to start (different from having too many places to start), you don't need to. If you need it, there should be something obvious - some programme that really needs to be written, and simply must run on such-and-such a system, and that will inform you on what to learn. If you're looking to do a web startup, ditch your Windows computer. Get a Mac or a Linux machine. You should give him reasons why. Personally I find Win7 has a far superior interface to OSX and out-of-box linux distros if you like using your keyboard and a minimal\no-shortcut desktop. The taskbar looks great left-aligned which, ideal for widescreen monitors. To open any program all you have to do is press the Windows key on your keyboard and type 2 or 3 letters for an autocomplete to find it, then press enter. No menus or shortcuts necessary. The only downside is installing CygWin for BASH, but I'd rather do that than install WINE for Adobe. OS X has the Spotlight which people use in the same way: one hot-key, two letters to find your app by name, and enter. I recently went back to Windows 7 as my main workstation. So far the only negative has been that access to Steam and great games has had a slight negative effect on my productivity. What, objectively, is so much better and easier under Linux? Note, we're talking dev machine here, and not deployment server. "What, objectively, is so much better and easier under Linux? Note, we're talking dev machine here, and not deployment serv" Tool chaining. For me, the ease with which I can bang out scripts and makefiles and have the tools easily check out versioned code from rcs/svn and that I can pipe and redirect and have a host of efficient tools like grep and nm and objdump and more, and they all work together piping and redirecting to make exactly what I want in so many easily altered configurations. Release and debug and partial debug and static-checking build and more, with all the makefiles just text - so easy to alter and tweak and copy and share (and even have them configure on the fly, reading the output from the compilation and rerunning with extra warnings or debug symbols) and have them run commands themselves like sending eMails to everyone who is listed as an interested party on the source controlled spec list, and so much more. Valgrind is so useful that if I have to develop on a Win32 machine I get a version of it going under MinGw, and sometimes I run a Win32 debug under Wine on Linux so I can use Valgrind on it. I sound like the biggest *nix dev env fanboy ever. Do I mean under MinGW? I forget. Maybe I never got that to work and that's why I use Wine under Lin. Terrible advice and tribalist. Your platform doesn't matter, work what you are comfortable with rather than spending months being awkward because some random guy on HN told you windows sucks. You didn't even give a reason why OS X or Linux are better, which tells everybody you are just a zealot (and the people who upvoted you are as well). Here's the reason: your web server is likely to be running using Linux, so you should have some familiarity with that. If you've always used Windows, Linux will be yet another thing to learn when you get to the point of hosting your web app. If you've been using Mac OS X or Linux as your primary computer all along you'll be comfortable with it since you use it on a daily basis. With Mac OS X, you can ease yourself into Linux. "You didn't even give a reason why OS X or Linux are better, which tells everybody you are just a zealot" Actually, I didn't give a reason hoping that it would spark an intelligent discussion with other people sharing information about pros and cons. I was opening the topic. I can understand how it looked like zealotry and tribalism to you. If Rails is in the picture, this is actually good advice. Not that you can't work around Windows, but why would you want to? Better still, use Google App Engine then it won't matter in the slightest. Google's python class actually would be right for you. You can go as slow or as fast you'd like. http://code.google.com/edu/languages/google-python-class/ You know CSS, so it seems logical to learn Javascript. That opens up both server and front end web programming [jQuery/DOM and Node.js on the backend] For books, try Crockfords 'Javascript the Good Parts' and mimic some of the nicer idioms as you see more jQuery code. I found "JQuery For Absolute Beginners" to be quite helpful for getting familiar with JQuery: http://net.tutsplus.com/articles/web-roundups/jquery-for-abs... I'll second that. NetTuts has a nice video series on jQuery that is pretty lucid to understand. Also, http://www.amazon.com/JavaScript-Definitive-Guide-Activate-P... 6th edition of Flanagan's Definitive Guide coming out. www.railstutorial.org I'd advise java as a first language, this language really forces you to grasp the concept of object-oriented programming. python and ruby make it to easy to ignore objects, while objects are a concept that once grasped is going to make programming in any language a lot easier. The thing about programming is that it's a creative process where you apply ideas in order to create a solution, the more clearly you understand these ideas the better you will be at programming(which is just writing down a solution so that a compiler can understand it).
OO languages are usually built on top of procedural, and procedural languages are by far the most widespread. Object Oriented ("OO"/"OOP")
Functional
Procedural
Also, google "Learning Python the Hard Way" for an equally-excellent Python intro.