Tuesday 20 May 2014

5 Programming Language Design Mistakes

Posted by krishna


The number of programming languages that are available to programmers have increased in the recent past. But while people often talk about common mistakes that programmers make, most forget fundamental mistakes that are made in programming language design. The following are five such mistakes, which some languages have tried to solve, while others have ignored completely.
Programming, C, C++, Scala, LALR, LL1, IDE, Java, runtime exception, programming errors, programming design mistakes




1. Null pointers

The null pointer often leads to runtime errors. While languages like Java, Python and others throw a NullPointerException at you, C/C++ will crash because of dereferencing a null pointer.

2. Parser-unfriendly syntax

The use of multiple IDEs, editors and other tools for programming make it difficult to parse the programming language correctly. The programming grammar should ideally be LALR or LL1, but this doesn’t happen easily because of all the different tools that are used.

3. Unclear semantics

Having unclear semantics in your code makes error checking and verification much more difficult than it needs to. Languages like Scala have put special emphasis on making sure that the semantics are easy so that the code is kept simple. Error checking and verification are important parts of computer programming.

4. Bad Unicode support

The source file of a program must declare the encoding of strings. This is because when you name a string, you name it in English. But what happens when someone doesn’t know English very well? That is why using Unicode is very important for a programmer.

5. Preprocessor

Preprocessors are useful, but they become bad when used in a particular manner. For example, using pre-processor in the module system is wrong. In C, you have a problem because of #include, while C++ templates need big parts of a program to be in header files, which are then included in every other file. Having a real module system would make linking much easier and cancel the need for an external file system.

0 comments:

Post a Comment