Just fin­ished watch­ing an inter­est­ing sem­i­nar video by the guys from Object Men­tor (a con­sul­tant com­pany founded by Robert C Mar­tin, the father of agile devel­op­ment) at:

http://www.infoq.com/presentations/polyglot-polyparadigm-programming

The video is about an hour long and cov­ered a large num­ber of top­ics around using dif­fer­ent lan­guages (poly­glot) and dif­fer­ent pro­gram­ming par­a­digms (poly-paradigm) to sim­plify and speed up the soft­ware devel­op­ment process. The main thing I took away from this was:

“Less code is bet­ter, so less code is more. With less code, all your prob­lems become smaller, be it main­te­nance, test­ing or performance.”

which most devel­op­ers would agree I’m sure, after all, one of the rea­sons we refrac­tor our code is so we end up with less code.

For young devel­op­ers like myself, we have come into soft­ware devel­op­ment in an era dom­i­nated by the object ori­ented par­a­digm and a small hand­ful of main­stream OO lan­guages like C++, C# and Java. So for me at least, it’s refresh­ing to see how other par­a­digms and lan­guages can be used in con­junc­tion with those I’m famil­iar with to achieve:

  • greater pro­duc­tiv­ity from the developers
  • more agile and exten­si­ble solution

Sum­mary:

If you don’t have the time to watch the video (or sim­ply not inter­ested enough to do so!) then hope­fully the list of key points I’ve com­piled together would at least give you some idea what it’s all about:

  • There’s no sil­ver bul­let in soft­ware development
  • OO par­a­digm not always the best solu­tion for the problem
  • Statically-typed lan­guages (C#, C++, Java, etc.) are com­piled for greater speed and effi­ciency at the cost of low­er­ing productivity
  • Dynamically-typed lan­guage (ruby, python, JavaScript, etc.) are inter­preted for greater exten­si­bil­ity, agility and pro­duc­tiv­ity at the cost of low­er­ing run­time per­for­mance
  • Ola Bini’s Three lay­ers – Domain layer (Domain Spe­cific Lan­guages), Dynamic layer (JRuby, etc.) and Sta­ble layer (Java, C#, etc.)
  • Script­ing lan­guages increases pace of development
  • Aspect-oriented pro­gram­ming makes it eas­ier to deal with cross-cutting con­cerns
  • Func­tional pro­gram­ming makes con­cur­rency eas­ier, because:
    • func­tions are side-effect free and stateless
    • noth­ing to syn­chro­nize, so no locks, sem­a­phores, mutexes
  • Func­tional pro­gram­ming is cloud com­put­ing friendly
  • Func­tional lan­guages and DSLs are more declar­a­tive than imperative
  • Scala is cool!
  • Advan­tages of the poly­glot and poly-paradigm approach are:
    • able to use the best tool for a par­tic­u­lar job
    • min­i­mize the amount of code required and keep them closer to the domain
    • bet­ter decou­pling between components
  • Dis­ad­van­tages of this approach are:
    • mul­ti­ple tools, lan­guages, libraries to man­age and learn
    • need to man­age the dif­fer­ent meta­data mod­els and over­head of calls between languages
  • It’s noth­ing new! For exam­ple, web devel­op­ers often have to work in dif­fer­ent par­a­digms and lan­guages on a website
  • Higher end-user expec­ta­tions and tighter sched­ules are dri­ving the pop­u­lar­ity of higher level lan­guages such as func­tional and script­ing languages
  • Devel­op­ers have to deal con­text switch­ing between dif­fer­ent lan­guages, so as the appli­ca­tion grows larger and more com­plex, you have to start par­ti­tion­ing the teams (should be sec­ond nature to those work­ing in the enter­prise world!)

Part­ing thoughts..

As the pre­sen­ter stated sev­eral times through­out, poly­glot and poly-paradigm pro­gram­ming (PPP) has all been done before (despite now being men­tioned with unfa­mil­iar ter­mi­nolo­gies), and I cer­tainly see a lot of famil­iar­ity of it in my line of work where in a typ­i­cal 3-tiered appli­ca­tion you’d have:

  • the data access layer using SQL (rela­tional paradigm)
  • the busi­ness layer writ­ten in C#/Java or other OO languages
  • the UI can be in any num­ber of dif­fer­ent lan­guages or par­a­digms depend­ing on its form (HTML/CSS/Java/C#, etc.)

and numer­ous script­ing lan­guages (Perl, for exam­ple) are also used in var­i­ous places (hell, after all, there are over 5000 appli­ca­tions being actively used within Credit Suisse alone!).

Watch­ing this video has helped me iden­tify with what I already know and put names (poly­glot, poly-paradigm) to famil­iar faces (which is why jar­gon are impor­tant and I keep blog­ging about buzz­words :-P ), watch it, and see if it can help you too.

Fur­ther readings:

Ola Bini’s blog post on writ­ing dif­fer­ent lay­ers of code in dif­fer­ent languages

Share

Leave a Reply