You're looking at Less Wrong's discussion board. This includes all posts, including those that haven't been promoted to the front page yet. For more information, see About Less Wrong.

John_Maxwell_IV comments on What is the best programming language? - Less Wrong Discussion

4 Post author: lsparrish 26 May 2012 12:58AM

You are viewing a comment permalink. View the original post to see all comments and the full post content.

Comments (98)

You are viewing a single comment's thread.

Comment author: John_Maxwell_IV 26 May 2012 02:34:43AM *  13 points [-]

I'm pretty sure the short answer is: Become really good at Python. Learn additional languages if you want to solve a problem Python isn't good for, you want to learn programming concepts Python doesn't facilitate, you want to work on a project that isn't in Python, etc.

Rationale:
* I've seen lots of discussions online about what people think the best introductory programming language is. Python seems to be the clear favorite. (1, 2.)
* UC Berkeley and MIT both use Python for their introductory CS classes. (Yes, both universities switched away from Scheme.) I don't know much about any other universities.
* Recently on Hacker News there were polls on what programming languages people like and dislike. Hacker News is the unofficial homepage of programmers everywhere, and thousands participated in these polls. According to two different ways of analyzing the data (1, 2), Python was the most favored language. Note that the poll was for general purpose programming, not best introductory language.
* In my experience, it's quite valuable to be highly fluent in your chosen language. For me, there seems to be a substantial productivity difference between a language I am fluent in and a language I am mildly familiar with.
* You can hack on LW.

The answer might change if you're partway invested in learning some other programming language. I don't know if it's worthwhile to restart in midstream or not.

Comment author: dbaupp 26 May 2012 08:02:49AM *  3 points [-]

Also, one shouldn't ignore the practical advantages of a batteries-included language (like Python) for enabling you to do things.

For example, if one wants to do some transformation of a spreadsheet which might be tricky or annoying to do in Excel/LibreOffice, one can just import csv and you've got a complete CSV file reader. Similarly, it's an import and 2 function calls to get a file off the internet.

Comment author: sketerpot 28 May 2012 08:54:01PM *  2 points [-]

Similarly, it's an import and 2 function calls to get a file off the internet.

I only count one function call:

import requests
f = requests.get(my_url).text

The built-in urllib and urllib2 modules can do this too, but they're a disaster that should be buried in the ground. The general consensus is that requests is the Right Thing. You have to install it, but that should be easy with the pip package manager:

$ pip install requests

By the way, I agree with the recommendation of Python. It's a very easy language to get started with, and it's practical for all sorts of things. YouTube, for example, is mostly written in Python.

Comment author: John_Maxwell_IV 29 May 2012 12:04:24AM 1 point [-]

Thanks for requests!