Topics

What language do we use for coding?

We better have this discussion right now than never!

When we discover computer programming as beginners we often associate the experience of programming with a particular language (C, Python, JAVA etc). This is understandable and is quite natural. But with experience one eventually realizes that programming has more to do with logic and mathematical reasoning, and little to do with a particular language of implementation. In fact it turns out that any programming language that has some basic constants, variables, some kind of looping and/or recursion is good enough to write programs in. Despite this, the argument that a certain programming language is particularly suited for a specific task is in fact valid and certainly true.

  • Why are some languages particularly suitable for certain tasks? Is this just a coincidence?

  • Why do we even have so many programming languages to begin with?

To answer these questions we first need to understand that each programming language has a history and was created to address a particular task at hand. Therefore it is not a coincidence, and indeed natural that a language suits the specific task that it was created to tackle. Each programming language has a historical context around its emergence.

The C Language

The programming language C was first developed (in early 70's) at Bell Labs with the purpose of building the UNIX operating system. We should realize these were times when computer hardware wasn't really that powerful - be it in terms of processor speeds or the amount of RAM at disposal. So C was a high level language developed carefully to harness machines with very limited hardware power. It was an essentially an abstraction over assembly language, which means we have almost a direct access to the computer hardware. This means, using C language enables one to write programs that are machine friendly and therefore faster. We can confidently take it as a fact that no serious computer programmer of our times can afford not learning C. This should be understood in the same spirit as in "no serious bike rider can afford not knowing where the engine is, and how to tinker it when needed!".

Dennis Ritchie and Ken Thompson the two people who developed the C language are still alive (at the time of writing this). Read more about them here:

https://en.wikipedia.org/wiki/Ken_Thompson

https://en.wikipedia.org/wiki/Dennis_Ritchie

C plus plus

In the 80's, again in Bell labs, Bjarne Stroustrup created a new language called C++ which was based upon the C language but with several additional capabilities such as Object Oriented Programming and Template Meta-programming. With these additional capabilities C++ enabled programmers to express better (so to speak) while still staying close to the hardware. In fact though out the development of C++ they maintain that every valid C code also a valid C++ code so as to replace C in the long run.

One of the guiding principles in the creation of C++ is - "There should be no language beneath C++ (except assembly language)."

C++ was a huge success. Many well known softwares such as Google chrome, Firefox, VLC player, Skype, Adobe Photoshop, and numerous video games like Counter Strike etc were developed in C++ and the language continues to be important whenever efficiency is crucial.

Watch the following videos:

Stroustrup: Why I created C++?

https://www.youtube.com/watch?v=JBjjnqG0BP8

Stroustrup: Why C is obsolete/useless?

https://www.youtube.com/watch?v=KlPC3O1DVcg

Python

In 1990's, Guido van Rossum a dutch programmer created a software written in pure C. The soul purpose of this software is to hide the ugly implementation details in C, and create a cleaner, neater, and intuitive language to write programs in. He called this software the CPython compiler. This compiles and interprets programs that are written in Python - a very high level language which is an abstraction over the C language. The syntax of Python is extremely intuitive and is also equipped with powerful standard library. Python is object oriented at its core, so primitive datatypes of C and their limitations don't bother us. In fact everything that has 'existence' in Python is an object so we can treat them like objects in real world and put them in containers and push them around. Remember that this kind of very-high-level abstraction is just unthinkable in C / C++. Therefore Python, by design, is programmer friendly and saves the programmer a lot of time. But since the programs are written at a very high level, lazy practices may result in slow programs. Also since, the language implements dynamic-typing sometimes even a well written Python program may require more memory than the equivalent code in C/C++.

Read this article:

Guido van Rossum on how Python makes thinking in code easier.

Java

Java on the other hand, was a language developed around mid 90's at Sun systems to develop web-applications for devices that communicate over the internet. Popularity of Java therefore went up along with the spread of internet. In 2008, Android mobile platform was created. Android used a java-like language to build apps on the platform because of the ease the modularity that the syntax offers. This added to the popularity of Java and it remains the most popular language there is. [Link ]

Which is the best for us?

  1. C is an extremely powerful language and a lot of legacy code is already written in it. Eloquence in C is a highly sought after skill in the job market. We'll definitely equip ourselves with sufficient proficiency in C.

  2. Learning C++ is going to be highly advantageous, particularly for competitive coding, because it comes with the STL module which is equipped with well optimized data structures like vectors, dynamic arrays, maps etc. Also, note that C++ is by far the the most popular language of choice for competitive programmers across the world as it is usually faster than Java and Python. Loads and loads of C++ code (solved problems etc) is available online and it is important for us to be able to understand and draw inspiration.

  3. Python is a fantastic first language - hands down! Most of us already know it to an extent and so we will continue using Python whenever we need to experiment with a small idea. We will use particularly the iPython terminal to verify quick numerical results. Also, as we learn the Object Oriented aspects of C++ we checkout their implementation in Python in parallel.

  4. Most of us get introduced to Java much later (probably in the 2nd year), and with application design as its primary use. Unless someone is particularly comfortable coding in Java, we won't use it in this club.

TLDR;

At Coding Club we train ourselves to be bilingual. Each and everyone of us will be able to code and think in Python and C/C++.