Design‎ > ‎

Inspiration

There are many existing programming languages to learn from. All of them have at least a few good ideas.  But once you start using them for more than a small program, you also find disadvantages.  The trick is to use the nice parts and avoid the bad parts.

Java

This comes first since it was the main base for Zimbu.

Java is one of the most often used languages, it has many good things to
learn from.  But it's certainly not perfect, it suffers from being backwards
compatible with the first version, which included a few bad choices.  Some
essential features were only added in version 1.5.

Nice:
  • interfaces
  • exceptions
  • type declarations
  • use of design patterns
  • lack of header files
Avoid:
  • Type often needs to be specified twice: "SomeModule.MyClass v = new SomeModule.MyClass();" 
  • Keywords with a non-obvious meaning, such as "static" (taken over from C).
  • Using equals() for string compare, instead of the more obvious ==.
  • Requirement that the class name must match the directory name.  When moving functionality around this implies a lot of changes inside source files.
  • Static methods.  These are just functions with a specific scope.  They are not related to objects of the class they appear in, can't even access the members, which can be very confusing.
  • Compilation into byte code results in slow startup and non-optimal performance.
  • Garbage collector takes big chunks of CPU time at irregular intervals.

Python

This comes second because it has many things I like.  It probably is the most productive language.  Not only can one learn it
quicker than any other language, writing code is very productive.
But it also has many things I don't want to use.

Nice:
  • built-in types List and Dictionary and associated functions make it easy to do the most common tasks
  • efficient memory allocation system using reference counters
  • large set of useful libraries
Avoid:
  • Defining blocks by indent.  Appears nice at first, but has problems in practice, esp. when moving code around.
  • Interpreted, lower performance.

C

This is the most portable and widespread language.  It's old and runs just about everywhere.
With some effort it is very efficient.

Nice:
  • sets a standard for what programmers expect
  • low number of features to learn
Avoid:
  • header files
  • pointers

Scala

This is a very new language that implements some new ideas.

Nice:
  • Type inference avoids repeating class names.

C++

The most feature rich language.  But this leads to puzzles, it's very hard to know for sure how something works.  Can only be used by well trained people, while it takes a long time to learn.

Nice:
  • some libraries that are done well
Avoid:
  • header files
  • pointers
  • complexity

D

A new language, not widely used yet.  Attempt at something like C++ but without the bad stuff.

Nice:
  • "auto" for implicit type, no need to repeat class name
  • "alias" for getting a short name for a long name
Avoid:
  • put everything in C/C++ syntax
  • lazy evaluation, unexpected at caller side

Ruby

A more recent language, more O-O than Perl.  But hard to understand in some places.
Ref: http://en.wikibooks.org/wiki/Ruby_Programming   http://www.rubyist.net/~slagell/ruby/

Nice:
  • provides ideas how to do without semicolons
Avoid:
  • expression by itself is return value, causes mistakes.

Boo

Very recent language with some interesting ideas.  Rarely used.

Groovy

Has some extra ideas on top of Java.  As such it doesn't take away any of the Java disadvantages.



Comments