Counting Cats in Zanzibar Rotating Header Image

I Say It’s Spinach

So this is dedicated to Nick (and the first part of it is meant in the spirit of friendly teasing; no serious criticism intended). It was brought on by his response to the discussion on “Bibi to Obama,” but somehow it got so long and was so far O/T that I thought I really shouldn’t entirely derail that discussion. Hence the new posting. It happened like this….

Nick ended his passionate defense of the Israelis’ contributions to the Global Good by referring to their improvements in computer technology thus:

August 4, 2014 at 8:05 pm

Write a program once and… I have more computing power on my lap in this Lenovo S440 Thinkpad than probably existed in 1960 on the planet. The CPU was designed in Israel.

Never one to keep to the subject, I interjected the question,

Nick, one can actually program that sucker?

meaning the Lenovo Thinkpad, that is.

Nick responded to that:

August 5, 2014 at 8:12 pm

You don’t program a computer, you program a language. I know BASIC (I love BASIC – it’s great for five minute calculations and “sketching ideas”), Pascal, Fortran(!!!) and a few scripting type stuff like Javascript. And of course HTML and CSS but that’s not quite the same thing. I’m quite good in a limited sense – basically mathematics is my thing. I’ve been considering learning to write Android apps. I never could hack Machine Code and whilst I can write basic C, C++ defeated me. I just didn’t get the object-orientated paradigm. Part of the problem with learning C (and it’s descendants such as C++ and C# is the flexibility of syntax which means other folks programs can be unbelievably cryptic).

I adored that response, because I too am a HUGE fan of Fortran. Besides, it offered me an opportunity to issue a correction, a hobby of mine which, surprisingly, some people seem to find tiresome. Ah well, their loss…. :)

So I commenced, and the thing grew, and, well, here we are. Or here I am anyway. You, dear reader, may have gone on to washing your hair, or cleaning the groove in the patio door….

* * *
Nonsense, Mr. Mc[I-forget-the-rest] *g*. You program a computer IN a language. You USE a language to program a computer (in any given particular case). More correctly still, you write a program FOR (or to be RUN ON) a computer IN a language. I trust this clarifies the matter. *haughty sniff*

By the way, one does not write “machine code.” At least, not unless you mean writing in actual hex, or octal, or, to really get right down to it, binary. And it is insulting and fake elitism to talk about “writing code*” or saying something gaggingly sophomoric like “do they ship code on time.” Yes, I’m looking at you, Eric Raymond.

*Toward the end of my “career,” there developed a custom where System Engineers designed the layout of programs, including writing the specs; these were handed off to the “programmers,” who (I guess) drew up flow-charts and indicated where blocks of instructions (i.e. “code,” f’rgod’ssakes) would go, and passed those on to mere “coders,” who wrote out the actual instructions comprising the program. Division of labor, don’tcha see.

The upshot of that was that real programmers, now called “coders,” got a bad name as being the less-than-bright grunts of the data-processing hierarchy. I hope this dreadful faux-efficiency-system dropped dead long ago. Complete modularity in creative endeavors does not work.

But as to the main point. Basic rocks. No it is NOT a “toy”; it comes within hailing distance of Fortran. And Fortran IV-G or IV-H, awesome !!! is the only high-level language worth using professionally. Ahem. At the lower level, Assembler (for the S/360-370) and its cousins in the Assembly Language level, Autocoder for the 1401 and 7070 series, Map for the 7090-7094, so forth are the best of the best.

I LOVED Fortran and Assembly Languages, specifically Fortran IV and Assembler. You could get at the machine! You could tell it step by step exactly what to do, you could make it change its instructions, you could tell it to stop using valuable space for instructions and stick some data in there instead, and vice-versa. You could probably have told it to unplug itself, and then plug itself back in!

You sure couldn’t do that with COBOL. COBOL was for people who couldn’t be trusted to go messing about with the machine’s insides. Such things as “peek” and “poke,” even, could not be allowed to Business Types who probaby needed help tying their shoelaces.

I used to try to write COBOL in Fortran, just because of the whole logorrhea business. Thankfully I subsequently worked for an outfit that actually had programmers. Assembler, YUM.

Nick, do not feel like the Lone Ranger. I have messed about a bit with C and follow-ons, and as far as I can tell, the object of so-called OOP languages is to complify, complify, complify. The syntax would seem to defy any vaguely-human logic. Ostensibly these languages were developed so that any fool could read and understand at once any other fool’s program. Tchah! In any case, I was trying to correct an information deficit, as is my Nature, but not trying to put biscuits on the table, so lacking that incentive, in the end I treated the Book as the Koran was not treated by the boorish wardens at Guantánamo, and never looked back. :>))

. . .

Really, there’s nothing mysterious about the basic idea. In assembly languages and the next level of languages, Fortran, COBOL, whatever else qualifies, you have “routines,” which — and this is all as it was denominated in my day, back before the Silurian Epoch — meant the entirety of a program. Some portions of the program were dedicated to particular tasks and were distinct enough from other portions to be little mini-programs — “subroutines” — in their own right.

Somewhere along the way some bright language-designer or programmer (they once upon a time occupied the same physical body, can you imagine!) figured out that some of those subroutines were used often enough that it would be convenient to plunk them down, pre-fabricated, into his program. So he dreamed up a way to “call” the subroutine from within the main program. This little block of instructions that executed the “subroutine call” was incorporated into the main program with a special name or mock op-code of its own. IIRC, which I might not, in Fortran you just wrote “Call so-and-so” and then wrote a list of parameters the called subroutine would use.

Of course, you could get the exact same result by branching to the subroutine in the normal way, provided you knew where everything was (Assembly languages, Fortran). But the Subroutine Call was more elegant in a way, and when it was properly written at the assembly-language level (or IN Fortran FOR Fortran programs) you could use it pre-fab in any program into which it could be compiled. (Assembler subroutines for Assembler programs, Fortran subroutines for Fortran programs, even COBOL subroutines for COBOL programs, etc., though the subroutine itself might not be in the same language.)

Thus were developed Subroutine Libraries, which when you licensed whatever language and its compiler from whomever (by which I imagine I mean, chiefly, IBM) you could get the subroutine library as well, with all its useful pre-fab routines.

Then, some dingbat had the idea of obfuscating the basic logic of the pre-fabbed subroutines system by calling these subroutines “macros.” So now instead of having a subroutine call in a program, you used a “macro,” which as far as I could tell was just the same old thing under a new name.

Macros were used in Assembly languages, like Map and Assembler. I can’t remember if Autocoder had any macros or not. When we got our first Mac, a Mac Plus, it still had macros. In that case at least (and in Excel) one could write one’s own macros. But they were still just subroutines.

Now we have Object-Oriented Programming languages, OOPs. Indeed! In which, I gathered, the idea was to write programs by assembling blocks or “modules” of “code” (read, putting together various sets of subroutines) to accomplish the program’s results.

The syntax would appear to be a nightmare. Why go through all that when you can just haul out the ol’ Fortran, or the appropriate assembly language for the machine-cum-OS.

I say it’s spinach, and I say the hell with it.


  1. endivior says:

    OOP isn’t so hard to understand if you read Dilbert. I can’t remember the exact quote but it’s where the pointy-headed boss is being shown how to program. “Oh, I get it,” he says. “You whack the bug object with the fly-swatter object and then sweep it up with the pan object”.

    As I understand it, OOP developed as a response to programs of ever increasing size and complexity having to be shared between programmers who each needed to have a general understanding of what was going on but didn’t have time to follow program execution through every twist and turn. The idea is to turn chunks of code into something more than just “routines”, “subroutines”, “function calls” etc, viz. fully-fledged black boxes. The black box has a name which indicates what’s in it, and a set of methods for doing useful stuff with it, More to the point, there are built-in limitations to what you can do with its contents, since by default its internal variables are out of scope once you’re outside the box. So in practice you can define a “screen” object, and define methods to cover what your program needs to be able to do with the screen. Everything done on screen has to be done through that object: no more accidentally overwriting screen memory while trying to do something else entirely, no more three different programmers each using their own pet API calls to do the same basic thing on screen, etc etc.

    The philosophy is fine IMHO. The practice is something else. I once wrote a rather ambitious educational App in VB. I sent it to a self-styled “expert” for advice. He wrote back saying that the program was insanely profligate with RAM memory, because it insisted on treating even the smallest little thing, such as a block of text, as an “object” which had to have memory allocated for its expected array of properties, methods etc. Basically he recommended un-OOPing the whole darn thing. At that point I gave up.

  2. endivior says:

    “By the way, one does not write “machine code.” At least, not unless you mean writing in actual hex, or octal, or, to really get right down to it, binary.”

    Well, there’s Dilbert again. “Back in my day we didn’t have these fancy instructions. We just used 1s and 0s. And sometimes we didn’t even have 0s.”

    I used to write machine code in decimal, then POKE it into place with BASIC. The reason was that I had an Amstrad PCW, which came with a Word processor (Locoscript), a fairly good implementation of Basic (Mallard), an obsolete off-the-back-of-a-lorry operating system (CP/M), a weird pseudo programming language for kids (Dr Logo) and not much else. So if you wanted your green and black screen to, say, attempt to trace in pixels the silhouette of a female human figure (and why else would someone have a computer) you had to program it yourself. Along with all the other things such as games, databases etc. So I taught myself BASIC only to discover that it didn’t actually do a lot of things without some POKEing. So I bought a ZX-80 machine code instruction manual and learned to POKE. Mostly we’re talking about two to three lines of numbers that did simple things like overwrite the screen character set with a niftier font. But it was quite a sense of achievement when, as occasionally happened, your strings of numbers did not crash the machine as soon as you ran them.

  3. NickM says:

    Julie I know it’s Assembly. I just used “Machine Code” cos, to the uninitiated makes it sound like I’m sleeping with Molly. And I think I’m a bit younger than you so I’ve only seen a punched-card in a museum. I guess the script kiddies today laugh themselves hoarse if the saw my 48K Speccy from over 30 years ago. The price of progress and all that.

    Fortran ultimately fails for me because unlike, say, QBasic (and how old is that?) you can’t write structured code. I once spent an entire afternoon trying to work a math routine in something between Fortran 77 and Fortrran 90 (our tech guy had higgle-piggled it on the Unix net) to avoid using a GOTO. There was no alternative. My office-mates concurred.

    I felt dirty. It’s the difference between fine dining and fine wine with Cate Blanchett and back-scuttling some slag over a wheelie bin in Blyth whilst a particularly sordid looking stray dog licks your thighs. And Julie, if you never experienced the “Blyth Spirit” you’re lucky. My mother almost bought a house there. I’m very glad she didn’t. It has bars you can get the clap from just by driving past,

    I must admit to never having had either of the above “dating experiences”. I am actually quite conservative though I have done questionable things in my youth. But not that questionable. Actually that tableau vivant is not questionable is it really? Just vile. I have though seen such things happen mind. Terrible, dreadful things like scenes from Spiritus Mundi.

  4. NickM says:

    I have used an Amstrad PCW256. When I get my hands on Alan Sugar there will be antics and a veritable Biblical hoicking up the bracket and indeed elsewise.

    What the fuck was the score with those utterly non-standard 3″ floppies. And CP/M? Dear Sweet Jesus wept on the graves of four Yorkshiremen.

    I get it Endivio that you have to get OOP but I just didn’t so… back to structured. I didn’t get that at first (Wot no line numbers!) so maybe… We shall see.

  5. endivior says:

    NickM, did you ever see Micro Men? It’s like a medieval morality play on the subject of the evils of State funding of half-assed business projects which are given millions to play with on account of the scrounger having a shiny bald pate and an otherworldly boffin-like air. At the end Clive is happy in his glorified dodgem cruising along at 30mph while overtaken by the juggernauts of Microsoft and IBM. Charming stuff. Well, Alan Michael Sugar gets a cameo appearance at the end as a sort of not quite top drawer cockney wide boy trying to get one up on our stricken hero. There’s lots of nostalgia in there – even a scene with music from Kraftwerk. Not that I’m suggesting you’re old or anything.

  6. bloke in spain says:

    “When I get my hands on Alan Sugar there will be antics …etc”
    My recollections of the gentlemen were of a stripy shirted creep ran an electronic components mail-order operation from a room over Brentwood Taxis. No-one seemed to be able to get his stereo amplifier board for the TBA810S to work.
    Did you know his old man was a market trader? Flogged lines of cheapo schmutter, if memory serves correct.

  7. NickM says:

    My problemo with Sugar is that he deliberately tried to tie folk in by making his stuff deliberately non-standard. Those 3″ disks are an example and the re-wired joystick ports on the Spectrum +2 are another. Just nastiness.

    You’re fired by the way.

  8. Eddie the Oldie says:

    It all changed, but ever so gradually, with the development of ‘user interfaces’ (think Xerox, Mac, Windows etc), and all of a sudden we were into graphics, icons, buttons, mouse pointers (or now finger gestures), menus (which could pop up or drop down), animations, help bubbles, online help, resizable windows and all of the razzamatazz one sees nowadays. There had been an intermediate, character-based, stage with single and double line outlined boxes etc. My doctor’s surgery has this month transitioned from that to a Windows based system, so that they can now draw graphs of one’s blood tests over several years! (This gives proof that the drugs for one complaint kick off treatment for something else, e.g. the blood pressure tablet causes cholesterol changes and blood sugar changes, which mean you get prescribed a statin, which really kicks off the so-called ‘type 2 diabetes’, for which you get an insulin replacement substance – each and every step causing a chain of other complaints on the way. Fortunately, the whole shebang makes you suicidal, which at least has the potential to put an end to the whole cycle.)

    For the Fortran cognoscenti, it moved on a long way from Fortran IV of around 1966, with revised standards being issued in 1977, 1990, 1995 and 2003, each increment providing increased inter-language operability. Of course, inter-language operations have always been there, and a good example is programming in anything except C to access Windows which is a stronghold of C.

    Perhaps the deepest distinction is between languages that are assembled, interpreted or compiled, meaning respectively they look like a human readable version of what drives the machine; they are converted on the fly; or they are converted once and for all with a bit of software called a compiler.

    There’s a British outfit that produces a compiler for Fortran that really simplifies creating Windows programs. This outfit is up in Salford, and is called Silverfrost. A number of us oldies use this to compile code of considerable age (in my case some dating back to 1969) and yet turn it into proper, fully-fledged, Windows applications, although sadly we are snookered for iOS, Android and even Windows RT. However, the code that ran perfectly satisfactorily (if a little slowly) on an IBM 1130 in 1970, or an 8086 cpu in and Apricot in 1985 has grown from 40kb to 4Mb, and from several hundred lines into well over a hundred thousand lines of Fortran to do it – but wow, it runs fast now.

  9. Sam Duncan says:

    Well, the 3″ drives weren’t so much “deliberately non-standard” as “cheap”. Largely because nobody wanted them, but hey… they worked. Kind of.

    They were actually quite popular in Japan, and it was touch-and-go for a while which format would come out on top. You often find them in old MSX machines. But once “IBM-compatible” types adopted the 3.5″, that was that.

    The real problem with strapping them to a Speccy was that the most popular floppy drive controllers for the diskless machines – the MGT’s DISCiPLE and +D, and Opus’ Discovery – were all 3.5″. Those tried to remain at least vaguely compatible with the system designed for the Microdrives – numbered streams for random-access I/O, the FORMAT and CAT commands for disk management, etc. – but Amstrad threw that all out in favour of a completely novel extension to the BASIC, a single “DOS” command followed by a bunch of directives, to maintain some kind of compatibility with other Amstrad machines. It all just added to the already strong impression that it wasn’t a real Sinclair.

    There was no excuse for the +2 joysticks. Other than that nobody would have bought the piles of junk if they hadn’t been forced to by the custom wiring.

    But today Amstrad are perfectly happy with the use of Spectrum ROMs in emulation, which is nice of them. Probably because Sugar doesn’t give a crap about it any more, but still.

    I once spent an entire afternoon trying to work a math routine in something between Fortran 77 and Fortrran 90 (our tech guy had higgle-piggled it on the Unix net) to avoid using a GOTO. There was no alternative. My office-mates concurred.

    I felt dirty.

    Heh. As well you might. Even the Speccy had DEF FN().

    The ZX81 didn’t. I once decided to try to port the original Football Manager – which is in BASIC – to C. (Well, it’s something to do.) I chose the ZX81 version because it’s text-only, so I could do it all in stdio and make it really portable, which was the idea. After a couple of weekends I just gave up. Holy cow, that code’s a nightmare. I mean, I’m sure if I sat down and really put my mind to it I could have done it, but geez… 9000-odd lines of GOTOs jumping about all over the shop. And I’m not much of a programmer in the first place. I don’t think I’ve touched anything more complicated than Bash scripts in ten years.*

    OOP. Yes, it has its place. I kind of get it. I’ve run into it when investigating game engines, and it really makes a lot of sense there: define an NPC class, say, then spawn a hundred of them which all go about their business more or less independently without you having to worry about them in the main loop until one of them pops up to say it’s hit something. It’s all actually rather nice.

    And I don’t doubt that it has its serious uses too. Let’s face it: it’s all abstraction in the end. If it helps – as it does there – to think of things as objects, then fine. Where it gets annoying is when people look down on anyone not jumping on the bandwagon. Linus Torvalds is very entertaining when asked why the Linux kernel isn’t in C++.

    *Although, if you’re looking into Android, Nick, RFO BASIC is very nice. You can develop standalone .apks in it, although to be honest it looks like such a faff it’s probably just as easy to go the full Java. But it’s fun for messing about with.

  10. NickM says:

    Interesting stuff Sam.

    Coupla points this wouldn’t have fitted in and def fn – no how no way. It was 50+ lines of dense code and of course FORTRAN was designed for maths,

    Of course third parties provided re-wired adaptors for the Amstrad stick ports but you know…

    Ah, Football Manager. That takes me back to about 2 years ago when I played it on an emulator. Simple pleasures from the ’80s. Show that to a kid of today…

    I’ll give RPO BASIC a butchers. Who knows? This time next year we could be millionaires!

    I dunno why I’m saying this but my wife just got an iPhone. I’m really curious as to how it compares with my Motorola Android. That’s got a 2GHz CPU. My first PC had a stately 16MHz 386SX.

    Steve Jobs getting his claws in from beyond the grave. I don’t tend to “do ” Apple.

    Although I don’t mind because my last er… job involved Windows 8.1. Odd that “8″ rhymes with “hate” is it not? It gave me the right hump. I have never known an OS less intuitive. I mean UNIX might sometimes be a bit hard but it makes sense. Was Steve Ballmer having one of his “moments”

    Anyway, we’d best stop this tech-talk before completely Alien8-ing Paul.

  11. CountingCats says:

    I missed this thread.

    Julie, of course you can write in machine code.

    Well, I guess what I did was write in assembley code, hand assembled it into hex, and then entered the hex codes directly into the machines memory. I saved the contents of that chunk of memory to a file, and than made the file executable.

    Damn, but that takes me back.

    FORTRAN? You really like that? The only high level language I would use from choice was C, and then only because it allowed me an assembley level of control.

  12. Julie near Chicago says:

    Oh, Cats, you must have been using the wrong, i.e. later, versions of Fortran. REAL Fortran, F-IVG and H (vintage ~1965) is just as good as any assembly language with the possible exception of direct control of the registers. (Can’t remember if we could access those or not.) But within the space allotted to the program, including the data space, you could absolutely anything you wanted. You could change the instructions in the middle of execution. You could change the program layout in the machine on the fly, if for some reason you wanted to. You could do arithmetic on the instructions. You could make instructions out of the data, if you knew what it was, and get the machine to execute those. All because you could keep track of the addresses the program was using, easily, without a lot of jumping through hoops (and COBOL didn’t have any hoops even. You had no say over what was where. BARF!).

    Oh, you could make the machine sing!

    Now except for messing around with the early Macs, I never did any programming in actual hex, but actually we did a certain amount of programming in binary, kidding the Fortran assembler that it was data, and then directing the program to execute the results…. Well, we used masks to get the binary instructions during run-time, or if including them in the assembly, we figured out the decimal equivalent of the binary and used that as “data.”

    It was a blast.

    And remember, those machines were TINY! The 7094 had a whopping 64K of memory! You had to be able to write very compactly, which is one reason why we did a lot of moving stuff around — using data space for instructions, substituting other routines later in a program run when the initial instructions weren’t going to be used anymore.

Leave a Reply

%d bloggers like this: