Previous Page TOC Next Page



18. Concepts not included in Blue

This section discusses some concepts included in some other modern object-oriented languages that are not included in Blue.

These concepts are not explained in detail. The discussion rather focuses on their relationship to Blue and explains the motivation for their exclusion from the Blue specification.

18.1 Multiple Inheritance

While being a valuable concept for serious production languages, multiple inheritance is considered not important on the beginners' level. It is not a concept we want to teach in the first year, and its introduction into the language would have raised a series of related problems that would have considerably complicated the language and its implementation (such as repeated inheritance, solving of name clashes, etc.)

18.2 Routine Parameters

Passing routines as parameters is, while sometimes nice for elegant algorithms, not compatible with object-oriented programming. It assumes that pieces of code have an existence of their own, independent from classes.

In a pure object-oriented language code does only exist as part of a class. Passing a routine can be achieved (with a bit of overhead) by defining a class with that routine and passing an object of that class. Also, often constrained genericity offers an alternative solution to problems that can be solved by passing routines.

18.3 User Defined Infix Operators

User defined infix operators serve only for convenience in writing - they add no functional value. More importantly, they can be misused and can easily lead to code that is more confusing and less readable than code written without them. Reading and correctness is more important than writing. While there are a few (frequently mentioned) examples where they can sensibly be used, there seem to be many more where their use is tempting but confusing.

18.4 Function Overloading

In Blue, function overloading is included only for the predefined arithmetic operators (+, -, *, /), which are applicable to both Real and Integer numbers.

User defined overloading is not allowed.

The argument is similar as for user defined infix operators: while there are some nice applications, the gain through the use of function overloading seems to be too small and infrequent to make up for the added complexity and potential source of confusion and misunderstanding.

18.5 Union Type

A union type is not needed since similar constructs can be expressed with inheritance and supertypes.

18.6 Explicit Blocks

Explicit (user defined) blocks are not needed since in an object-oriented language functions are expected to be relatively short. Explicit blocks serve mainly as scope restrictions for variables and should be superfluous in that case.

Previous Page TOC Next Page