{"id":1246,"date":"2011-05-20T11:56:17","date_gmt":"2011-05-20T18:56:17","guid":{"rendered":"http:\/\/gregbaker.ca\/blog\/?p=1246"},"modified":"2011-05-20T11:56:17","modified_gmt":"2011-05-20T18:56:17","slug":"what-programming-language-should-i-learn","status":"publish","type":"post","link":"http:\/\/gregbaker.ca\/blog\/2011\/05\/20\/what-programming-language-should-i-learn\/","title":{"rendered":"What programming language should I learn?"},"content":{"rendered":"<p>I recently had a former CMPT 165 student email me and ask essentially if Python was the best language to learn [first] from a practical\/employment standpoint. This was my response, that I think was good and would like to expand on here:<\/p>\n<blockquote><p>Certainly the traditional view of the world is &#8220;C\/C++\/Java for big projects or where speed matters; higher-level languages like Python\/Perl\/VB for smaller projects or automation.&#8221;  Certainly many of my colleagues continue to see the world in this way.<\/p>\n<p>The programming language world has changed in some subtle ways in the last few years and I don&#8217;t think that attitude is really valid anymore.  If I was starting a big project today (like writing a word processor or something), I would probably start with Python (or something similar): it&#8217;s easier to write and get things done and it&#8217;s possible to bridge to code in Java or C if you need to.<\/p>\n<p>If I had to honestly summarize the world today, I&#8217;d say &#8220;C++\/Java\/C# for big companies who want to make a &#8216;safe&#8217; choice of programming language; Python\/Ruby\/JavaScript\/Scala\/etc on smaller projects where the developers make the choice and want to get things done and enjoy their lives.&#8221;<\/p>\n<p>A few footnotes on that: (1) the result is there are probably more Java\/C# jobs in the world than other languages; (2) the Python\/Ruby\/Javascript jobs tend to be in smaller companies and are probably more fun; (3) after you learn to program, learning a new language isn&#8217;t nearly as big a deal as learning your first&#8211;most of the concepts are always the same.\n<\/p><\/blockquote>\n<p>By &#8220;the programming language world has changed in some subtle ways&#8221;, I mean mostly:<\/p>\n<ol>\n<li>Languages we always though of as &#8220;slow&#8221; have been made shockingly fast by just-in-time compilers like <a href=\"http:\/\/code.google.com\/p\/v8\/\">V8<\/a> and <a href=\"http:\/\/pypy.org\/\">PyPy<\/a>.<\/li>\n<li>Mixing languages in a project (e.g. calling C from Python, or using one language&#8217;s standard library from another) seems, to me at least, to be an easier and more mainstream thing to do if you need to.<\/li>\n<li>Frameworks\/libraries are used much more heavily. If you spend 90% of your time calling some GUI library, the speed of your code doesn&#8217;t matter much: the speed of the GUI library is what matters. (And, who&#8217;s to say the library is written in the same language you&#8217;re writing?  See 2.)<\/li>\n<li>C isn&#8217;t the &#8220;fast&#8221; language anymore. That&#8217;s probably more controversial, but basically, C is really good at single-threaded performance, but multithreading and heterogeneous processor environments are a real pain. Today&#8217;s reality is that new processors aren&#8217;t improving single-treaded speed by very much. Those who want their computation to happen really, really fast seem to be increasingly reaching for computation-specialized tools like <a href=\"http:\/\/en.wikipedia.org\/wiki\/Go_%28programming_language%29\">Go<\/a>, <a href=\"http:\/\/en.wikipedia.org\/wiki\/OpenCL\">OpenCL<\/a>, or <a href=\"http:\/\/en.wikipedia.org\/wiki\/Apache_Hadoop\">Hadoop<\/a>. It turns out that the explicitness of C starts to become a burden if you have to smack the mutexes around by hand.<\/li>\n<\/ol>\n<p>My assertion that &#8220;C++\/Java\/C# for big companies who want to make a &#8216;safe&#8217; choice&#8221; is really just a gut feeling.  I understand and even agree with the desire for static typing in a huge project, but I honestly don&#8217;t think that&#8217;s why companies choose Java or C#. Companies choose these language because they are enterprisey: they are the kind of language that checks all of the CIO&#8217;s boxes and have comforting professional certifications that the HR department can look for.<\/p>\n<p>Also, big companies probably think Oracle&#8217;s ownership of Java is a good thing. They haven&#8217;t reached the conclusion that I (and I suspect many others have): Oracle will slowly strangle the life out of Java until it truly becomes <a href=\"http:\/\/nullpointers.wordpress.com\/2009\/04\/05\/is-jave-the-new-cobol\/\">the new Cobol<\/a>.<\/p>\n<p>So where does that leave us?<\/p>\n<p>You might as well look for a language that&#8217;s (1) fun to write, and (2) easy to actually get shit done with. For me that&#8217;s Python, but I can certainly accept Ruby, Lua, Scheme, and friends.  I could accept PHP and VB (if I had enough drinks in me) or even C# and Java (if you had an explanation grounded in the language design\/features and didn&#8217;t contain the words &#8220;enterprise&#8221; or &#8220;corporate&#8221;).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently had a former CMPT 165 student email me and ask essentially if Python was the best language to learn [first] from a practical\/employment standpoint. This was my response, that I think was good and would like to expand on here: Certainly the traditional view of the world is &#8220;C\/C++\/Java for big projects or [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,12],"tags":[],"class_list":["post-1246","post","type-post","status-publish","format-standard","hentry","category-tech","category-work"],"_links":{"self":[{"href":"http:\/\/gregbaker.ca\/blog\/wp-json\/wp\/v2\/posts\/1246","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/gregbaker.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/gregbaker.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/gregbaker.ca\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/gregbaker.ca\/blog\/wp-json\/wp\/v2\/comments?post=1246"}],"version-history":[{"count":17,"href":"http:\/\/gregbaker.ca\/blog\/wp-json\/wp\/v2\/posts\/1246\/revisions"}],"predecessor-version":[{"id":1263,"href":"http:\/\/gregbaker.ca\/blog\/wp-json\/wp\/v2\/posts\/1246\/revisions\/1263"}],"wp:attachment":[{"href":"http:\/\/gregbaker.ca\/blog\/wp-json\/wp\/v2\/media?parent=1246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/gregbaker.ca\/blog\/wp-json\/wp\/v2\/categories?post=1246"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/gregbaker.ca\/blog\/wp-json\/wp\/v2\/tags?post=1246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}