Thursday, December 27, 2018

Learning a programming language

There are tons of programming language and new ones keep popping and old ones going out. There are some who withstand the test of time and continue to flourish. Being in the information technology industry, it's imperative to keep learning new languages and keep sharpening the skills. Learning a new language is not always easy as many times there are paradigm shifts and it takes time to grasp them. 

In this blog, I will delve on the art of learning a language and what has helped me while learning nuances of Java, Python, Javascript and couple of more. I still would not claim myself as an expert in any of this but have done a fair amount of coding in those languages and couple of more. Whenever I had to pick a new language, I try to understand the language on the following dimensions to get a good understanding of what the language offers. And be careful, the languages are not sometimes plain programs, they are ecosystems in themselves. 

  • IDE: you want to start with a good IDE as a good tool will help to make the learning faster. But at the same time understand how the language can be put in service if only a notepad or vi terminal is available to you. 
  • Syntax: Of course it has to start with that. A good familiarity with syntax provides a good base to leap further. One should familiarize with all the keywords and basic programmatic constructs like loops etc. Each language has their nuances also like volatile in Java.
  • Type of language: if the language is dynamic or static. Java is a strongly typed language and Javascript is not. (Not sure if it was a pun to name Javascript with the prefix as Java :). But it's also true that javascript has entered into server domain with nodeJS and the attempt by Java to enter into front-end has not been so successful be it JSP or GWT.). Strongly typed language needs more work at compile team but lesser surprises at runtime. Dynamic languages do tend to throw surprises at runtime. It's good to know what type of language one is dealing with.
  • Language constructs: This is like saying how the language thinks. For example, node works on non-blocking threads as the core of its programming philosophy. Java provides a natural  OOPS paradigm whereas other languages may not be so natural about it.
  • Language runtime: How the program is run? Java needs JVM but C/C++ are natively compiled to target operating system. Then there are memory management paradigms.
  • Tools and frameworks:  Understand the ecosystem of language and what kind of libraries and frameworks are available. In Java for database-centric applications, it is but natural to think about Spring and Hibernate. Python comes with a rick package managers which includes libraries for machine learning. Python has a full battery framework like Django to build applications. It's is quite helpful to know different kind of libraries available as one may not want to invent the things again.
  • Structure, packaging, and deployment: This is also importatnt from the perspective of building large-size applications. How the various code pieces are laid in terms of layers/modules? How they can be packaged? For example Java applications as war/jar, python as virtualenv. Also, what are all different build tools like Maven, Gradle, webpack etc? How the artifacts are deployed and on what kind of servers or runtimes?
  • Scalability and Performance: There are many common underlying paradigms. Each language has their own nuances also. Understanding memory management of a given programming language is must otherwise the program will starve itself. One also should understand the concurrency model as supported by a given language. 
Beyond this, there are now cloud paradigms in terms of infrastructure but that for some other day. If you have more ideas on it please feel free to add to comments.

2 comments:

  1. Lalith

    Enjoyed reading this. What, in your opinion, would be a good starter language to expose a high schooler to? Python , Go etc while easy to pick up, hide a lot and that can mean a lot of fundamentals cannot be taught easily. I was leaning towards C but I want to get some more perspective

    ReplyDelete
  2. C is the best choice to begin with. It exposes to a lot of internals and builds the right intuition in terms of how things actually work. Python, Java and other languages hide a lot of thing. Eventually you might though want to learn Python or Java as building applications is more easy for the reason that they take care of a lot of internals.

    ReplyDelete