Joy of Pro­gram­ming: What Lan­guage Should You Learn Next?

Prior to learn­ing a new pro­gram­ming lan­guage, try and an­swer a few im­por­tant ques­tions. Thought­ful in­tro­spec­tion will en­sure that you get the most out of what you learn – both per­son­ally and pro­fes­sion­ally.

OpenSource For You - - CONTENTS - Ganesh Sa­marthyam

Ear­lier, it was pretty easy to de­cide what lan­guage to learn next. For ex­am­ple, dur­ing my col­lege days in the 90s, the choice was sim­ple - learn C and C++ (though they used to teach For­tran, Cobol, Ba­sic and Pas­cal in my col­lege as part of the cur­ricu­lum). Then it was Java. On my own, I dab­bled with lan­guages like Smalltalk, Ob­jec­tive-C, Groovy, C#, Go, Prolog, Mo­dula, OCaml and Dy­lan. It was fun play­ing around with these lan­guages. But I also wanted to know about the real-world ex­pe­ri­ences in learn­ing and us­ing dif­fer­ent lan­guages. So, I talked to some of my friends who work in the soft­ware in­dus­try and asked them to share their ex­pe­ri­ences in learn­ing and us­ing new lan­guages for their reg­u­lar work.

A friend, who is in­volved in big data, an­a­lyt­ics and cloud com­put­ing, is learn­ing and us­ing Scala for his work. Scala is a lan­guage that tar­gets the Java plat­form; it merges both ob­ject-ori­ented and func­tional fea­tures. Be­cause of its func­tional ca­pa­bil­i­ties, Scala is good for writ­ing con­cur­rent code and for analysing large quan­ti­ties of data. He rec­om­mended learn­ing the lan­guage if I worked in this field, but also warned about the un­read­able code one can end up with when writ­ing in Scala.

An­other friend works on de­vel­op­ing soft­ware for the fi­nan­cial do­main and is cur­rently learn­ing Groovy, which has the pro­duc­tiv­ity of script­ing lan­guages in Java-like syn­tax. In fact, Groovy is more or less a su­per­set of Java. Since he is a Java pro­gram­mer and wanted to be­come more pro­duc­tive, he started learn­ing Groovy, which also has metapro­gram­ming ca­pa­bil­i­ties and, hence, is one of the pop­u­lar choices to write Do­main Spe­cific Lan­guages (DSLs). Though he is happy about be­com­ing more pro­duc­tive with Groovy, he is also frus­trated about hav­ing to spend quite a bit of time de­bug­ging Groovy code (which took away some of his pro­duc­tiv­ity gains).

An­other old friend of mine had an un­usual tran­si­tion from fix­ing bugs in a C/C++ com­piler to pro­gram­ming the Web us­ing JavaScript! She is ex­plor­ing a grow­ing list of lan­guages like Dart and Type­Script that are try­ing to re­place JavaScript. How­ever, she finds Cof­feeScript to be a sweet-spot, since Cof­feeScript com­piles to JavaScript and she can seam­lessly use her ex­ist­ing JavaScript code and third- party li­braries in it.

Sug­ges­tions for learn­ing new lan­guages based on real- world ex­pe­ri­ence in­clude: Clo­jure (with a warn­ing not to give up learn­ing be­cause of its Lisp syn­tax), Ruby and Python (for a wide range of pro­gram­ming tasks—from au­to­ma­tion to Web pro­gram­ming), and Scala (for con­cur­rent pro­gram­ming).

To try out new lan­guages, I re­cently bought a book ti­tled ‘Seven Lan­guages in Seven Weeks’ (Bruce A Tate, The Prag­matic Book­shelf, 2010). It is an ex­cel­lent book that gives you a quick over­view of the fol­low­ing seven lan­guages: Ruby, Io, Prolog, Scala, Er­lang, Clo­jure and Haskell. I highly rec­om­mend this book to any­one who en­joys pro­gram­ming and wants to learn a new lan­guage. I liked Ruby in this list, but when I checked with my friend who read the same book, he said he liked Scala and Clo­jure. Think­ing about what lan­guage one should learn next, I re­alised that this is a deeply per­sonal mat­ter. Just like pref­er­ences for dif­fer­ent cuisines and brands dif­fer from per­son-to-per­son, choos­ing a pro­gram­ming lan­guage de­pends on an in­di­vid­ual’s per­sonal likes and dis­likes, pref­er­ences and the kind of work one does. Hence, be­fore de­cid­ing on which lan­guage to learn next, se­ri­ously con­sider the fol­low­ing fac­tors.

How much time can you af­ford to spend on learn­ing a new lan­guage?

Learn­ing a new lan­guage in an en­tirely new par­a­digm will re­quire more ef­fort and time from you. For ex­am­ple, if you are a sea­soned Java de­vel­oper and write Java code on a dayto-day ba­sis, a good choice will be to learn Groovy, since you can seam­lessly switch back and forth be­tween Java and Groovy. So you don't need to ded­i­cate time ex­clu­sively to learn­ing Groovy.

Does the new lan­guage help you solve your prob­lems more ef­fec­tively?

A friend of mine, who was a Java de­vel­oper, wanted to de­velop an en­gine for im­ple­ment­ing busi­ness rules. Hear­ing about the use of Prolog in rule-based sys­tems, he started learn­ing it. He fell in love with the un­usual way that he could think and solve prob­lems in this log­i­cal pro­gram­ming lan­guage, which is best suited for solv­ing his prob­lems and was happy that he tried it. When choos­ing your next lan­guage, think about the prob­lems you need to solve, and see if it is in sync with the un­der­ly­ing prob­lem-solv­ing ap­proach of your new pro­gram­ming lan­guage.

Does the new lan­guage match your way of think­ing?

A friend of mine has a PhD in com­puter science and has a math­e­mat­i­cal bent of mind. He came to know about a lan­guage called APL (A Pro­gram­ming Lan­guage), which sup­ports math­e­mat­i­cal no­ta­tion. He liked the idea of ‘no­ta­tion as a tool of thought’ and started learn­ing it. I wasn't con­vinced about his idea of learn­ing an es­o­teric lan­guage like APL till he demon­strated his power to solve some real prob­lems with one-lin­ers (that would nor­mally take tens of lines solv­ing in main­stream lan­guages like Java)! Since the APL way of think­ing matched my friend’s mind­set, he loved the lan­guage and could make the best use of it, be­com­ing hy­per­pro­duc­tive in solv­ing his prob­lems.

Does the new lan­guage help you think dif­fer­ently?

Learn­ing a new lan­guage should help you think dif­fer­ently. Note that ‘think­ing dif­fer­ently’ does not con­flict with my pre­vi­ous point on the lan­guage match­ing your way of think­ing - un­less you try a dif­fer­ent way of think­ing and prob­lem-solv­ing, how do you know if it matches your way of think­ing, right! If you are a pro­gram­mer with ex­po­sure to stat­i­cally typed lan­guages such as C and Java, try a dy­nam­i­cally typed lan­guage such as Smalltalk and Ob­jec­tive-C. If you know only ob­ject-ori­ented lan­guages such as Ruby or C#, try log­i­cal or func­tional lan­guages such as Prolog or Clo­jure. If you have used only graph­i­cal lan­guages like Vis­ual Ba­sic, try learn­ing a script­ing lan­guage to au­to­mate your tasks, such as Python and Perl. When you try dif­fer­ent ap­proaches to solv­ing the same prob­lem, you’ll find that there are of­ten eas­ier and bet­ter ways to solv­ing the same prob­lem (and hence this will help you be­come more pro­duc­tive).

Does the new lan­guage ex­cite you?

When I was talk­ing to a friend who was learn­ing Clo­jure, I couldn't re­sist notic­ing his ex­cite­ment about dis­cov­er­ing the ‘Lisp’ way of think­ing and solv­ing prob­lems. When I tried Clo­jure, I only got frus­trated (not ex­cited). Hence, be­fore you de­cide to take the leap and spend months or years learn­ing a new lan­guage, do check if learn­ing that new lan­guage ex­cites you.

Never be­fore in the his­tory of com­put­ing have we had so many choices be­fore us. For ex­am­ple, as I write this ar­ti­cle, I see a mail pop­ping into my in­box about Red­Hat an­nounc­ing the re­lease of its new lan­guage named Cey­lon. We are also at a point of tran­si­tion - the erst­while main­stream lan­guages like Java, C, C++, etc, were de­signed for the old era. In this decade in which com­put­ers are shrink­ing to the size of a but­ton, the In­ter­net is be­com­ing ubiq­ui­tous, com­put­ing is be­com­ing a paid and per­va­sive ser­vice, and data is grow­ing to the or­der of ex­abytes, the dom­i­nant lan­guages will be com­pletely dif­fer­ent. More than any­thing else, learn­ing a new lan­guage is fun! So what are you wait­ing for - go ahead, care­fully choose, and then en­joy learn­ing a new pro­gram­ming lan­guage! The au­thor is a free­lance cor­po­rate trainer, con­sul­tant and au­thor based in Ben­galuru. His lat­est book is ti­tled ‘Or­a­cle Cer­ti­fied Pro­fes­sional Java SE 7 Pro­gram­mer Ex­ams 1Z0-804 and 1Z0-805’ and pub­lished by Apress (2013). You can reach him at­marthyam at gmail dot com.

Newspapers in English

Newspapers from India

© PressReader. All rights reserved.