“What language should I learn?”

“What language should I learn?” This is probably the question that is asked the most often in any programming-related discussion venue. Usually, it is asked by somebody who wants to learn to program and wants to know where to start.

People suggest all sorts of languages for all sorts of reasons. My answer is always the same: Python. I shall explain in this post the reasons why I recommend it. It will also give me a page that I can link to, because I’m getting tried of repeating the same arguments.

  • It’s free: If you want give programming a try, but are still unsure if you’ll continue in this endeavor, you are probably reluctant to spend money on it. Python costs nothing. You can go to their website right now and download it, completely free of charge. Even better, Python is open source: you can download the source code to see how Python works its magic. The vast majority of libraries written for Python are also free of charges.
  • Free literature: Not only is the software free, you can get also get a lot of quality documentation for free. There’s the official python.org documentation, of course, and entire books freely available on the web (legally, too!) Some good ones: Dive Into Python, How to Think Like a Computer Scientist, Python Programming Wikibook. You can consult the Python wiki for a complete list (including non-free books.) However, the official tutorial and the books mentioned above should be more than enough to get you started.
  • It’s easy to learn: When non-programmer people talk about programming, they view it as a mystic skill, where digital wizards cast complex incantations in weird languages. Of course, this myth is pretty far from what reality is; most people would be able to learn programming if they wanted to. Python is particularly easy to pick up: its rules are consistent and easy to learn, it doesn’t force you into object-oriented programming, you don’t need to be familiar with the low-level details of computers and it doesn’t have the complex and very advanced concepts that some other languages have.
  • It’s easy to read: In Hollywood movies, programmers are the people who spend their days looking at binary or hexadecimal digits scroll down a screen and they understand it all. Reality is actually quite different. Python uses simple English words and familiar symbols (e.g. the arithmetic operators) for its operations. Python doesn’t use braces to group code together; instead, it relies on the indentation of the statements. Many people feel that this helps readability a lot. (Of course, it is possible to write unreadable code in any language, including Python, but when one is not intentionally writing obfuscated code, Python is generally very readable.) Some people have described Python code as executable pseudo-code.
  • It’s popular: You may now be thinking “well, it sure is nice that Python is free and easy, but is it popular?” Obviously, it’s more motivating to learn something that’s used by more than a dozen people in their basements. Let me assure you, Python is a very popular language: a lot of programmers know and use Python. The exact number is unknown, but it is safe to say that it is in the millions. A number of large and well-known organizations also use Python: Google, NASA, Youtube, etc. This large community produces a good amount of third-party libraries, documentation, blog posts, discussion forums, etc. There are a lot of places you can go to ask questions and a lot of knowledgeable and enthusiastic people (as well as a few uninformed assholes) will answer.
  • It’s practical: It’s not very motivating to learn something when you can’t do anything useful with it, is it? Python has a very large standard library (modules that are installed with Python) to help you solve all sorts of tasks. There are modules to access web pages, email servers, FTP servers, read XML files, write GUIs, manipulate files, etc. And because Python is easy to learn, it won’t be long before you can start building up your own little programs to accomplish the boring and/or repetitive tasks of your day.
  • It’s an excellent springboard to other languages: Good programmers don’t know just one language, they know several. The core concepts you will learn in Python such as variables, conditionals, loops, functions, lists, input and output, etc. are found in other languages. Although the syntax and semantics vary between different languages, having a strong grasp of these concepts will make it easier for you to learn new languages.
  • It’s fun: At the end of the day, this is probably the most important point. No matter how easy or popular or useful something is, if it’s boring like hell, you won’t want to do it. Python is fun! I can’t explain exactly why; maybe it’s the quick cycle from idea to reality or the ease with which you can create solutions to your problems. Regardless of the reason, people all over the Internet report that they find Python to be a lot of fun and I think that you will too!
About these ads

18 thoughts on ““What language should I learn?”

  1. Very good post!! I tried to begin to code in C… then put it aside to give a try at Python… WIN! I’m a new programmer, and learning the programmiing base concepts is a lot easier in Python that they were in C.

    If you’re like me, and what to learn the magic happiness of coding something usefull without loosing your head and life at it, Python is for you :)

    Keep on goin Man!

  2. Python is fun (for me at least) because of the way it handles its data. No data type (including dictionary (associative arrays) and lists) is cumbersome to use. Its syntax is most of the time very simple, and as it offers constructs that are very close to some functional programming languages, it is sometimes very simple to do a complex thing, without worrying too much about the details. No ugly, unreadable, collection<type>::const_iterator i=…! just z=[epression(x) for x in z].

  3. Intensity!

    My main gripes about php are:

    1. Documentation and web examples don’t encourage best practices. For some examples, think about globals, magic quotes, and the general focus on MySQL specific calls for database access, rather than using an abstraction layer. In general it seems like the easy thing in PHP is often the Wrong Thing (TM).
    2. Weirdly inconsistently named standard library stuff,
    3. Batteries not included for many tasks.
    4. Some bad implementations of basic data types (like named arrays, i.e., dicts)
    5. Much harder to use outside the web-sphere.

    Wins with PHP:

    1. Widely available.
    2. Really obvious ways of interacting with webpages, a domain that interests a lot of people.

    Correct me if I’m wrong.

    I have many fewer complaints about Ruby… I like a lot of it, but I do feel it’s harder to learn than Python, but still on the easy side.


  4. I say C++, the best languaged are root in C++ or C syntax.

    C is a nice start for a real code geek to be with the intentions of stepping up to C++ or sticking with C depending how kind of programming you’re doing.

    For games C++ is certainly top.

    For sheer popularity Java is top but C++ really isn’t much harder and works on all platforms without much trouble these days.

    I think you’ll find more free C++ references than almost anything out there. From game engines to servers to missions critical apps and new even webpages.

    C++ can do it all, it some cases you will want an added library, but the extra power and efficiency is worth it.

    I think with C++ you put all your time in effort into the most versatile language.

    For sheer sellability loop up the demand for different languages in your area.

    Don’t bother picking a language because it’s easy. Learning quality programming skills isn’t easy, it’s math and logic two of the things people have the hardest times with.

    If your big problem is memorizing syntax… your screwed IMO. Just sell your job to an oversea’s company now and get a commission.

    Python is nice for whipping things together or for the endless amounts of high level code the word needs. It’s def a practical choice, I think real programmers should start with C and learn complex ideas basically from the start like binary math and algorithms.

    We should use the easiest methods to teach, not the easiest languages to teach.

  5. Matt: Like I mentioned in the “It’s practical” bullet, having a language that makes it easy and quick to do real, useful things is a key ingredient in keeping a student interested. A lot of people in interviews and comments on sites like reddit mention that they learned to program on their old 80’s computer by using BASIC to write little games or making cute graphics. Lately, I’ve heard of people who learned to program by playing with mIRC script or JavaScript. I’m sure many of those people eventually wanted to go deeper and learned the skills you talked about. I agree that learning the lower level stuff is important and so are algorithms, but you’ll definitely lose somebody’s interest if the first thing you show them is how you can use bit-twiddling to get a more efficient max() function or that a binary search is O(lg n) while a linear search is O(n). You will keep somebody interested if you give him something that he can use to do the things he wants to do, and Python is definitely way ahead of C, C++ and Java in that regard. Hook them first, and the rest will come on its own.

    And by the way, it’s “you’re screwed”, but I guess if English syntax is too hard for you, you can always ship your job to an oversea company.

  6. I tried Python but I finally gave up on it. I’m in my 40s and just don’t have time to “play” with it.

    2 things –

    Job prospect –
    it’s just so depressingly low and I still haven’t heard a good answer to my very first question I had when I realize how few Python jobs there are: “If the language has all these nice points – why is it that it is NOT widely used AT ALL by the majority of job providers like financial services, mid-size companies etc ?”

    Where is Python ????? –
    I’m in NYC…..probably the most metro area of the developed countries right ?
    I *really* wanted to learn it – but I rather not go the way of “DIY” – so i searched for training resources….You probably know what I’m going to say – it’s like trying to find a teacher of some long-lost central-Asian nomadic language LOL.
    Google search result is literality one page.
    I’m now 90% certain there’s no colleges with 300 miles of NYC that offer Python class.
    80% certain that’s no private training class within NY metro.

  7. Mastering a single language in view of a job prospect is about as silly as mastering the hammer (and only the hammer) and go look for a construction job. Python, like any other programming language, is a tool that has its own niche, its own applications, its own right sweetspot. Python must be learnt in addition to other programming languages (C, C++, Java (not necessarily in that order)) : it’s just one more tool you can use to go through your daily business, either by programming in python, either by applying knowledge acquired in python in another language/environment.

    And Python isn’t very hard to learn. I wrote a multi-threaded web crawler in about (working) 8 days starting from knowing 0 Python. I already knew about tens of programming languages, true, … well, let’s say I currently use 5 or 6 different programming languages depending on what I’m doing, so learning python wasn’t all that hard. Python isn’t all that alien when you already know a C-type language (java included, I would guess). There are tons of online resources (dive into python, for exemple) and books are easily found.

    What’s much harder with python is not to get started and build meaningful programs with it, it is to get the just right ‘pythonisms’, to get the elegant, short, pythonesque constructs that improve the succinctness of your code as well as, very often, its readability and its efficiency.

  8. 》Steven Pigeon Says:
    》Mastering a single language in view of a job prospect is about as silly as mastering the hammer (and only the hammer) and go look for a construction job

    Some of us just have to be practical unfortunately.
    We all have finite time.

    I love programming but between choosing putting in time learning a computer language and doing something else unproductive like being with family, traveling etc. I’d pick the latter…I’d come back to option#1 if that’s going to improve my job aspect which would benefit myself and family.

  9. I didn’t mean you have to learn ALL programming languages, but from a practical standpoint, you cannot survive in the competitive CS/IT world without knowing at least a FEW languages. You must at least be procifient in your work ecosystem, and that means that in addition to, say, Java, which is your core language, you may have to deal with the operating system, through a shell script language, often, maybe some C, and the occasionnal Perl script that rehashes the logs from another app. You cannot restrict yourself to Java, and just say “it’s not java, so I won’t do the job”.

    On the other hand, I do fully understand what you’re saying. I do too now learn languages more on a need-to-know basis (so no real chance I’ll be learning… say Haskell ;) any time soon).

  10. Pingback: The Right Tool « Harder, Better, Faster, Stronger

  11. hi..u have posted a very interesting fact..but can u tel me if PYTHON assures me a job in companies like IBM,GOOGLE,MICROSOFT??
    plz do reply onto my yahoo account at the earliest..


  12. Well, prashanth, I thought it was a good read. And nothing in life, is certainly assured to happen or a perfect guarantee. Python is excellent, if even a secondary preference for you. I will say this, it certainly can’t hurt you knowing python. It’s power to ease ratio, compared to other programming languages, is incredible. One last note… I don’t think you can be “assured” it will land you the secure cushy job, you seek, but I can assure you that without python, some of those key mark companies you mentioned, would not have been as succesful with that type of perogative. Specifically speaking, “Google” has admitted they have depended on Python in key aspects of their success. My guess is they have or currently use Python in web-crawling, indexing algorithms, and server/load balancing scalability possibly. Research it yourself, if you’d like. I’d encourage it. This is running a bit long, so I only will say one more thing: If its good enough for them, it’s good enough for me.

  13. Answer to Prashanth..
    Not even mastering C# or VB will get you job in Microsoft, or mastering Java get you job in IBM, or mastering Python will get you job in Google. All of them have their recruitment policies and requirements, If you are good in java or C# or Python its an advantage, that is you understand basic concept of programming.

    Languages are just a tool, Python can be the one but can’t be the only one. New technologies can appear any day like .NET and Flex did. Most of the servers have LINUX and most of the desktop have Windows, their are various cool things available, some peoples love playing with Blender with python scripting, some like to use python on server side, some prefer working with VB/Delphi and enjoy making win applications, some work hours on C because they love it and most of big names in this field are master of it.

    Its all upto you what you want to do, I also prefer Python for newbie.. at least it better than C or Java for new one, but if you are someone who only understand by attending classes then Java or C++ may be good. C is something which you should know about it even after you learned Python (in my view), C is not considered good for newbie for various reasons (that you can google), but its ok I learned that in college it, was my first language.

  14. I am not a complete “newbie” – I have done some basic programming in java (I finished one of those “21 day books doing all of the examples, and yes, I know they don’t make you a programmer!) and I have hacked together a few web pages using PHP. I understand the concepts of constants, variables, if/then statements, for loops, etc. and OO programming.

    Now I want to completely tackle a language. I am leaning towards C, as I understand it will give me a good foundation as a programmer (learning about memory management and lower level computing) and make other languages easier to learn. My concern with Python is that I already know the basics of programming so it might be a better use of my time to learn something lower level.


  15. I tried Python. It was fantastic. By the end of hour one, I had designed an extremely simple code that turned degrees celcius/farenheit and another to change it back. I should combine those…
    End of week 4 my friend and I were designing a simple text game (and a few other games). Python really is fun. :)

    But anyway, yes, highly reccommended.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s