On scripting languages and rockstar programmers.

The article “Scripting: Higher Level Programming for the 21st Century”[1] by John K. Ousterhout discusses the role of scripting languages in software development and expresses hope for a bright future of said languages. His hopes have certainly been fulfilled. The scripting languages are still going strong today, with major companies opting in to use them for development of large scale systems (for example YouTube[2], EVE Online[2], Dropbox[3], etc.). What I am proposing is that is not only possible, but oftentimes faster and cheaper to create a medium to large scale project using one of high-level scripting languages as a core of the system.

So, what are scripting languages?

These are typically high-level (do not directly map to machine instructions), interpreted (quick to modify without recompiling), dynamically typed (types can be interchanged to easily combine different objects), garbage-collected (memory allocation is taken care of) languages, such as Python, Perl and Bash. These languages use a collection of useful components that can be written in other languages. They are ideal for manipulating data arriving from a variety of sources, joining it for further processing.

Blasphemy! That can be done faster in C!

An age old debate, occurring every time something new comes along. Assembly language came to replace machine code, systems programming languages came to replace assembly. Scripting languages are just another layer of abstraction, sacrificing some performance for a more concise code that produces same outcomes. The speed difference is hardly noticeable for most applications.[4] Any significant inefficiency often comes from using an incorrect data structure or not applying so.

This means that developers can write code faster, allowing for more time to fix bugs or code extra features. My point is: at this point in time software developer time is expensive, while computer time is cheap. If you need extra power you can spin up 100s of instances of compute servers on the cloud at a click of a button for barely any cost at all.[5] Hiring more developers on a project just because the system is overcomplicated is just a waste of resources better spent elsewhere.

A true rockstar programmer can code in C just as fast as he can in Python!

A rockstar programmer most likely would. The problem is, most software developers are not rockstars, they are average.[6]  Now, with the widespread availability of computers, it is quite easy to start programing. You can pick up the very basics over a weekend. On a scale of [copy pasted ‘hello world’ from a tutorial website] to [can code up a general purpose operating system in a week] most programmers are somewhere towards the middle.

Writing software in low level languages, however, is hard. Your middle of the road programmer might not have had extensive experience with pointers or manual memory allocation. It is a lot easier to write code that is even less efficient than code in scripting languages if you don’t know what you’re doing. Not to say that average software developers can’t learn and are doomed to be mediocre forever, it’s just that the project would take longer to complete.

Python, on the other hand, has a much shorter learning curve and your average programmer will be able to contribute to your project in a short period of time. It is easy and fun, quick to prototype with, quick to recover from failure and to keep programing.

Why not just hire the best developers then?

If you want to get the cream of the crop, you’d better be prepared to pay enormous amounts of money or provide other good benefits to your employees. Whether you’re a medium-sized company or a startup in the process of creating the next big thing™, you have to ask yourself this: Why would a top software developer come to you instead of one of the giants (Google, Microsoft, Facebook, Amazon)? It all comes down to the attractiveness of your company, really.

So, should we just do everything in scripting languages?

Of course not. There are applications where systems languages reign supreme. Applications where every millisecond and every kilobyte counts and require precise control over memory (embedded systems with very small amounts of memory, operating systems programming) can only be efficiently written in system level languages.

Sor scientific simulations – it varies. As mentioned before, scripting languages are usually ’the glue’ that joins other languages. It is possible to have C backed libraries (SciPy, NumPy) that achieve C-like performance while having a nice wrapper in Python. So, scripting languages are not the silver bullet that can be applied to every problem, but it is good enough for most applications.

Final verdict

In the end, should we use scripting languages to create large projects? As with any question in computer science, the answer is always the same: It depends. If you have a good team, the one that understands the concepts well, the project deadline is so far you can afford to spare time to train less experienced developers and you need it to work really fast, then consider a systems language for your next large project. Otherwise, a scripting language may suffice.

 

If you have anything to add or would like to propose a different perspective – leave a comment down below. 🙂

[Note: I have picked C and Python for most comparisons in this article , but a lot of points can be applied to other languages as well]

  1. http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=660187
  2. http://www.python.org/about/quotes/
  3. http://blip.tv/pycon-us-videos-2009-2010-2011/pycon-2011-how-dropbox-did-it-and-how-python-helped-4896698
  4. https://www.udemy.com/blog/python-vs-c/
  5. http://www.windowsazure.com/en-us/pricing/details/cloud-services/
  6. http://c2.com/cgi/wiki?LessAbleProgrammer