[ROOT] 150/100?? or: Where did TObject get the T?

From: cstrato (aon.912121399@aon.at)
Date: Fri Aug 22 2003 - 13:34:21 MEST

Dear Rooters, dear Otto:

Since it is summer and today is the last day of my vacation, so let me
continue the summer theater, because I have to respond the the statement:
"The only good thing about C is: it killed Pascal"
(BTW, this is not true, today Pascal lives e.g. as Borland Delphi)

Note: Do not take my response too seriously :-))

Here is another statement:
"Today, C should no longer be used, use C++ instead!"
C++ has corrected some of C's mistakes by adopting the more stringent
style of Pascal! (e.g. "do not use the preprocessor!")

Have you ever wondered:
- Where did TObject get it's T?
- Where are the roots of the ROOT style?

The short answer is: Because the Macintosh was a Pascal machine:-))

You do not believe it? So here is the long answer:

In Feb. 1984 Apple introduced the Macintosh with the GUI which is
today found in variations on all computers (the Xerox Star did have
a very primitive GUI only.)
Almost all GUI functions were located in ROM as PASCAL callable functions!
Besides Assembler, Pascal was the native language of the Macintosh, and
most of the complex applications, including Adobe Photoshop and PageMaker,
were programmed in Pascal.

Some time after the introduction of the Mac, Apple, with N. Wirth's
cooperation, invented "Object Pascal" and MacApp.
(see: http://c2.com/cgi/wiki?ObjectPascal)

Object Pascal was a very simple and elegant extension of Pascal:
Similar to the C++ "class" which is an extension of the C "struct",
a Pascal "object" was an extension of "union". In Object Pascal, an
object (a class) is defined in the following way:
      TWindow = OBJECT (TObject)
                fWindow: WindowPtr;
                PROCEDURE OpenWindow();
In the program you define a window as:
      MyWindow: TWindow;

So, here is the answer to the first question: Where did TObject get the T?
The "T" in TObject is a reminder for TYPE OBJECT!
(Of course, TWindow is only a convention, you could use simply window)

In order to convince the developers to use object oriented programming,
and to simplify the development of applications for the Mac, Apple
introduced MacApp, which was the first commercial successful framework,
and (in my opinion) the direct predecessor of ROOT:-)
MacApp was originally written in Object Pascal, and all objects
inherited from a base object, called TObject (does this sound familiar 
to you?)
For a short history see: http://c2.com/cgi/wiki?MacApp

Sorrowly, Object Pascal did not become the main OOP language :-(,
but C++ turned out to become mainstream. So, around 1987 Apple
decided to re-write the MacOS in C++, starting with System 7.0.

To make it easy for developers to switch to C++, Apple decided to
convert MacApp to C++, but to keep the Pascal coding style!!!
This version from MacApp can still be obtained from:

To enforce a common coding style, D. Goldsmith from Apple wrote the
"Unofficial C++ Style Guide", which can still be downloaded from:

Encouraged by the success of System 7 and MacApp, Apple decided to
develop a completely object-oriented OS, which they called PINK.
When Apple engineers showed this system to IBM representatives, IBM
was so excited about Pink, that they decided to collaborate:
In 1992 Apple and IBM founded Taligent to work on Pink as the basis
for a new generation of applications.
D. Goldsmith joined Taligent and expanded his Unofficial C++ Guide Style.
The corresponding book "Taligent's Guide to Designing Programs" was
eventually published by Taligent.
As all ROOT programmers should know, this book is the basis for the
ROOT C++ Coding Conventions, see: http://root.cern.ch/root/Conventions.html

BTW, this is one more reason, why I enjoy programming with ROOT :-))

In this sense I wish you: Happy ROOTing!

Best regards

Otto Schaile wrote:

>Dear all,
>just to contribute also something to ROOTs summer theater:
>A (meanwhile retired) contributor to CERNLIB once upon a time said:
>"The only good thing about C is: it killed Pascal"
>Nice summer time to everybody,
>PS: Meanwhile we all get so many junk mails so I think my mail
>    above does not increase the fraction of rubbish significantly.
>On Thu, 21 Aug 2003, cstrato wrote:
>>Dear Justin
>>Thank you for this extensive explanation.
>>I forgot that C was not intended to be a high level language but 
>>something like a macro-assembler.
>>BTW, around the same time N. Wirth has developed Pascal, which has its 
>>own operator for integer division, e.g. i := 150 div 100.
>>Best regards

This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:15 MET