In: Computer Science
Give one example to non-regularity on any programming language that you know. Your should provide an example to each one of the following categories: Generality, Orthogonality, and Uniformity. That is, you will give total three examples and explain why...
Regularity
It refers to how well the features of a programming language are integrated. Good regularity means having no or very less restrictions in doing some constructs. Basically regularity is divided into 3 more sub groups
Generality
if language avoid special cases during the usage of constructs or it combines two or more constructs into one simple construct then language is said to achieve generality.
Example:
In java programming language we use inheritance but we cannot use multiple inheritance (special case). Therefore it proves non generality hence non regularity
Uniformity
Language achieve uniformity when similar things look similar and works similar, but a language is not uniform, if dissimilar things work similar
Example
In java we can increment a variable by many dissimilar ways, like i++, ++i, i=i+1, i+=1
Orthogonality
Language is said to be orthogonal if its constructs behaves the same, in every context.
Example
in java programming language int, byte, short, long, enum etc can be used in a switch statement, but strings cant be used here. hence it proves non-orthogonality hence non-regularity.