[Sussex] Simple OOP tutorial

Tony Austin tony at gigaday.com
Fri Aug 27 13:41:52 UTC 2004

Thanks to NIk and Geoff the their informative postings.

I'm an old lag when it comes to programming.  What do I mean by that? 
Well, it's my 59th birhtday today and I started programming in 1970.

I am also a bit of a laggard when it comes to programming.  I devised ways
to write code that was robust and easy to maintain before I had ever heard
of OOP and one of the systems "what I wrote" in 1985 has only just been
moth-balled and that was a result of change of ownership of the company. 
Now, I admit that in a modern and much much technically demanding
programming environment these techniques might not be as applicable as
they were then; but they worked equally well for me in Assembler, PL/I,
COBOL and C.

After a few years of not programming when I stupidly let it slip because
people told me that you can't do "that" all your life, I have been lucky
enough to land a full scale new software system to build from the ground
up on my own.  In the intervening time I have dabbled with VB (which I
liked at first but liked less and less as I continued to use it and found
things that just didn;t work), C using a few ++ benefits to an extremely
limited extent, PERL which I thought was great but only played enough to
write a generic table maintenance screen for PostgreSQL databases, still
learning bash and, then finally, I had to learn PHP because I wanted to
write some plugins to SquirrelMail.

So when I came to looking for tools to write this new system with I
thought "OOP, that's got to be the way to go, let's take a look at Java". 
The web pages said it was very quick to learn and easy to use, so I
started on the tutorial "looks great" I thought; until I got about chapter
3 or 4 and started to think "this is going to take me months to learn, I'm
going to have to find something else".

My application has to have a Windows-style GUI (like VB or whatever), has
to run an SQL database and has to be able to run client-server over a wide
area network.  Just what M$ are punting .NET to do; and, oh yes, it has to
be cross-platform (because I say so) and there is no way I would consider
anything that has anything to do with .NET, even if I could be persuaded
that it is cross-platform in the sense that I mean.

 I actually had a go at doing something with just HTML and JavaScript and
almost got listboxes with dynamic partial-key matching to work before I
realised that I was flogging a dead horse.

And then, as if by chance, I stumbled (again) on Mozilla XUL.  With some
trepidation I started out with my "must have" element - the partial-key
matching listbox; XUL almost does this the way I want it "out of the box"
and I could probably persuade someone to change it to suit my needs
completely; but, no matter, it was easy enough to do it with a little bit
of my own JavaScript.  Add to this PHP and PostgreSQL on the server-side
and I can't see why Microsoft have made such a fuss about .NET and who
needs it anyway?

Oh yes, OOP.  Well, I thought about it and I have written classes for all
the data tables but beyond that it's beyond me.  And, bliss of bliss,
those old techniques that I thought out 30 years ago work just as well
with JavaScript and PHP!  Well, actually not quite all of them because one
of my major triumphs was to devise a style of programming using GO TO that
was robust, maintainable and completely bullet-proof providing that you
followed a very simple set of rules; I also managed to get rid of all
those tiresome AND, OR and parentheses in IF statements; which just goes
to show what a grounding in Assembler can do for you.

So, a few months down the road I have 27 (small) client programs that have
run over wide-area from the start, updating an SQL database and have a
reasonable GUI.  Oh, and one more thing, it's an M$DOS system that I am
replacing and they (sensibly) want it all to be able to be operated very
simply without the mouse if the choose (I think of it as "expert" mode),
XUL does this easily.


Tony Austin
Gigaday Computing Limited
tony at gigaday.com

More information about the Sussex mailing list