asr comments on PSA: Learn to code - Less Wrong
You are viewing a comment permalink. View the original post to see all comments and the full post content.
You are viewing a comment permalink. View the original post to see all comments and the full post content.
Comments (77)
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. Today some of them need to write Excel scripts. Secretaries.
So if you're not a coder yet, and don't have any specific reason not to spend a considerable amount of time and effort to learn how to code, I strongly urge you to do so.
That said, I disagree with the choice of programming languages to start with. In general, for someone with no coding experience and no inherent affinity for working under artificial constraints, I suggest starting with a scripting language like Lua instead of a full-blown programming language. Or if you play PC games, see if maybe for some of your favourite ones there exist modding tools with an own script language, as is often the case with strategy games. You won't learn all that much about actual programming, but the impact on your logical thinking should be similar and you will probably be more motivated as well.
If you insist on learning a real language, don't start with a weakly typed, high level, or interpreter language (Python, Java, Objective C, BASIC, Javascript, C#, etc). I also can't advocate Ruby as a beginner language because of its syntax.
What I can advocate is Ada (more or less an improved version of Pascal), a language that will not only lead to a deeper understanding of programming logic, but also automatically teaches good programming practices. For example, the command "assign the value 0 to the variable x" is written as "x := 0", while in many other languages the same thing is written as "x = 0", which creates the illusion of equivalence with the mathematical expression "x = 0"; something that many people new to coding struggle with.
Do not learn C. I repeat: Do Not Learn C.
If you're absolutely sure your first language has to be one that is currently widely used in the industry, I can reluctantly recommend C++, but only if you're really, really sure about this. Better to start with Ada, then switch to C++.
I don't agree with the language advice. Different languages teach different things.
C is a good language for learning how the machine works, what memory looks like at a low level, and so forth. It's lousy for getting most practical work done in.
Python is a nice language for munging text and other data. It's pretty good these days for numerical work, graph generation, and so forth (thanks to numpy and matplotlib.)
JavaScript is good if you want to use a web browser to interact with your programs, and if you're prepared to also learn HTML alongside learning to program.
My sense is that Java/C#/ObjectiveC/C++ are too complex to be really good "first languages". Useful professionally, useful for many kinds of programming, but not great for learning.
There are a lot of good intro-programming resources for Java, C, and Python. My impression is that Java and Python are the most popular "first languages" academically. I don't believe Ada has nearly as much traction in that niche, which means there will be less support..
I think probably Python is the best bet, all-in-all.