If you are new to programming and you don’t know where to start from, or you are a senior, yet would like to refresh your knowledge you are in the right place! This article will talk about term(s) you will think before every line of code you write!
Language Evaluation Criteria is very useful examine carefully the underlying concepts of the various constructs and capabilities of programming languages focusing also on their impact on the software development process, including maintenance.
The list of criteria can be considered controversial, yet important for many programmers as it is sometimes impossible to agree on the same evaluation values because two different programmers have different experiences, however, most would acknowledge the importance of the subsections of language criteria that would be discussed.
One of the most important criterion for programming language is how easy it can be read and understood, which is called readability. There are also writability, reliability and cost criteria, which will be discussed in the next article(s). Overall, readability is affected by Simplicity, Orthogonality, Data Types and Syntax Design and this article is going to talk about each one of them in detail.
Simplicity — One of the trivial yet interesting factors influencing simplicity is that two different programmers do not have the same knowledge, meaning, programmers have their own writing methods over time, and one programmer might not properly understand and read another programmer’s code. No matter how personal it may sound, it is a factor that affects simplicity. Second factor is called feature multiplicity, achieving a particular operation in different ways. Having too many options might reduce readability.
All of four operations below declaration of variable size increments the value of it and you can test it in C++ and Java. You might not be familiar with the last two operations, which is called Post-increment and Pre-increment but that’s nothing to be anxious about! *CHILL* The third potential problem is operator overloading, meaning operator symbol has more than one meaning. For example, we can overload an operator ‘+’ in a class like String so that we can concatenate two strings by just using +, or we can use it to add integers, floating-points and complex numbers.
Orthogonality — operations change just one thing without affecting others. A lack of orthogonality leads to exceptions to the rules, which reduces readability. Let’s take the example of a + b in C programming language. If a and b are integers their values are fetched and added together. The problem occurs when the variable a is a pointer and b stays as an integer variable. Suppose, a points to a floating-point, which occupies four bytes in the memory, then b must be scaled before added to a, so its size changes and it is affected. And this has a negative effect on readability.
Data Types — The presence of sufficient number of data types in the programming language is an aid to readability. Imagine not having boolean data type in the language, which actually was a lack in the original version of C. You might think that you can create integer variable and assign it to either 1 or 0, instead of true or false, yet the meaning of that statement is somehow unclear.
Syntax Design — The structures of statements in a computer language also play a role in readability, such as appearance of special words in the programming language, such as while, for, if. In short, special words are those words which can neither be redefined by the users, nor be used as an identifier such as the name of the variable. The second would be the question if special words can be used as variables. I know it sounds a little bit confusing, because I mentioned that special words cannot be variable names, yet in Fortran 95, this was allowed… In this case, we call them keywords, rather than special words. Do and End keywords were allowed to be legal variable names. The third will be the form and meaning, designing statements so that their appearance at least partially indicates the purpose is an obvious aid to readability. This principle is violated by the structure of two languages that are similar or same in appearance ut different meanings. The special word static in C programming language can be an example for that. If used in variable definition outside the function, it means the variable is only visible in the file, not exported from the file. If used in variable definition in the function, it means the variable is created at compile time. Another example would be the word grep, one of the UNIX commands which its appearance doesn’t say anything about its function, yet it g makes it global command, re searches for regular expression and p prints the matching lines, which is abbreviated as grep. So it globally searches for regular expression and prints the matching lines.
If there’s a question, feel free to ask! Stay tuned for new articles! Peace✌🏼
- Sebesta, R. W. (2019). Examples of Multiple Selectors. In Concepts of programming languages (pp. 40–49). NY, NY: Pearson.