Wednesday, October 26, 2011

Dennis Ritchie vs. Steve Jobs

I've been hearing about how great Steve Jobs was for years. Yeah. Yeah. Huge impact. Huge.

But two people died in the last few weeks and one of them had a tremendous impact on everything you touch. The other was Steve Jobs.

Let us go back to the late Triassic of computers: the 1960's. Remember that line in Apollo 13 about how great the space program to create a computer that could fit in a single room? That was the time.

Computers do essentially five things: test, branch, put to memory, fetch from memory and add. Everything else computers do is a variation or extension of these five operations. Back in the day, there were essentially three languages: COBOL, FORTRAN and assembly language. COBOL was used in business. FORTRAN was used in math and science. Everything else, from hospital information systems to a whole lot of billing and tracking of population data was done in assembly.

Assembly language is essentially a symbolic representation of machine operations. It is machine specific. For example:

MOV r1, #0x01139ba


TAM #0x01139ba

are essentially the same functional instruction. The first is move contents of register 1 to the address. The second is transfer the contents of the A register to the address.

Portability of assembly language was never an option. Not only was the syntax functionally different (I won't bother to descend in the hell of opcodes) the implementation of the functionality was different. While every computer had to execute those five functions I listed above, it's not easy to implement complex functionality in just those five ways. In addition, each machine manufacturer had its own idea of how to manage the problems. How to address memory? Use memory for the add function? It would be faster to do it in specialized electronic components called registers. (Hence the TAM instruction above.) There was more in common between a dog and a horse than there was between IBM 360 assembly and Harris assembly.

At least both the dog and the horse have the same number of legs.

What assembly language had to offer was to present no impediment between what the programmer wanted and what the fundamental machine provided. COBOL and FORTRAN provided a layer of insulation between the underlying machine and the programmer. That was fine if you didn't want to look at what the machine could do but not so great if you had to access that functionality. Some FORTRAN compilers allowed the programmer to include assembly language right in FORTRAN code.

Enter Dennis Ritchie.

The need for computer languages that operated at a higher level than assembly (and was not COBOL or FORTRAN but something more formal) had been recognized for some time. ALGOL was an early idea.

Dennis Ritchie and Ken Thompson looked at ALGOL. Liked some of it but thought the rest was cumbersome. They took the best parts of ALGOL and their own preferences and created the programming language C.

C was a portable language. It was simple. It was versatile. And it took the computer world by storm. C was first released in the early seventies. It gave all of the usual functionality of assembly languages without the platform dependence. If you wanted to write a program on one machine and then have it run on a second machine from a different manufacturer it was murderously painful.

Even better, it was structured. You have to understand at this point in programming there was a war being fought between structured and unstructured programmers. Structured programmers tried to write code that was readable and, hopefully, elegant. Unstructured programmers thought structure made you weak. Comments (annotations in the code that told you what the code was doing) were considered unmanly.

Think about this code:

i = 10;

now this

monetaryDenomination = 10;

Which is more informative? The computer doesn't care. 10 is 10.

I remember working my way through five thousand lines of uncommented assembly code one night just to figure out why a carriage return was present in one report option and not in another.

By the eighties everybody was either adopting C or getting ready to adopt C. Go on line and look for FORTRAN and COBOL jobs. See any? Now look for C jobs or their derivatives.

Everything you operate either runs on C or one of the C derivatives. C++? Derived from C. Java? Created in response to C++ which was derived from C. Python? Derived from smashing Java into C++. Javascript? from Java.

Ritchie was also instrumental in the creating Unix, from which Linux derived. Both are written in C. Using your android phone? Got Linux. Mac? Uses a descendant of the NeXTSTEP operating system, a variant of Unix, written in C. IPhone? Written in C++. Google? Lives in the Cloud. I bet it resides on Linux, written in C and C++.

Yeah, Jobs did a lot of things. But my hat's off to Ritchie. Jobs is like the guy who invented the designer car.

Ritchie invented the wheel.

No comments:

Post a Comment