Choosing an appropriate language

Developers must choose one programming language over another for a given task. Unfortunately, most software engineers do not know which one to choose among various programming languages available out there. Every programming language has a paradigm, which can be imperative, object-oriented, functional or declarative and each paradigm has different characteristics and pros and cons for a specific task. Moreover, within each paradigm, one language is quite different from the others in runtime performance, memory consumption and many others factors.

For example, most developers choose C when they need blazing speed. When someone wants a program to run on Windows with as small a distribution as possible, they often choose C++ with MFC statically linked. When they need GUI software that will run on Mac, Windows and UNIX machines, they may choose Java even though it does not work perfectly.

For a command line tool that must run on any UNIX machine, script languages such as Perl, Python and Ruby will be choices. For rapid development and smooth UIs, Visual Basic is the choice. Although developers know that they have to pay for the price in the size of the distributable. If developers have to run inside a web browser, JavaScript is really the only choice.

Most mistakes are made when developers choose their languages based on syntax. It is true that some developers prefer C/C++/C#/Java syntax while others like neat Python syntax more. They have lots of opinions on what makes a good syntax and the beauty of clean syntax.

However, what happens when developers choose C language when they need to build a CGI program for web servers? CGI programming needs a lot of string manipulation procedures and C language is one of the worst languages to process string operations. Productivity will fall down rapidly even though they are accustomed to C language and C standard library for processing strings such as strcpy, strcat and so on.

Programmers must focus on various aspects of language and language runtimes when they choose an appropriate language for their projects. Criteria for choosing one language over other languages are countless and we cannot take all of them into consideration at the same time because some of criteria may conflict among them.

When someone wants readability, writability, reliability and performance all together, there is no such language in the world. Reliability and performance are often in trade-off relationship. Features which enhance reliability such as array bounds check, null check and type-safety check need more computation and thus degrade the performance. Readability and writability are also a good example of trade-off. Perl has greatly enhanced writability by embedding regular expressions in its syntax, but most Perl developers cannot read others’ source codes.

Then people may ask “Which criteria do we need consider?” Choosing a good language for a project is deeply related to the characteristic of the project. If projects require rapid prototyping and nice UIs, either Visual Basic or Python is the choice. If software is to be downloaded via communication or broadcasting channel, we need to control the permissions of the downloaded applications. In this case, we have to choose Java or C#.

Mechanical procedure to choose the best language for given projects is to list up requirements of the project and to sort them according to the relative importance. If performance is the first requirement, you have to choose C language or its variants. Developers have to remember the phrase, “Think projects first and choose a language according to the characteristics of the projects.”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s