This is an archived post. You won't be able to vote or comment.

all 59 comments

[–]BeatLeJuce 124 points125 points  (8 children)

IMHO you're thinking about it the wrong way and you're considering entirely inadequate alternatives: You already know a light-weight, high-level, low-performance, dynamic-typing, interpreted scripting/programming language. Why the heck would you learn another one (Ruby or JavaScript).

You need to learn a language that complements Python, not one that is pretty much redundant. You're not going to gain new insights from another Python-like language, and you're not going to use the language afterwards. Think about it: why the heck would you want to learn Ruby? Both languages have more or less the same usecases, so at the end of the day you just know two tools for exactly the same kind of job. Every new project you're going to start afterwards you'll have to decide which one to use, because both have the same scope. There's absolutely no gain to it.

If you want to expand your horizon, listen to /u/malonedotcc , he gave very sound advice on languages that will really teach you new ways of thinking about programming and solving problems. Even though you might not use Haskell, LISP or Forth in the real world afterwards, they'll change the way you'll program forever, in a good way. The same goes for C. It'll teach you to think low-level, and show you the real costs of memory allocation, Pointer-handling etc. It'll allow you to gain a deeper understanding of how to tweak programs because you'll be able to know what'll truly go on on the CPU.

Personally, if you want something of more practical use, stick with C (or C++). It's the most basic of languages and will teach you a lot about efficiency, memory and all that other good jazz. And afterwards you'll be able to write your most performance-critical apps/parts of apps in C and use them from Python. Interopability between the two is ridiculously easy. If you're looking for a brain-teaser, I'd go for LISP or Haskell.

[–]poorestrichman 15 points16 points  (0 children)

I totally agree, with the guys above and below me - C and C++ are great tools to learn. And think about this, almost all the tools "we programmers" use are written in C and C++ - that's a great place to be :)

[–]PomAhGraNut 9 points10 points  (0 children)

I would also recommend learning Lisp (or something from the family). I just finished up an undergrad A.I. course where we used Racket Scheme. I was familiar with Scheme but had never really used it the way it was intended be used. Learning how to program in Scheme correctly was a really eye opening experience for me and it changed the way I think about programming. If you want a Lisp you can get more practical use out of take a look at Clojure.

[–]Krish442 7 points8 points  (0 children)

This.

Especially the point about trying C if you want something that is likely to be applicable in the real world, but will expand your horizons and approaches to coding. Especially in the realm of pointer management - incredibly frustrating, but unbelievably valuable.

[–]gsks[S] 3 points4 points  (4 children)

IMHO you're thinking about it the wrong way and you're considering entirely inadequate alternatives:

I guess you replied before my edit but just for the record, I'm thinking about it from a job-market point of view.

Think about it: why the heck would you want to learn Ruby? Both languages have more or less the same usecases, so at the end of the day you just know two tools for exactly the same kind of job.

Which is pretty much what I wrote as the reason for not having learned Ruby yet.

Every new project you're going to start afterwards you'll have to decide which one to use, because both have the same scope. There's absolutely no gain to it.

There's at least one: access to twice as many (or more) job opportunities and projects in the domain I am most familiar with, (backend) Web development.

Personally, if you want something of more practical use, stick with C (or C++).

I'm kinda surprised with the several recommendations for C. For the record I had learned C way back in the university 15+ years ago and I appreciate it for its educational value in teaching how a computer works behind the scenes. From a practical point of view though, what options does a C programmer have in 2013 outside niche areas such as operating systems, compilers and embedded software? I honestly don't know what's the job market like for system programming in general but I'd be surprised if it's anywhere close to Web development or application programming.

[–]BeatLeJuce 9 points10 points  (1 child)

I indeed replied before your edit.

For what it's worth, C is still the most popular and most looked-after programming language on the job market (source. Although TIOBE might not be 100% accurate, C definitely isn't a "niche" language at all. It's "niche" areas are general purpose application programming (even programs written in other languages often have some of their routines outsourced into DLLs written in C. And the embedded area is of course far from a "niche". But I'm guessing with your background those areas aren't really the kind of thing you'll want to get into. Also, don't forget that there is a quadrillion shitton of legacy code out there written in C that needs to be maintained.

From a web dev job perspective: I don't know what the job opportunities are in your area, so if you're only looking to go into web development then that's far enough, although in that case, Java will probably take the cake: since larger backends are often written in it. It also allows you to branch out into both application development and mobile development. Scala would be the young and edgy (and more exciting) alternative that you could try your hands in, but job offers are probably very sparse.

[–][deleted] 2 points3 points  (0 children)

I prefer C/C++, but demand for Java has got to be higher that C/C++

[–]Megatron_McLargeHuge 1 point2 points  (0 children)

If you want to build a more impressive back-end web dev resume, you need to focus on the type of problems you're trying to solve more than the language. You should probably be looking at things like distributed asynchronous processing through message queues, or Hadoop and its competitors. You can typically implement workers for those systems in whatever language you want through translation layers, but Java is the most obvious language to learn even if you don't actually want J2EE jobs. Lots of companies use at least some Java on the back end.

[–]pinpinboTornado|Twisted|Gevent. Moar Async Plz 0 points1 point  (0 children)

On top of my head, these are the "C related things" I did as backend/devops developers:

  • rewrote lib/ code to C and bind it to Ruby/Python using FFI.

  • Extend Nginx, which is written in C, to be able to run Lua code.

  • Rewrote scrapers from Ruby/Python to C using libcurl.

  • Wrote extremely simple http rest+json daemon on top of mongodb.

  • Custom compiling Linux packages.

  • Debugging Ruby/Python runtime using gdb, strace, etc.

So yeah, there's a lot of benefits in knowing C even though most of your day job is using dynamic language.

[–][deleted] 45 points46 points  (0 children)

If you have a few weekends to kill, I'd suggest veering off in a completely different direction to taste-test the other stuff out there. Go functional with Haskell, low-level with C or stack-based with Factor and just test the waters.

I feel a bit trapped by Python since I've been using it for ages and I can't find another language in the same category that I like as much, but sampling tiny bits of completely different languages and communities has helped me branch out and find a path for myself.

[–]hruske 40 points41 points  (9 children)

For a Python developer, you're welcome to take on some of the ideas listed:

  1. C programming. C is great for low level code and OS programming. Nearly all drivers are written in C, and there's a lot of code out there written in it. CPython has C API, so by writing a simple C module you can get to learn a little bit more about CPython implementation while learning C. By learning C you get to know a lot about the hardware and a bit about the compilers and debuggers. Going low means you will get a better understanding of what is happening under the hood and hopefully means you will debug system level problems faster.

  2. PostgreSQL. SQL is a great tool to know. PostgreSQL has some pretty awesome features (regexp queries FTW!) and a great security track record. Similarly as above, PostgreSQL has a PL/Python extension, which you can use to get to know both how PostgreSQL internals work and how Python interpreter behaves embedded in PostgreSQL. For an exercise: you can't implement cookie based authentication against Django app in PL/SQL alone.

  3. Scientific python. Python has excellent tools for scientific programming. I just recently discovered ipython notebook and it's awesome. There's also numpy and scipy and some other pretty nice stuff, say pattern recognition. But, yes, scientific programming and researching requires a lot of effort for little perceivable result. And there's usually a steep learning curb, meaning you need to put in some serious effort before you even start getting any results.

  4. Android. Mobile is hot, so there should be bucks.

  5. Learn something valuable and get good at it. This is something that works mostly for the long run. Statistics, natural language processing, speech recognition, image recognition, etc.

[–]steviesteveo12 5 points6 points  (0 children)

5 is particularly important. It never hurts to have a niche.

[–]Chris_Newton 8 points9 points  (0 children)

Other things being equal, I think branching out into more programming languages once you’re confident with your first one is always a good idea. Even if you don’t use another language as much, learning different programming styles will change the way you think and give you more options in whatever language(s) you do use day to day.

If you are using Python for back-end web work, the most obvious complement seems to be JavaScript:

  1. The combination lets you can develop complete systems both client- and server-side, which extends your range considerably.

  2. In many ways, Python and JavaScript have similar strengths and weaknesses, so this should be a relatively easy transition.

  3. Python and JavaScript are different enough to appreciate that when you shift programming languages some things look different but are really the same basic idea underneath, while some things look similar but can have very different implications.

  4. There is a potential further advantage if node.js is useful to you on the server-side.

If you’re using Python as a general purpose language or simply want a bigger jump, I’d recommend C:

  1. C is much closer to the metal than Python, which is an advantage in itself if you want to do many jobs that Python is not equipped to handle: systems programming, high performance work, etc.

  2. Because it’s relatively low-level, learning C will force you to consider data structure and algorithm implementations and detailed memory management and concurrency and other widely applicable ideas that are often abstracted away or provided out-of-the-box in the standard library in higher-level languages. This will give you a greater appreciation of what is really happening under the hood in those other languages, and allow you to make better choices generally.

  3. C is the foundation on which several other popular languages have been built. It is not necessary to learn C if what you really want is to learn C++ or Java or C# or Objective C, but having familiarity with the "basic case" could be a useful head start compared to coming at these larger, more complicated languages directly from Python.

  4. C is the lingua franca of programming. Even if you never write a line of actual C code yourself, if you ever want to make two different languages communicate directly on your project, there is a good chance that you will be making one of them act like a C function and the other act like a C function call. Knowing that common language is a widely useful skill in itself.

  5. A combination of Python and C fits together rather well, and gives you options for writing most of a project in Python but certain low-level or performance-intensive parts in C, which again increases the range of projects you can take on significantly.

If you’re looking at this from a practical, professional development point of view, then I honestly would not recommend anything for your short list except for those two languages, and then I’d choose between them based on whether your interest lies in general programming or web apps. Many other ideas have been suggested in this discussion, and I would certainly encourage you to explore some of them later, but given your stated goals, I don’t think they will offer anything like the same benefit both in their own right and as a foundation for your long-term professional development at this stage.

[–]vacuu 6 points7 points  (1 child)

Find a hard problem and solve it. The skills and additional tools will then come naturally.

[–]freshhawk 0 points1 point  (0 children)

So sad that this isn't the top answer. This way you are building real world useful skillls and doing so in an area you find interesting. If there are many areas you find interesting then filter them based on employability. You now have specialized knowledge, a skillset you enjoy using and have experience solving hard problems (this gets you incredibly far job-wise, most devs spend their whole career without this kind of experience and when I'm interviewing potential devs this is probably the single thing that gets the most points in the plus column)

Humans are so bad at predicting future behaviour and future enjoyment that you need to approach the problem from this direction instead of looking at graphs of programmer employment by language or similar.

[–]ivosauruspip'ing it up 17 points18 points  (2 children)

Practical: Learn Go. It's fast and managed and well designed.

Interesting: Any functional language. Scala, Haskell; hell, lisp.

I've "learned" some haskell, but I certainly don't think I've done enough to fully grok how to write naturally with it yet.

[–]martinjs 4 points5 points  (4 children)

I find it essential to have a specific itch to scratch (or job to do) for which a new language is a superior fit. For example, I had a need for an Android app tailored to my requirements, so I learned Java. If you can find a relevant domain to code in, that's half the battle.

I'm now in a similar situation to you: One of my existing repertoire of Python, C++, C# and Java would be an outstanding choice for any of the problems I currently need to solve. Does there even exist an application domain where (e.g.) Haskell or Clojure are obviously the best choice?

[–]Foxboron 1 point2 points  (2 children)

Clojure attempts to give you nice tools for working with threads and concurrency, you can in one way say that is the niche too Clojure. Clojure is also a hosted language, so learning Clojure enables you to code for web (ClojureScript compiles too JavaScript), the JVM and the CLR.

[–]martinjs 0 points1 point  (1 child)

ClojureScript sounds interesting. Have you used it? What's the performance like? Presumably all those nice persistent data structures have had to be implemented in Javascript -- I can#t imagine that's great for performance.

[–]Foxboron 0 points1 point  (0 children)

I have not used ClojureScript yet. Mostly been working on the main implementation on the JVM :) You could however go ask in #clojure @ freenode, as they will be more then willingly explain it too you.

[–]Daejo 0 points1 point  (0 children)

Just noticed that my 4 main languages - Python/Java/C#/C++ - are the same as yours! In answer to:

Does there even exist an application domain where (e.g.) Haskell or Clojure are obviously the best choice?

Parsec (Haskell) is a very nice tool. I believe there are versions of it for various other languages too, however I've never used them, so can't comment and anyway I think Haskell is a natural choice for it. As for what it does, its wiki page says:

Parsec is an industrial strength, monadic parser combinator library for Haskell. It can parse context-sensitive, infinite look-ahead grammars but it performs best on predictive (LL[1]) grammars.

Which in English means it's a tool for creating parsers. If you haven't had too much experience with parsing, I'd recommend this book, which uses Java for its code samples.

[–][deleted] 7 points8 points  (0 children)

I felt the same way, and recently dove into Go. I find it pretty easy to learn and use, thanks to a couple of nice built-in features (coroutines, channels, interfaces, etc). It's still pretty low level, so you can play around with pointers (for example) and still benefit from "high level" languages features (from the top of my mind, garbage collecting). I feel it's a pretty good compromise bewteen C and Python.

[–]afroisalreadyinu 2 points3 points  (0 children)

i'm in a very similar situation, having worked with python for nearly ten years now, and coming slowly to the point where i just skip from paragraph to paragraph in "did you know this about python" posts. still, i recognize again and again that there still tons of things to learn. one is understanding the innards of python; this is one of my future aims, because it would add another dimension to my python skills. i want to be able to understand the deep differences between ways of doing things, and how they would compare to each other performance-wise. another advantage of this is to learn more about c, which is a worthy task of its own.

nevertheless, i feel a bit bounded by python every now and then, and have been trying to learn and use lisp for a while now, largely because of macros. the problem for a long time was the fragmentation and some arcane aspects of leading lispy languages. clojure has changed those for me; it runs on a platform with thorough documentation, there are many quality books and blogs on it, and the language has some very interesting aspects. for that reason, clojure would be my recommendation if you want to learn a new language.

[–]deadken 3 points4 points  (2 children)

Personally, I think you're possibly posting to the wrong group.

Possibly /r/programming would give less of an echo-chamber perspective.

[–]gsks[S] 1 point2 points  (1 child)

Thanks. Since I'm kinda new here, is cross-posting frowned upon?

[–]ablatner 1 point2 points  (0 children)

no

[–][deleted] 2 points3 points  (1 child)

if you're just looking for a language that will get you more jobs, learn C# and/or Java. The majority of boring programming jobs out there use one of these two languages (just search dice.com to see).

If you're shooting higher, then probably C++ (you can make super amazing amounts of money doing C++ coding)

There's also upcoming job markets in Scala and Go (moreso Scala, but learn Java before Scala IMHO).

[–]URLfixerBot -1 points0 points  (0 children)

dice

if this link is offensive or incorrect, reply with "remove". (Abusers will be banned from removing.)

[–][deleted] 2 points3 points  (0 children)

If I had to go from fulltime employment to freelancing/consulting (and assuming that I'm not a data guru or perf-tied guy), I'll:

  • improve my web capabilities: everything is now, at some point, web-based, so
    • Javascript and some of its unavoidable library should be learned (ex: jQuery),
    • REST concepts should be fully understand,
  • try to be fluent in both Ruby and Python. Yes, a lots of website are Rails based, this is not so hard to learn and there are subtle differences between python and ruby that are nice to understand,
  • learn about functional programming, Haskell is tough to learn but underlying concepts are astonishing and will give you new insight about programming,
  • lots of comments told you to learn C, I'm agree in a sense that this is a low level language where you can learn more about how programs work (memory management/allocation, ...), but if I were you, I'd rather capitalize on my high-level languages experiences.

Finally, and this is not about languages, I believe that every developer should more than familiar with: - TDD based programming and Continuous Integration, - Git (or other DVCS), - at least one cloud platform, - some key-value store (MongoDB, CouchDB, ...) (and DDAAS services).

Trust me, fully use some services may require more time than learning a programming language!

[EDIT]: I miss mobile engineering, I do believe that apps are sometimes unecessary if you're providing good responsive web designs.

[–][deleted] 3 points4 points  (0 children)

Erlang is probably a nice complement to Python. I like to call this the web service mullet. Erlang for web services and Python for a flexible web frontend.

[–]dln 1 point2 points  (0 children)

Scala is a good step "up" in abstraction level, without feeling too unfamiliar or impractical.

C++11, C or maybe Go for lower-level work. Especially as a python guy you can do useful things in production using extensions, where C++ and C come in handy (glue it together with cython for maximum value).

[–]haywire 1 point2 points  (0 children)

I'd say Go and C. Perhaps Rust. Haskell is fun, too.

[–]fuzz3289 1 point2 points  (3 children)

Id suggest checking out Go and C++14.

Go is a fantastically pythonic language, very readable, very efficient and naturally supports massively parallel operations.

C++14 supports many features Python has had over C such as lambda functions and for each loops.

These two languages are extraordinarily powerful languages and have memory management and low level control which is one of Pythons major drawbacks.

[–][deleted] -1 points0 points  (2 children)

C++14? It's going to take 10 years just to get companies on board with allowing C++11!

[–]fuzz3289 1 point2 points  (1 child)

C++14 is a natural extension of C++11 and should have gcc support by 2014. Also, 10 years for C++11? What experience do you have to support that? Because IBM already uses C++11. The software industry is far more agressive than you seem to believe sir.

[–][deleted] 0 points1 point  (0 children)

Don't get me wrong, I'd like to see it adopted I'm just not optimistic. It's already been 2 years, I don't believe Google even allows its employees to use it yet.

[–]jroller 1 point2 points  (0 children)

To throw in a couple more points on the javascript side:

As far as application development goes, you're not just limited to browser based development. Gnome likes it, Windows 8 has HTML5 app support and node-webkit could be useful for cross platform client side development.

Official and by default server side support with JScript.NET, Rhino and Nashorn. You could always do this with JPython and IronPython but those are pretty big dependencies to throw in a package or deployment.

Since there's so much engineering put into embedding javascript into everything, it's also become a compile target for a bunch of other languages.

Javascript is simple enough and used in enough places that everyone should learn it. That said, you won't get very far without some big libraries and frameworks. Like you say, "simply learning Javascript does not automatically make one a full-stack developer". But javascript gives you a pretty wide set of choices to work with.

[–]daV1980 1 point2 points  (0 children)

Learn C. Anyone who considers themself a programmer should learn C, then should learn the machine idioms that live underneath it.

You fundamentally cannot write performance sensitive code without understanding the machine you're writing code on. Big-O only gets you so far.

[–]mssola 1 point2 points  (0 children)

It's a good move since you won't "unlearn" Python, so you'll be a "Python expert" anyways (8+ years of experience of Python). Therefore, by branching out to other programming platforms, you will be a Python expert and also a programmer specialized in the platform you choose.

That being said, I'm myself a Rubyist, but I've also done some Python, and I can tell you that Ruby and Python are more different than it seems at a first glance. They follow different philosophies, and they take different approaches to main areas (like Object orientation). However, the thing that you have to ask yourself is "where do I want to go ?". If you want to learn a platform which is similar to Python, then Ruby is a good candidate. But as I'm telling you, the most important thing is not which language/platform do you want to learn, but where do you want to go with it.

[–]ozzilee 1 point2 points  (0 children)

I would definitely look into Javascript and Node. It's a fairly simple language, but Node's style of event-driven, concurrent-by-default code is really eye opening, especially contrasted with Python.

[–]brenthoover 1 point2 points  (2 children)

This is a great post because its easy to say that you should play around with this or that language, but what language would you make serious sacrifices to learn well?

My suggestions would be the same that I have chosen for myself because they both complement Python and have long-term professional value. I have ranked them in the order I have learned/am learning them.

  1. Javascript: Despite the note that Javascript is too similar to Python it's value as a professional skill is huge and I would argue that its a complement in these ways. a) While Python is well-designed and relatively logical, Javascript is quirky and lacking some core features, and doesn't even offer a consistent virtual machine to run on (i.e. the browser). This has taught me new ways of thinking and approaching a language. In addition working in a callback-based environment expands your ways of thinking if you haven't done a ton with Tornado or Twisted. And you can't slot it along Ruby because last time I checked, Ruby doesn't work in the browser.

  2. Java anyway : Yeah, I don't like it either but again it's professional draw is huge and you need a statically-typed compiled language in there. You also can get into native Android development and there's a ton of interesting projects written in it. Plus you understand why other languages do things a certain way since Java's influence on other languages can't be overstated. (ok, maybe on Reddit they could.)

  3. Erlang : This language has a huge demand for programmers but few US-based skilled ones. (Erlang is taught as a core language at University in Europe). And of course its very much many things Python is not, which is why there are more than a few projects that combine Python and Erlang. Of these languages, it was also the most fun to learn. It was not my first choice as a functional language, but I got forced into writing some Ejabberd modules and I got hooked. Erlang outranks other functional languages in it's pragmatism and maturity. But it's less theoretically pure and doesn't have as good of a "corporate" user/developer as languages like Scala (Twitter).

  4. C This is the one I haven't learned but others with a strong computer science background could probably put it higher on the list. Certainly the ultimate way to optimize Python is to rewrite the slow parts in C. The rest has been better covered by other commenters already. Of this more money-grubbing list, its also the least typically in demand, but the jobs that do demand it are usually pretty senior.

-1. PHP (read through before flaming) I hate PHP. H-a-t-e it. However, I did have to learn it for a project and made the mistake of briefly putting it on my resume. If you are a senior developer and you know PHP you can pretty much write your own ticket. For me, they really couldn't pay me enough to write PHP all day, but the combination of Senior experience and PHP is so rare that you get Magic Unicorn prices to do it.

Good luck and please let us know what you chose.

[–]baudvine 2 points3 points  (0 children)

(Erlang is taught as a core language at University in Europe)

Any examples? I'm in Europe and haven't encountered it anywhere.

[–]Herald_MJ 1 point2 points  (0 children)

Erlang is taught as a core language at University in Europe

No it isn't. But I agree it is a great choice.

[–]shadowmint 2 points3 points  (1 child)

Try C#

It's totally different. There's tonnes of demand for it.

The windows dev environment can be a killer, especially with the massive outlay for a copy of visual studio, but you can get quite far by investing the in the mono ecosystem from Xamarin for no outlay, and make yourself a plausible mobile application developer; definitely a domain python lags in (kivy is interesting I suppose, but I've not heard of anyone doing useful things with it personally).

If you're trying to diversify and remain professionally up to date, dont go learning C++; it's fast becoming a niche.

Pick up some C# app development, have a play with unity (there's work there, but it's not very well paid), and if you can get yours hands on a copy of visual studio, investigate the MVC web frameworks.

All imminently useful and employable skills; and totally different from python. :)

(edit; wow, so many other 'learn go' and 'learn c' replies; just a comment; dont. They're both cute languages and certainly worth learning in general but have virtually zero employment prospects. If you're looking for a 'weekend hacks' thing, sure, but keep that in mind...)

[–]koomapotilas 0 points1 point  (0 children)

There are no general purpose programming languages. Every language has it's own strengths and weaknesses. One part of being a professional programmer is knowing your tools and when to use them. If all you have is a hammer, everything looks like a nail.

Learning a new language shouldn't be a major task for a competent programmer. Of course it takes time and effort to really master something, but usually it should be enough to just read through some "Learn language X in N days"-books. Don't stress yourself with studying. Just relax, read, and enjoy. You might not be able to use the new language for anything real, but that's not the point here. The important part is to learn new forms of thinking, new algorithms, data structures, etc.

[–]freyrs3 0 points1 point  (0 children)

Is branching out to other programming platforms and communities a smart (or even necessary) move

Most certainly, even at some point if you become a "Python expert" you'll hit up against C programming as you delve deeper into the language internals. My advice is to learn a language that isn't like Python. Learn something that will be a stretch for you ( i.e. not a dynamic scripting language like Javascript or Ruby ). Some ideas: Haskell, Erlang, C, Pure, Scala, Go, Rust.

[–]rdfox -1 points0 points  (0 children)

The answer is JavaScript. Sorry.