• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Codemotion Magazine

Codemotion Magazine

We code the future. Together

  • Discover
    • Live
    • Tech Communities
    • Hackathons
    • Coding Challenges
    • For Kids
  • Watch
    • Talks
    • Playlists
    • Edu Paths
  • Magazine
    • Backend
    • Frontend
    • AI/ML
    • DevOps
    • Dev Life
    • Soft Skills
    • Infographics
  • Talent
    • Discover Talent
    • Jobs
  • Partners
  • For Companies
  • IT
  • ES
Home » Backend » Programming Languages: how to choose the best one
Languages and frameworks

Programming Languages: how to choose the best one

An overview of the main features to choose which programming language is most suitable for our needs.

January 29, 2020 by Paolo Caressa

Table Of Contents
  1. To program is to communicate
  2. Comparing programming languages
  3. Programming paradigms

Programming languages are a favorite subject of debate among developers. Each developer has precise and sharp ideas about:

  1. which programming language is the best to solve any kind of problems;
  2. which programming style is the correct one to develop effective programs;
  3. which is the best way to arrange brackets, semi-colons and all that in a piece of code.

One of the striking features of Dr. Subramaniam’s talk, held at Codemotion Rome 2019, was to show how much such matters are negligible in the first place.

His approach, engaging and entertaining, is that programming is a practice activity, a living one, and it is an incarnation of problem solving. Moreover, actual coding is a small part of the game when developing a project, but tools used to program have a strong influence on the final result and the main tool of a programmer is the programming language he/she codes in.

To program is to communicate

A programming language is essentially a tool to communicate between programmer and machine and a form of expression just as other kinds of languages. Therefore, to program is to communicate, and as such programming is neither a science nor an art but rather a combination of the two, just like any other kind of communication. Think for example to human verbal intercourse.

However, programming languages are different from human languages in many respects and, in particular, because they come in very different flavors. Of course, they share some basic common features, for example they have to be “Turing complete”, thus able to express any kind of computable function but, as Dr. Subramaniam nicely observes, to say that a language is Turing complete is much like saying that any human can sing!

More features have to come into play, such as ease of use, elegance of expression, performance in execution, efficiency, usability, maintainability, etc. Indeed, programs are not only written to be executed by machines, but also to be read by humans (for example when maintaining them), as the CS adage says.

Comparing programming languages

It is difficult to compare all those features but, from the programmer’s point of view, an effective way to compare different programming languages is to look at their typing system, thus how they classify data and information, and how they let the programmer express, define and manipulate that data, therefore, how to write algorithms on them.

As far as typing is concerned, we may imagine, following Dr. Subramaniam’s talk, two dimensions which give rise to a Cartesian plane where statically-typed languages are above the x axis and strongly-typed languages are on the right of the y axis. Let us recall that a language is statically-typed if the type of a variable may be inferred at compile time, while it is dynamically-typed if the information about the type is only available on run time. A strongly-typed language is such that types are fixed and casting needs to be explicit (if available) while a weakly-typed language lets the programmer get rid of type constraints quite easily.

In the following picture we illustrate the positions of some widely-used languages:

A nice sentence we took away from the talk was “Javascript is like an infant: it’s cute to play with but you have no clue why when it begins to cry”: this is the best explanation of the pros and cons of the different combinations among static vs dynamic / strong vs weak typing systems.

Programming paradigms

However, the typing system (often not completely understood by the average programmer) is not the only feature a language may display to attract, or repulse, a developer; another great arena for different opinions about what a language should be is the paradigm, thus the devices the language provides to let the programmer pursue his/her tasks.

There is not a definitive agreement of the classification of paradigms, but following Dr. Subramaniam’s talk we may mention the following ones:

  1. Procedural paradigm
  2. Structured paradigm (more or less the same as procedural in modern languages)
  3. Object oriented paradigm
  4. Functional paradigm

More could be added but actually, a common thread emerges between all those paradigms, best summarised in the following David Wheeler quotation: “all problems in computer science can be solved by another level of indirection”. We can display in a simple table what a level of indirection is in the different programming language paradigms:

ParadigmIndirection
ProceduralPointer
Object orientedPolymorphism
FunctionalLambda

Notice that Lambdas, the basic device of functional languages which consist essentially of allowing functions as first-class objects, are considered as indirections because of the lazy evaluation feature, available in all modern implementations of functional languages.

An often misleading distinction is the one among functional paradigm vs object oriented ones: on the one hand, this is not actually a distinction anymore, since Java, C# and all that provide Lambdas, maps and all tools needed to express the functional paradigm. Instead the real difference is between imperative and declarative approaches.

In short, languages complying the imperative approach urge the programmer to tell them what and how to do some task, while the declarative approach consists in telling them what to do without caring about how to do that, leaving this detail to others. For example, encapsulation is one of the ways to say “I don’t care how it’ll be done”.

The functional paradigm may be described as joining the declarative approach with the higher order functions facility, as Dr. Subramaniam puts it:

Imperative means hard to read but easy to write.
Functional means easy to read but hard to write.

That implies that either approaches may be better in different contexts: it just depends on the point of view. Imperative programming still remains efficient and maintainable when side effects and exceptions are needed (think instead that purely functional languages should completely avoid side effects), while functional programming is great at scaling, factoring and easily expressing the logic of the program.

So we are condemned to live with both of those paradigms, and indeed modern versions of object oriented languages provide plenty of functional constructs, for example consider Streams in Java 8: hybridisation seems to be the way to let languages enable and not limit our form of expression and we have to accept the duality imperative/functional as much as we accept the duality wave/particle in optics. Both points of views are needed to get a full understanding of the light phenomenon and both imperative and functional approaches are needed to unleash the expressive power of programming languages into efficient, maintainable and beautiful programs.

facebooktwitterlinkedinreddit
Share on:facebooktwitterlinkedinreddit

Tagged as:Codemotion Rome

Front-end development with Angular & NgRx
Previous Post
See what technologies are coming with Technology Radar
Next Post

Related articles

  • Python Libraries for Data Science: A Comprehensive Guide
  • A complete Introduction to Kotlin
  • Discover Mojo Lang: A Contender or Complement to Python?
  • Python: The Versatile Programming Language That Captivates Everyone
  • A Complete Introduction to the React Library
  • Laravel: Celebrating 12 Years of Powering PHP Development
  • 5 Reasons Why Java is Still a Great Option for Full-Stack Development
  • Here to Stay: All About Meta-Frameworks
  • What is Message Modeling and Why is it Key for Communication in Java?
  • Socket Programming in Java: How to Establish a Solid Computer Networking Protocol

About the author

Paolo Caressa

I spent the first part of my life enjoying studies up to a math BS+MS and PhD. Next I worked both as math researcher (differential geometry) and as IT consultant (R&D, feasibility studies, business analysis). Eventually I left academia and worked some years in finance (maths & implementation of derivative pricings and risk management models), then again in IT (as technical consultant and writer, project manager, program manager). In the meanwhile I write books and articles on maths and computer science and I give lectures on workshops and conferences (applied maths, AI, etc.). I also serve as adjunct professor in the Engineering Department of "Sapienza" University of Rome (calculus and CS classes).

Primary Sidebar

Free Whitepaper: The Ultimate Azure Cybersecurity Handbook.

Codemotion Talent · Remote Jobs

Flutter Developer

3Bee
Full remote · Android · Flutter · Dart

Python Back-end Developer

h-trips.com
Full remote · Django · Pandas · PostgreSQL · Python

AWS Cloud Architect

Kirey Group
Full remote · Amazon-Web-Services · Ansible · Hibernate · Kubernetes · Linux

AWS SysOps Administrator

S2E | Solutions2Enterprises
Full remote · Amazon-Web-Services · Terraform · Linux · Windows · SQL · Docker · Kubernetes

Latest Articles

scalable vue.js application

Best Practices for Building a Scalable Vue.js Application

Frontend

microservices digital transformation. From monolith to microservices concept.

Why You Need Application Mapping for Your Microservices Applications

Microservices

cross-platform development, frameworks

Ionic Framework: Why It’s Still Relevant

Mobile Developer

Linux: The Open Source Revolution and Its Impact on the Lives of Developers

Dev Life

Footer

  • Magazine
  • Events
  • Community
  • Learning
  • Kids
  • How to use our platform
  • Contact us
  • Become a Contributor
  • About Codemotion Magazine
  • How to run a meetup
  • Tools for virtual conferences

Follow us

  • Facebook
  • Twitter
  • LinkedIn
  • Instagram
  • YouTube
  • RSS

© Copyright Codemotion srl Via Marsala, 29/H, 00185 Roma P.IVA 12392791005 | Privacy policy | Terms and conditions

Follow us

  • Facebook
  • Twitter
  • LinkedIn
  • Instagram
  • RSS