[NCLUG] Looking at programming languages...

Bob Proulx bob at proulx.com
Wed Jan 16 12:16:54 MST 2008


grant at amadensor.com wrote:
> I would like some opinions.   I am going to be doing some new  
> development, as well as teaching some people who know nothing about  
> programming some basics of programming.
> ...
> Gambas - GUI is easy, you can easily connect code to GUI artifacts.    
> However, it is not cross platform, and does not really seem to have  
> enough people using it to really reach critical mass.

One thing to keep in mind is that you will spend time teaching and
people will spend time to learning something and that is an
investment.  It has more return if they can learn something that they
can apply and use.

If the goal is only to teach them principles now and then they would
need to learn a Real(TM) programming language later then you could
teach them MIX now and then they could pick up any language later.
That has been done.  But I don't think that is the best way to go.  (I
learned Pascal initially to learn the principles and then later
learned C for creating real world programing.)

There are a lot of languages that would make the short list of useful
programming languages to know.  Before you commit to a language you
should consider how useful knowing that language would be to them
later.  Would Gambas/BASIC really be that language?

In my not so humble opinion the short list for compiled programs:

  C, C++

C++ is really the new Pascal.  C++ makes easy things easier and hard
things harder.  Unfortunately it was the hard things that I needed to
be easier.  This is heresy to say but true IMNSHO.  The recent history
is long filled with portability issues between compiler versions.
Memory management is complicated.  A great language to teach and many
people love it but it contains subtle nuances that fills volumes with
traps for the unwary.  I stick with C these days.

In my not so humble opinion the short list for interpreted programs:

  Perl, Python, Ruby

I have loved and hated Perl for the reasons you mentioned but mostly
today would avoid it because it is harder to teach and program object
oriented programming principles with it.  The variable scoping rules
were not created with OOP in mind.  It is possible but not fun.

The difference between Python and Ruby is less than between either and
Perl.  I personally find Ruby to be my favorite of the two.  Others on
the list would choose Python.  Both are very good.

I know that I did not put Java in that list.

> Ruby - The language is brilliant.   It does everything just as you  
> would want and expect.   However, it is a pig at runtime, and the  
> runtime tends to have issues like sucking up every available bit of  
> RAM and CPU when you least expect it.   I have not done any GUI stuff  
> with it.  OO conceptually is a little advanced for beginners.

I have not found use of Ruby to be problem as compared to Perl or
Python from a system resource point of view.  They are within the same
order of magnitude of performance.  If an application is in critical
need of performance then a compiled language is the best choice.  But
here are some quotes about optimizing too soon.

  "We should forget about small efficiencies, say about 97% of the time:
  premature optimization is the root of all evil.", Donald Knuth.

  "The First Rule of Program Optimization: Don't do it. The Second Rule
  of Program Optimization (for experts only!): Don't do it yet.",
  Michael A. Jackson.

Having said that I am well aware that the current stable Ruby has some
runtime performance issues.  See the Debian shootout benchmark page
for one ranking.

  http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all

These are getting addressed and Ruby 1.9 is reported to be
significantly faster than Ruby 1.8.

As far as teaching users OO right at the beginning I think that would
have been much easier than the way I learned programming.  I have
heard many people advocate teaching OO right from the start.  I think
OO is only considered advanced because most of use learned without it
and only later came to know it.  If I were teaching I would teach OO
concepts as simply a normal part of the course.

Bob



More information about the NCLUG mailing list