PSA: if you start learning to code and get stuck on some technical issue, feel free to PM me and I'll try to help :-)
Great post!
I strongly recommend Project Euler as a source of progressively trickier hurdles with instant feedback. It's especially helpful if (like me) you know a lot of math but little programming at the start.
I should've made it more clear that once you've got programming basics, there are (very roughly speaking) two ways to go from there. The first, which I emphasized more in the post, is to write some kind of Modern Software™ like a web application, phone app, etc. This typically entails reading tutorials and other documentation, dealing with system administration issues, etc. Basically, scale humankind's ever-growing mountain of software and add to the top of the pile.
The second way is to improve your conceptual thinking by learning new features of your language, solving challenges from Project Euler, tackling fields that require programming skill as a prerequisite (like algorithms and machine learning), learning new and different programming languages to see what they teach you, etc.
The first is more frustrating and more economically valuable, while the second requires thinking harder, is more intellectually rewarding, and builds your skills more in the long run. I guess I emphasized the first because writing Modern Software™ isn't actually that hard if you can deal with the frustration, but it took me years to realize that, so I wanted to tell others early.
I guess maybe another fie...
Agreed about debugging. Dijkstra said something like, "Debugging is the process of taking bugs out; therefore programming is the process of putting them in." Or consider the revelation of Maurice Wilkes:
As soon as we started programming, we found to our surprise that it wasn't as easy to get programs right as we had thought. Debugging had to be discovered. I can remember the exact instant when I realized that a large part of my life from then on was going to be spent in finding mistakes in my own programs.
One of the biggest misconceptions I notice in non-programmers is that they think it's mostly typing: "telling the computer what to do." Depending on the task, it's a lot of reading, or researching with Google, or staring intently at text on the screen for long minutes until you figure out what you're doing wrong.
Knowing how to program can often be secret sauce for semi-skilled labor. This resourceful individual claims to have tripled their salary by writing a program to mostly-automate their work, thereby collecting the lion's share of bonuses. At my company, I've saved whole person-weeks of others' time with really simple stuff.
My first software job was wo...
To paraphrase Jaynes, philosophers can say anything they want, because they don't have to do anything right.
The magic of coding, or in general creating something that does something, is that reality tests your ideas. Oh yeah, and you actually accomplish something outside of your head, or the heads of others at a cocktail party.
Coding is great in that the turnaround time for testing your ideas is so fast. The faster the feedback loop, the faster the learning.
Although the OP mentioned debugging, I'd stress and elaborate the point for people just learning to program. He says programming forces you to think. Particularly when you're learning, or debugging, I'd say sometimes you need to stop trying to figure it out, and start just trying things out. Fiddle with it and see what happens. That's the way to improve your model of how it works, so that next time you will have a better sense of what to do.
As someone who can program well for a beginner ( Linux user, scripts very well; otherwise Python, C, C++ and MATLAB are what I've used), what advantage is there to be gained in learning more? I'd really like to; I'm trying to all the time, but I have no real problems I need to code to solve, or they are simply much too big. Can you suggest some benefits that I'd gain from a moderate skill increase?
...Like nothing else, coding forces you to identify flaws in your thinking. If your thinking is flawed, your program won't work, except by accident. There's no other discipline quite like this. If you're a mathematician or physicist and you solve a problem wrong, your paper won't tell you. Computer programmers have to measure their thinking against the gold standard of correctness constantly. The process of uncovering and fixing flaws in a program, usually called "debugging", typically takes up the majority of the time spent on software projects.
I recommend visiting Udacity and enrolling in one of their classes.
The classes are all free and are university level. They take the form of have high quality lectures, broken up into videos a few minutes long spiced with quizzes and programming exercises. They will teach you how to program in Python as well as cool stuff like computer science or even some machine learning and AI. Each class also has a goal, like building a search engine or a self-driving car, so one can see the relevance of what he is learning to interesting tasks.
Its advantage over other...
I recommend Eric Raymond's How To Become A Hacker. He suggests: first learn HTML markup. Then learn Python.
For a great many purposes, you can just stop there - there's an excellent chance that Python will do everything you ever want to do. However, if you want to get more deeply in to it, learn Java. Other languages that might be good to learn after that: Scheme, C, and if you really want to push the boat out, Haskell.
If you're a mathematician or physicist and you solve a problem wrong, your paper won't tell you.
But it's comparatively easy to spot errors (or dead ends) as you go, and then you try to find ways of fixing them (which is harder). It seems similar to programming in this respect, maybe the greatest difference is that in programming you often work with a vast code base, and the problems can occur because of its peculiar properties you knew nothing about (or have long forgotten). Also, debugging is typically much easier in terms of cognitive load (while design can get challenging).
If you're motivated to learn coding because of the effects it has on your thinking, there is absolutely no better place to start than The Little Schemer. Seriously.
I am tempted, in fact, to claim that The Little Schemer (and Scheme, and SICP, and Lisp...) will teach an even higher standard of thinking than other programming languages. I have some evidence for this, in the form of Paul Graham's essay on the matter.
The skills underlying programming ability, figuring out what problems can be efficiently attacked by programming and how to break down problems into parts amenable to programmed solutions don't get talked about as much as coding. Jeannette Wing's article Computational Thinking (pdf) from a few years back talks about this.
For example, if you want to learn something called "bleh", searching on Google for "bleh tutorial" is a great way to start.
Too bad that Google won't tell you which tutorials are excellent, which are decent, and which suck. Looking for the FAQ for the Usenet newsgroup for the programming language you're interested in is usually better.
Long comment here.
Short comment:
I just graduated a year early from high school and I'm doing a CS major in the Fall. I took AP computer science at my high school and loved it. I'd love to learn more, but I feel like the links you post above help me learn bits and pieces (trees), but I don't really know where that's leading (forest). In essence, I want to learn about coding before I learn more coding, so that I can direct my studies in the directions I want to take them.
I think you should elaborate on this. This seems to be the first project I would want t...
That's actually good rationality advice. I've been saying something like that before.
I would add to this a recommendation: learn to design software project, i.e. do software engineering at larger scale, ultimately design something new in a new way. There you will have to think of what would otherwise have been fuzzy and ill defined concepts when you do planning, and you'll have to do it correctly. There if your thinking is flawed or if the concepts you are thinking in are flawed(that is a huge source of failure), your plans won't be implementable.
You will ...
I once started to learn Python, with Think Python, but soon succumbed to Trivial inconveniences like having to save my programs, change to the interpreter and then loading them. Learn Python the Hard Way advises to do this, too. Is there a free or commercially available program which any of you could recommend that avoids these things without interfering in the learning process? Or any other way to get over this hurdle without overpowering it?
Great post, upvoted. I'm currently majoring in math and thinking about adding a CS major/minor for when the time comes. Using these resources may give me better feel for if it's something I'm cut out for.
Great post.
Coding doesn't directly improve rational thinking, but it improves logical thinking, because it is basically a generalized approach to problem solving. It is also a skill that will lead to a much better understanding of topics like game theory and Friendly AI, and it seems pretty obvious to me that in the future, more and more interesting and rewarding jobs will require coding skills. There was a time when secretaries had to use pen and paper. Then they had to learn how to use a typewriter. Then they had to learn how to use MS Word and Outlook. ...
Presumably you read Less Wrong because you're interested in thinking better.
If so, you might be interested in another opportunity to improve the quality of your thinking: learn to code.
Like nothing else, coding forces you to identify flaws in your thinking. If your thinking is flawed, your program won't work, except by accident. There's no other discipline quite like this. If you're a mathematician or physicist and you solve a problem wrong, your paper won't tell you. Computer programmers have to measure their thinking against the gold standard of correctness constantly. The process of uncovering and fixing flaws in a program, usually called "debugging", typically takes up the majority of the time spent on software projects.
But this is only the beginning. You've probably heard something like "there are some problems that humans are good at and some problems that computers are good at". This is true. And once you learn to code, you'll be able to exploit computers to solve the problems they are good at. Having a computer to write software with is like having a hi-tech mental exoskeleton that lets your mind run harder and jump higher. Want to know what the second most common letter for an English word to end in is? That's a 15 line script. Tired of balancing chemical equations for your homework? Automate it.
Two more benefits that have less to do with thinking better:
Having enough coding knowledge to be dangerous may take persistence. If you tried and failed in the past, you probably either got stuck and gave up because there was no one to help you, or you just didn't keep at it.
I've take two different introductory programming classes now to meet college requirements. The students in both seemed substantially less intelligent to me than Less Wrong users, and most were successful in learning to program. So based on the fact that you are reading this, I am pretty darn sure you have the necessary level of mental ability.
Starting Out
I recommend trying one of these interactive tutorials right now to get a quick feel for what programming is like.
After you do that, here are some freely available materials for studying programming:
Here's a discussion on Less Wrong about what the best programming language to start with is.
If you're having a hard time getting something up and running, that's a system administration challenge, not a programming one. Everyone hates system administration I think, except maybe system administrators. Keep calm, put your error message into Google, get help on a relevant IRC channel, etc.
Once you've got the basics, a good way to proceed is to decide on something you want to write and try to write it. If you don't know how to get started, start making Google searches. Soon you'll figure out the sort of libraries/frameworks people use to write your kind of program.
At first you may just be aping what others do. For example, if you want to learn something called "bleh", searching on Google for "bleh tutorial" is a great way to start. Finding a working program and modifying it to see out how it changes is another good option. Soon you'll graduate to appropriating sample code from documentation. As you write more code and see more of the software landscape, you'll be better prepared to craft original approaches to writing software.
See also: On the Fence? Major in CS, Teach Yourself Programming in 10 Years, Computer Science and Programming: Links and Resources.