144k views
0 votes
Give one example to non-regularity on any programming language that you know. You 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?

User Anycorn
by
4.4k points

2 Answers

1 vote

Answer:

Ada is a programming language that has 1 loop structure with variations -- this is a good example of generality.

loop ... end loop

for i=1..n loop ... end loop

while cond loop ... end loop

Example of orthogonality of pascal data type is

Data Type I/O

char yes

integer yes

real yes

boolean yes

enum no

An example of uniformity of pascal is

REPEAT-UNTIL vs WHILE DO BEGIN ... END

Explanation: GENERALITY deals withThe avoidance of special cases and generalizing related constructs into one construct, pascal lack a good generality that was why i gave an example using Ada.

ORTHOGONALITY deals with the idea that Independent functions should be controlled by independent mechanisms, i sited a good example of pascal data type above.

UNIFORMITY is the The consistency of appearance and behavior of language constructs, a good pascal example was sited above.

User Waseem
by
4.9k points
2 votes

Answer:

Step-by-step explanation:

For understanding this we need to know what regularity is. It depicts how good the features of a language are integrated.Regularity is divided into three main concepts, i.e. Generality, Orthogonality and Uniformity.

The concept of regularity arises on a language when the consistency and integration in its features fails to work well.Thus the language becomes more complex for the user.

For Example -

Java

1. Generality - It is achieved when the language avoids special cases in the use of constructs and combines the close related constructs into a single but more general construct.

In java, there is the use of inheritance for classes but we cannot use multiple inheritance which is a special case.This can be termed as non-generality.

2. Orthogonality - If a language is purely orthogonal, the language constructs do not behave differently in different contexts.

In java, we cannot use Strings in the switch statement but we can use integers, convertible integers(byte, short, char) in the switch statements. This shows non-regularity.

3. Uniformity - It refers in the feasibility and stability on the appearance and behavior of language constructs.

In java, there are many ways for increment i.e. (++1, i++, i = i + 1). But they all are so different and also looks different but they behave in a similar way when they should not.

User Cyberdenz
by
4.6k points