View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Discussion 1 - Kaori Takeuchi

The article, "Programming Language Comparison" by Jason Voegele, shows in-depth study of comparison between nine Object-Oriented programming languages: Eiffel, Smalltalk, Ruby, Java, C#, C++, Python, Perl, and Visual Basic.
The evaluation and comparison are based on twenty-one features that current popular programming languages may have as which considered essential qualities of an Object-Oriented language (OOL). Here are some of the features:

Object Orientation
Eiffel, Smalltalk, and Ruby are all considered pure OOL since they include all of the following qualities as an OOL:
  1. Encapsulation
  2. Inheritance
  3. Polymorphism
  4. All pre-defined types are Objects
  5. All operations are messages to Objects
As most of us know as Java developers, Java fails to meet the fourth and fifth quality because of the existence of primitive data types and the implementation of basic arithmetic as built-in operators, rather than messages to objects. C++ is considered a multi-paradigm language, of which one paradigm it supports these qualities.

Static vs. Dynamic Typing
Smalltalk, Ruby, Python, and Perl use dynamic typing, which is believed to be more flexible and allows for increased productivity, while others use static typing that enforces safer, more reliable code and increases efficiency of the resulting product. For developers, dynamic typing seems to be preferable because it is more flexible and amenable to change. However, the developers must use special caution so that variable hold the expected kind of object otherwise some sort of “message not understood” error is raised at run-time. On the other hand, statically-typed languages require that all variables are declared with a specific type so developers should not be bothered by such an error at run-time because compiler can ensure that.

Inheritance
Eiffel is known for its carefully and thoroughly well-designed support for multiple inheritance, although the mechanisms C++ provides for multiple inheritance are more complicated and less flexible. Smalltalk supports only a single notion of inheritance: single inheritance of both interface and implementation. Python similarly supports one form of inheritance but allows multiple inheritance and is thus more flexible in this regard than Smalltalk. Ruby lies somewhere in between the two approaches by allowing a class to inherit from only one class but also allowing a class to “mix in” the implementation of an arbitrary number of modules. Java allows one implementation and multiple interface inheritance. Even though VB has not supported inheritance of any form, the latest version “VB .NET” supports for single inheritance.
Multiple inheritance is an essential feature for cases when two or more distinct hierarchies muse be merged into one application domain, but the compensation would be complication in the process of design and coding.

Access Control
Under a principle of encapsulation, access control to a module implementation is taken place in most languages. Java appears to emphasize this feature the most by providing four levels of access control: public, protected, private, and “package private”. Eiffel, however, provides the most powerful and flexible access control scheme of any of these languages with “selective export” that let a class specify an export clause which lists explicitly what attributes other classes may access in the class. If the special class “NONE” is used, even public attributes are read only so an attribute can never be written to directly in Eiffel. Surprisingly, Python doesn’t provide any access control but it carries a mechanism of name mangling: any attributes that begin with underscores will have its name mangled by the Python interpreter.


There are more features discussed and compared in the article. All languages except for Java and VB support operator overloading, which provides the ability for a programmer to define the operator (such as +, or ) for user-defined types so that infix, prefix or postfix form can be used. What is important is that the operator overloading should be used appropriately then it can lead to much more readable programs. When abused, it could be cryptic, obfuscated code.
There is only one language, C++, that doesn’t provide garbage collection unless developers intentionally add smart pointers to perform the job.
Multithreading ability is supported by most of the languages except for Perl and VB. Ruby’s threading capabilities are built in to the interpreter itself, rather than wrappers around the operating system threading operations. This is the advantage for systems that do not support multithreading, but it is also the disadvantage that any OS calls will block the entire interpreter.

The author precisely described the difference in features in these nine OO languages and how they are implemented. He also explained how programmers could get caught in a trap by abusing the features. Some languages have seems to have more features than others but they carry some disadvantages like complexity as well. The choice of the language is highly variable depending upon works that people are on but they should be aware of the variety of languages available and its features as well as downside before to make a choice.

I read Jeff Watson's article, "Can C# replace Java in CS1 and CS2?", which reminds me of my forty years old friend who learned FORTRAN as his first programming language. It has been C++ that was considered CS1 language until a few years ago and now it is believed that half of all colleges in the world use Java. According to Jeff's article, C# seems slightly easier to learn, which means that would be usable to not only "expert programmers" but for novice people. I strongly believe that in the near future, programming language will be modified and updated so that even children will be able to program, just like Smalltalk started. The reason behind this belief is clear by comparing language used 30 years ago and now. The evolution of programming language is taken place day by day and Java or even C# are just part of the stream.

Links to this Page