Welcome, Guest | Home | Search | Login | Register
Author Coding for System 7 in (THINK) Pascal! (Read 11549 times)
Bolkonskij
Administrator
1024 MB
*****
Posts: 2023
View Profile Cornica - Video Entertainment for Mac OS users
on: July 20, 2021, 12:36

I think Knezzen already put me on ignore because I kept spamming him yesterday how excited I was about my first experience ever with THINK Pascal ;-)

Truth to be told, I always found Pascal an interesting programming language, very structured and clear code to read. The fact that it lost popularity when I started to peek into programming by the mid 90s led me to focus on C instead.

So while I have some coding experience, I have non with Pascal. But as many of you know, it was *the* language for the Macintosh and even if you code for System 7 in C, you still see remnants of that heritage everywhere.

Btw - for a special retro challenge I started coding with THINK Pascal 3.02 on my Macintosh SE, 4 MB RAM and System 7.1. Surprisingly, this wasn't sluggish at all and even the compile time for my first "hello world" style programs were surprisingly fast.

This will change with more complexity, but I begin to understand how my childhood heroes like john calhoun (programer of Glider, Glypha etc.) managed to code their games on a mere Macintosh Plus.

THINK Pascal has a very clean interface, easy to use, has a very cool and capable debugger, syntax highlighting and more. Features I never expected it to have. (given it is 1990 software!)

Anyone of you been coding in Pascal "back in the days"?
Or maybe still actively?

For those of you interested in following me and also posting their progress, I recommend this excellent guide (old browser compatible) by Ingemar Ragnemalm. It basically has all the info you need to get going.

EDIT: There's lots of Mac OS specific source code examples over on pascal-central.com! (retro browser compatible)
Last Edit: August 07, 2021, 11:09 by Bolkonskij
snes1423
256 MB
*****
Posts: 458
A Man born of Mechina
View Profile
Reply #1 on: July 21, 2021, 18:13

hmm seems like its pretty limited?? is this a unfinished website??
Bolkonskij
Administrator
1024 MB
*****
Posts: 2023
View Profile Cornica - Video Entertainment for Mac OS users
Reply #2 on: July 22, 2021, 12:31

Ingemar's? No, it's not. It contains all the info you need to get things set up and start Pascal coding on your retro Mac. Of course it doesn't teach you Pascal. I'm sure there's tutorials on YouTube or good old-fashioned books ...
68040
512 MB
*****
Posts: 950
68k - thy kingdom come, thy will be done !
View Profile
Reply #3 on: November 17, 2021, 14:09

Aaah Pascal, my very first programming language from way back when I still listened to what the Professor told us and thought C was just for geeks who tried to impress their non-existing girl friend with extra complex code.

Oh yeah, I was still "innocent" back in them days. For now I know one of the best reason to write complex code: It makes it easier to hide your skeletons in it.  ;-)
Bolkonskij
Administrator
1024 MB
*****
Posts: 2023
View Profile Cornica - Video Entertainment for Mac OS users
Reply #4 on: November 17, 2021, 20:44

That comment reminded me of the interview with Stroustrup, inventor of C++. I just have to copy & paste it here :-)


Interviewer:
Well, it's been a few years since you changed the world of software design.  How does it feel, looking back?

Stroustrup:
Actually, I was thinking about those days, just before you
arrived.  Do you remember?  Everyone was writing 'C' and,
the trouble was, they were pretty damn good at it.

Universities got pretty good at teaching it, too.  They were
turning out competent - I stress the word 'competent' -
graduates at a phenomenal rate.  That's what caused the
problem.

Interviewer:
Problem?

Stroustrup:
Yes, problem.  Remember when everyone wrote COBOL?

Interviewer:
Of course, I did, too.

Stroustrup:
Well, in the beginning, these guys were like demi-gods.  Their salaries were high, and they were treated like royalty.

Interviewer:
Those were the days, eh?

Stroustrup:
Right.  So what happened?  IBM got sick of it, and invested millions in training programmers, till they were a dime a dozen.

Interviewer:
That's why I got out.  Salaries dropped within a year, to the point where being a journalist actually paid better.

Stroustrup:
Exactly.  Well, the same happened with 'C' programmers.

Interviewer:
I see, but what's the point?

Stroustrup:
Well, one day, when I was sitting in my office, I thought of this little scheme, which would redress the balance a little.  I thought 'I wonder what would happen, if there were a language so complicated, so difficult to learn, that nobody would ever be able to swamp the market with programmers?

Actually, I got some of the ideas from X10, you know,
X windows.  That was such a bitch of a graphics system,
that it only just ran on those Sun 3/60 things.  They
had all the ingredients for what I wanted.  A really
ridiculously complex syntax, obscure functions, and
pseudo-OO structure.  Even now, nobody writes raw X-windows
code.  Motif is the only way to go if you want to retain
your sanity.

Interviewer:
You're kidding...?

Stroustrup:
Not a bit of it.  In fact, there was another problem.
Unix was written in 'C', which meant that any 'C'
programmer could very easily become a systems programmer.
Remember what a mainframe systems programmer used to earn?

Interviewer:
You bet I do, that's what I used to do.

Stroustrup:
OK, so this new language had to divorce itself from Unix,
by hiding all the system calls that bound the two together
so nicely.  This would enable guys who only knew about DOS
to earn a decent living too.

Interviewer:
I don't believe you said that...

Stroustrup:
Well, it's been long enough, now, and I believe most people
have figured out for themselves that C++ is a waste of time but,
I must say, it's taken them a lot longer than I thought it would.

Interviewer:
So how exactly did you do it?

Stroustrup:
It was only supposed to be a joke, I never thought people would
take the book seriously. Anyone with half a brain can see that
object-oriented programming is counter-intuitive, illogical and
inefficient.

Interviewer:
What?

Stroustrup:
And as for 're-useable code' --- when did you ever hear of a
company re-using its code?

Interviewer:
Well, never, actually, but...

Stroustrup:
There you are then.  Mind you, a few tried, in the early days.
There was this Oregon company --- Mentor Graphics, I think they
were called --- really caught a cold trying to rewrite everything in C++ in about '90 or '91.  I felt sorry for them really, but I thought people would learn from their mistakes.

Interviewer:
Obviously, they didn't?

Stroustrup:
Not in the slightest.  Trouble is, most companies hush-up all
their major blunders, and explaining a $30 million loss to the
shareholders would have been difficult.  Give them their due,
though, they made it work in the end.

Interviewer:
They did?  Well, there you are then, it proves O-O works.

Stroustrup:
Well, almost.  The executable was so huge, it took five minutes
to load, on an HP workstation, with 128MB of RAM.  Then it ran
like molasses. Actually, I thought this would be a major
stumbling-block, and I'd get found out within a week, but nobody
cared.  Sun and HP were only too glad to sell enormously powerful boxes, with huge resources just to run trivial programs.  You know, when we had our first C++ compiler, at AT&T, I compiled 'Hello World', and couldn't believe the size of the executable: 2.1MB

Interviewer:
What?  Well, compilers have come a long way, since then.

Stroustrup:
They have?  Try it on the latest version of g++ - you won't get
much change out of half a megabyte. Also, there are several quite recent examples for you, from all over the world.  British Telecom had a major disaster on their hands but, luckily, managed to scrap the  whole thing and start again. They were luckier than Australian Telecom.

Now I hear that Siemens is building a dinosaur, and getting more and more worried as the size of the hardware gets bigger, to accommodate the executables.  Isn't multiple inheritance a joy?

Interviewer:
Yes, but C++ is basically a sound language.

Stroustrup:
You really believe that, don't you?  Have you ever sat down and worked on a C++ project?  Here's what happens: First, I've put in enough pitfalls to make sure that only the most trivial projects will work first time.

Take operator overloading.  At the end of the project, almost every module has it, usually, because guys feel they really should do it, as it was in their training course.  The same operator then means something totally different in every module. Try pulling that lot together, when you have a hundred or so modules.  And as for data hiding, God, I sometimes can't help laughing when I hear about the problems companies have making their modules talk to each other.

I think the word 'synergistic' was specially invented to twist
the knife in a project manager's ribs.

Interviewer:
I have to say, I'm beginning to be quite appalled at all this.
You say you did it to raise programmers' salaries?  That's ob-
scene.

Stroustrup:
Not really.  Everyone has a choice.  I didn't expect the thing to get so much out of hand. Anyway, I basically succeeded.  C++ is dying off now, but programmers still get high salaries, especially those poor devils who have to maintain all this crap.  You do realise, it's impossible to maintain a large C++ software module if you didn't actually write it?

Interviewer:
How come?

Stroustrup:
You are out of touch, aren't you?  Remember the typedef?

Interviewer:
Yes, of course.

Stroustrup:
Remember how long it took to grope through the header files only
to find that 'RoofRaised' was a double precision number?  Well,
imagine how long it takes to find all the implicit typedefs in
all the Classes in a major project.

Interviewer:
So how do you reckon you've succeeded?

Stroustrup:
The universities haven't been teaching 'C' for such a long time, there's now a shortage of decent 'C' programmers.  Especially those who know anything about Unix systems programming.

How many
guys would know what to do with 'malloc', when they've used 'new' all these years and never bothered to check the return code. In fact, most C++ programmers throw away their return codes.  Whatever happened to good ol' '-1'?  At least you knew you had an error, without bogging the thing down in all that 'throw' 'catch' 'try' stuff.

Interviewer:
But, surely, inheritance does save a lot of time?

Stroustrup:
Does it?  Have you ever noticed the difference  between a 'C' project plan, and a C++ project plan?  The planning stage for a C++ project is three times as long.  Precisely to make sure that everything which should be inherited is, and what shouldn't isn't.  Then, they still get it wrong.

Whoever heard of memory leaks in a 'C' program? Now finding them is a major industry. Most companies give up, and send the product out, knowing it leaks like a sieve, simply to avoid the expense of tracking them all down.

Interviewer:
There are tools....

Stroustrup:
...Most of which were written in C++.

Interviewer:
If we publish this, you'll probably get lynched, you do realise
that?

Stroustrup:
I doubt it.  As I said, C++ is way past its peak now, and no company in its right mind would start a C++ project without a pilot trial. That should convince them that it's the road to disaster.  If not, they deserve all they get.  You know, I tried to convince Dennis Ritchie to rewrite Unix in C++.

Interviewer:
Oh my God.  What did he say?

Stroustrup:
Well, luckily, he has a good sense of humor.  I think both he and Brian figured out what I was doing, in the early days, but never let on.  He said he'd help me write a C++ version of DOS, if I was interested.

Interviewer:
Were you?

Stroustrup:
Actually, I did write DOS in C++, I'll give you a demo when we're through.  I have it running on a Sparc 20 in the computer room.  Goes like a rocket on 4 CPU's, and only takes up 70 megs of disk.

Interviewer:
What's it like on a PC?

Stroustrup:
Now you're kidding.  Haven't you ever seen Windows '95?  I think
of that as my biggest success.  Nearly blew the game before I was
ready, though.

Interviewer:
You know, that idea of a Unix++ has really got me thinking.
Somewhere out there, there's a guy going to try it.

Stroustrup:
Not after they read this interview.

Interviewer:
I'm sorry, but I don't see us being able to publish any of this.

Stroustrup:
But it's the story of the century.  I only want to be remembered
by my fellow programmers, for what I've done for them.  You know
how much a C++ guy can get these days?

Interviewer:
Last I heard, a really top guy is worth $80 - $90 an hour.

Stroustrup:
See?  And I bet he earns it.  Keeping track of all the gotchas I put into C++ is no easy job. And, as I said before, every C++ programmer feels bound by some mystic promise to use every damn element of the language on every project.

Actually, that really annoys me sometimes, even though it serves my original purpose. I almost like the language after all this time.

Interviewer:
You mean you didn't before?

Stroustrup:
Hated it.  It even looks clumsy, don't you agree?  But when the
book royalties started to come in... well, you get the picture.

Interviewer:
Just a minute.  What about references?  You must admit, you
improved on 'C' pointers.

Stroustrup:
Hmm.  I've always wondered about that.  Originally, I thought I had.  Then, one day I was discussing this with a guy who'd written C++ from the beginning.  He said he could never remember whether his variables were referenced or dereferenced, so he always used pointers.  He said the little asterisk always reminded him.

Interviewer:
Well, at this point, I usually say 'thank you very much' but it
hardly seems adequate.
Last Edit: November 17, 2021, 20:55 by Bolkonskij
68040
512 MB
*****
Posts: 950
68k - thy kingdom come, thy will be done !
View Profile
Reply #5 on: January 17, 2022, 00:32

Quote: "You know, when we had our first C++ compiler, at AT&T, I compiled 'Hello World', and couldn't believe the size of the executable: 2.1MB"

And he thought that was huge? Try to compile an empty text string these days and you'll end up with ten times that size.

Btw, I think that interview - despite being an interesting read - was meant as a joke from top to finnish.
Fact is, you can not write code in straight C - or any other non-OO language - if more than a dozen folks are working on it. I say that both as a system admin and as a tech project lead. Modern day corporate software projects involve hundreds if not thousands of programmers. And w/o the data isolation that OO offers any one of those workers bees could easily mess up the code of anybody else, by misshandling variables or not properly cleaning up data areas.

Object oriented programming isolates those mistakes to a single module. The code might still crash, but at least you can locate the error quickly and know who to pursecute for that,

The days when two great geniuses could just sit down and write a new operating system out of the blue are long gone. Now such projects involve dozens of stake holders, each with differing demands, and a time table dictated by the speed of the Internet news cyclce.
You got to throw manpower at it to adhere to the the deadline and that requires an object oriented approach, to keep your code manageable.
Last Edit: January 17, 2022, 00:37 by 68040
Bolkonskij
Administrator
1024 MB
*****
Posts: 2023
View Profile Cornica - Video Entertainment for Mac OS users
Reply #6 on: January 17, 2022, 13:44

When the popular web framework React came out and I started writing my first hello world app (create react-app) it drew hundreds and hundreds of dependencies. That was the moment where I decided to drop it and never touch such a house of cards again.

You're right - the interview is all fake and taken from an old usenet post. BUT, there's some truth in it and if you've been into programming you know first-hand. The part about having to invent stuff to increase one's own relevance is what I feel the real reason behind the "five new Javascript frameworks every monday" syndrome we see today.

I agree about the merits of OOP (though stuff can get pretty messy too if not taking precaution, e.g. give your methods really good names) but the abstraction of logic from the actual data makes it easier to handle on larger scale projects as you described.

BUT, as with so much other stuff (SSL encryption, frameworks etc.) it is used mindlessly. Someone in middle-management somehow snaps up that "OOP is the future" and hence every future project has to be written in OOP - even ones where it makes absolutely no sense. Just so he/she can report the higher-ups that "we're utilizing an advanced method of programming which will save you $$$" to catch his/her bonus.
Last Edit: February 05, 2022, 20:38 by Bolkonskij
68040
512 MB
*****
Posts: 950
68k - thy kingdom come, thy will be done !
View Profile
Reply #7 on: February 05, 2022, 19:49

Well Bolkonskij, as far as management's influence on IT-projects is concerned I can vouch for the fact that "Dilbert" isn't a cartoon series, but a real life documentary. 

PS: No need to abandon the generic masculine in English - yet. ;-)
Last Edit: February 05, 2022, 19:56 by 68040
Pages: [1]

© 2021 System7Today.com.
The Apple Logo, Macintosh™, Mac OS™, and others property of Apple Computer, Inc.
This site is in no way affiliated with Apple Computer, Inc.