The Greatest Invention in Computer Science

June 6, 2008

What do you think the single greatest invention in computer science is? Besides the computer itself, I mean.

Seriously, before reading any further, pause here for a moment and consider the question.

I've talked before about how young so-called modern computer programming languages really are, and it bears repeating for context.

C is roughly as old as I am; FORTRAN is as old as my parents. But what about the new kids on the block? The TIOBE software TCPI metrics page provides some data on language popularity going back to the year 2001. Consider the tender age of many of the newest, hippest programming languages:

Ruby is barely a teenager. JavaScript and PHP haven't even hit their teens yet.

For all our talk about fancy new programming language features, I sometimes think we forget the one fundamental building block underlying all of them: the humble routine. Take it from Steve McConnell, who urges us to Use Routines, Routinely:

Aside from the invention of the computer, the routine is arguably the single greatest invention in computer science. It makes programs easier to read and understand. It makes them smaller (imagine how much larger your code would be if you had to repeat the code for every call to a routine instead of invoking the routine). And it makes them faster (imagine how hard it would be to make performance improvements in similar code used in a dozen places rather than making all the performance improvements in one routine). In large part, routines are what make modern programming possible.

If you're not old enough to remember life before routines, I thought James Shore had a great example of the stark difference in his excellent article Quality With a Name:

Before structured programming:

1000 NS% = (80 - LEN(T$)) / 2
1010 S$ = ""
1020 IF NS% = 0 GOTO 1060
1030 S$ = S$ + " "
1040 NS% = NS% - 1
1050 GOTO 1020
1060 PRINT S$ + T$
1070 RETURN 

After structured programming:

public void PrintCenteredString(string text) {
  int center = (80 - text.Length) / 2;
  string spaces = "";
  for (int i = 0; i < center; i++) {
    spaces += " ";
  }
  Print(spaces + text);
} 

The humble routine is the backbone of all programming in any modern language. I'm sure you're the very model of a modern programmer, so I won't bore you with a long explanation of why routines are a good idea. The original 1998 IEEE McConnell article covers the rationales behind routines quite well. There's also a greatly expanded version of that material in Chapter 7 of Code Complete 2.

Routines are so fundamental to today's programming that they are essentially invisible. That's the problem with routines: they only take a minute to learn, but a lifetime to master. If bad unstructured programming was possible, so is bad structured programming. You can write FORTRAN in any language. Wrestling with the ineffable essence of a routine is, almost to a first approximation, what programming now is:

  • How long should this routine be? How long is too long? How short is too short? When is code "too simple" to be in a routine?
  • What parameters should be passed to this routine? What data structures or data types? In what order? How will they be used? Which will be modified as a result of the routine?
  • What's a good name for this routine? Naming is hard. Really hard.
  • How is this routine related to other nearby routines? Do they happen at the same time, or in the same order? Do they share common data? Do they really belong together? What order should they be in?
  • How will I know if the code in this routine succeeded? Should it return a success or error code? How will exceptions, problems, and error conditions be handled?
  • Should this routine even exist at all?

Good programmers -- regardless of whatever language they happen to be working in -- understand the importance of crafting each routine with the utmost care. The routines in your code should be treated like tiny, highly polished diamonds, each one more exquisitely polished and finely cut than the last.

I'll grant you this isn't a particularly deep insight. It's not even original advice. But if you believe, as I do, in constantly practicing the fundamentals, you'll never stop mastering the art of writing the perfect routine.

It is, after all, the single greatest invention in computer science.

Posted by Jeff Atwood
173 Comments

Is "logic", or similar concepts, an invention?

jfz on June 8, 2008 3:38 AM

Tjerk:

Depends how you define "invention in computer science". Is abstraction really an invention, per se? I would say that regardless, it is certainly not an invention in computer science. Abstraction FAR predates computer science, even under the "computers have nothing to do with computer science" definitions.*

Even accepting that abstraction is greater and the routine is just a manifestation of same, that does not stop it from being an invention -- an invention I would still argue is a lot greater than the others you list among many dimensions of "greatness".

* This goes for "logic" and a bunch of other suggestions too. We needed these "inventions" for fire and a bunch of other inventions that came far before comsci or anything else related.

Ens on June 8, 2008 4:31 AM

What about lisp and smalltalk? They're just as modern as any modern programming language and they were invented in 1958 and 1969 respectively.

Nicholas Wright on June 8, 2008 4:50 AM

I think you are all wrong. For inventions that changed the world, you just can't beat the CMOS chip. (I know it's clunky now) What CMOS enabled us to do is learn a programming language and port it from one machine to another that is designed very differently. CMOS made it possible for the PC Clones to be usable, for the PC market to grow, for us to have systems to work on. I'd like to think CMOS is the precursor to all modern programming. Maybe I am biased.

Myra on June 8, 2008 5:00 AM

"Actually, I believe the single greatest invention in C.S. is the Data Type. Seriously, think about it: the array, the binary tree, the hash table... How would you do anything useful without them?"

"He [Dijkstra] makes the case for abstraction by arguing that we have small brains, and have to live within their limits, so anything that helps us limit the amount of "stuff" we consider at one time is good."

Data Types and Structures (OOP) are neat and all, but seriously the greatest achievement in C.S. has to got to be that we're constantly learning new ways to deal and manage computer power. That we're actually admitting to ourselves our own limits in respect to computers.

Jazz on June 8, 2008 5:09 AM

re Phil on June 7, 2008 09:39 PM's comments about stack vs BALR

If I recall, many small machine architectures in the 1960's 1970's (1130, some microprocessors) did not put subroutine or function parameters in registers, stacks, nor did they point to them from registers other than the return address register. Self modifying code was OK. The parameter values were placed into memory following the call instruction. In architectures where the caller set the return address, it set it to just after the last parameter. In architectures where the HW stored a return address with a value just past the call instruction, the subroutine/function had to add enough to that return address to point to the instruction after the last parameter. Either way, if there was a variable number of parameters and/or variable length parameters, the exercise got to be fun.


re David W. on June 8, 2008 01:10 AM question: Did Fortran II have local variables?
YES. Function and Subroutine variables were local. So were their names. The same variable names could be used in independently in each routine.
If you wanted them to be global, you had to put them in COMMON
see http://en.wikipedia.org/wiki/Fortran

re: Dr. Goulu on June 8, 2008 05:07 AM "In fact a pure "Von Neumann" architecture isn't really usable without a stack..."
Tell that to the mainframe folks. IBM mainframes do not have PUSH and POP instructions.
In z/Architecture Principles of Operation , SA22-7832-06
https://www-01.ibm.com/servers/resourcelink/lib03010.nsf/B9DE5F05A9D57819852571C500428F9A/$File/SA22-7832-06.pdf
, the words "push" and "pop" do not appear. "Stack" appears 983 times, but usually referring to the program linkage [traceback] stack.

David

DAKra on June 8, 2008 5:17 AM

The stored-program computer (a.k.a. the von Neumann architecture) and code as data.

http://blog.uncommons.org/2008/06/08/great-innovations-in-computing/

As well as making computers much more flexible, it made it possible to write programs that write programs (e.g. compilers).

Dan on June 8, 2008 5:46 AM

The stack.

It's the simplest data structure, and yet the most useful, so essential that its handling is now engraved in the silicon. In fact a pure "Von Neumann" architecture isn't really usable without a stack, while you could build languages such as Forth and computers such as the HP "reversed polish notation" calculators around a stack.

Dr. Goulu on June 8, 2008 6:07 AM

I'd say the single greatest invention in computer science is the concept of treating data in memory as instructions. Such data has come to be called "software". The earliest computers had no such concept. To change the problem the computer was to solve, you had to mount a different plugboard. The invention of software is usually attributed to mathematician John von Neumann.

bumpy on June 8, 2008 7:47 AM

The pointer.

B. K. Oxley (binkley) on June 8, 2008 8:34 AM

I vote for compilers

ccrev on June 8, 2008 10:21 AM

Guess what? If there were no routines we could still program computers to do our bidding. The routine is a great artifact for human comprehension but its hardly necessary.

Surely greater inventions include the algorithm, the the stored program, or (more fundamentally) the function (in the mathematical sense)? Or stored state?

I guess when you have a popular blog you feel compelled to say something periodically even when you have nothing to say.

Geekraver on June 8, 2008 10:53 AM

I think saying that those languages are so young is misleading. The rate of increase of inventions and such has become faster over previous years. For languages from the 70s, for example, 10 years was not that much time because the main users of these languages were small groups of researchers.

However, for languages from today 10 years is a much longer time. The speed of development of languages has increased so much more today. This is due to the Internet and other factors such as open source software which allow for the average person, not just researchers, to contribute to development.

Zach on June 8, 2008 12:05 PM

The routine??? hahaah you truly are stupid.

routine is just a form of abstraction, and abstraction is at the heart of computer science. The real inventions are lambda calculus and model checking and automatons.

Seriouzly you're stupid

Tjerk on June 8, 2008 12:21 PM

I think that XBase, starting with dBase II in 1983 and later Clipper and FoxPro, deserve a very important place in this list. It's power, simplicity and interpreted style have done the path to many improvementes in modern languages like .NET
Even today XBase is still alive and kicking.

Fer on June 8, 2008 1:43 PM

I was just reading through some of the code for Pac-Man
(http://cubeman.org/arcade-source/pacman.asm)
and wishing it was written in something a bit more readable than assembly language.
I kept wishing there were some routines!

But it uses routines: Just look for "jp" (jump) and "ret" (return).

Asm is by ways more readable than pure machine-code ;-)

titrat on June 8, 2008 1:56 PM

Public key cryptography, or cryptography in general must surely rank as one of the most important inventions for Computer Science. It has made online commerce possible and even easy. In order for technology to survive it must be economically feasible. Without secure transactions over the Internet, I'm sure that it wouldn't have grown to where it is today.

Lance Fisher on June 9, 2008 2:04 AM

One can actually make a pretty good case for subroutines being #1, as it demonstrates what makes human reasoning what it is -- the ability to imagine an abstract concept, give it a name, and then refer to it by that name going forward. That's basically what language is all about, no?

BillAtHRST on June 9, 2008 2:50 AM

0 - Zero

http://en.wikipedia.org/wiki/0_(number)

James Carpenter on June 9, 2008 3:08 AM

OK. I'm going with one other poster here and say "the algorithm", and if I have to choose one then it would be the "sorting algorithm". The routine is just the mechanics of implementing something, but "what to do" is way more important!

Chris Mumford on June 9, 2008 3:10 AM

The human brain...
Without it, nothing else matters.

Mac on June 9, 2008 5:39 AM

I would have gone with binary. It might actually be the first application of computer science to solve the fundamental programming difficulty with electronics. Binary makes it possible!

Jeff Davis on June 9, 2008 7:28 AM

I don't even consider "the routine" to be an invention.
It's as simple as GOSUB. As simple as CALL. As simple as PUSH IP, JMP XXXX (and then POP IP).

I mean come on. Sequentially ordered instructions - the "JMP" instruction to redirect flow - a "RET" instruction to return from whence we came. Pretty obvious, even if hindsight IS 20/20.

If you're going to allow "the subroutine" to be an invention, why not "code"? Why not "variables"?

Phil on June 9, 2008 7:32 AM

The greatest invention ever in computing is: copy/paste.
Clearly.

Warren on June 9, 2008 7:33 AM

I came here to opine that compilers are the greatest invention in computer science but everyone beat me to it. Although I sometimes miss programming in 6502 Assembly...

Mike on June 9, 2008 8:02 AM

What about C#? Published in 2000 I think.

Dave on June 9, 2008 8:03 AM

I think the compiler, not the asembler. We had cpu, we had patch cords
and machine lang/asm but what really changed it all the the compiler it made the computer language possible.

jeremy on June 9, 2008 8:25 AM

as any husband will tell you the longest routine ever written is the private why_you_are_wrong() routine... invented by women a long time ago, it is still being wrtitten, and takes an infinite number of arguments. Furthermore, it only ever has one result... a string - 'Yes, Dear'

Red on June 9, 2008 8:46 AM

As to who invented the routine, or at least the idea, I believe that is credited to Ada Lovelace, for use on Babbage's Analytical Engine (the original vaporware in our field). Something like that was also used on Jacquard (sp?) Looms, which led to the invention of Paisley patterns, for instance, which were too difficult to do on manual looms.

Gee, does no one cover the invention of programming, anymore? It was just a couple of days of non-tested material, but it did give a nice historical basis for things.

DWye on June 9, 2008 9:03 AM

@Will

Although most APL was interpreted, there have been some compilers for it and the derivative J language. Most of the compilers used some intermediate source (C/C++) rather than a direct executable compilation.

http://en.wikipedia.org/wiki/APL_(programming_language)#Compilation
http://www.chilton.com/~jimw/apl85.html

However, my APL example was truely misplaced, since my initial APL experience in college was interpreted. This specialty language was not compiler enabled. I appologize.

aikimark on June 9, 2008 9:10 AM

Its really very default to keep track the single Programming language, Because day by day the new programming language are getting introduced , So developers need to update their skills in new domain in order to become a successful developer. These are the language i learnt up to now

1) C
2) c++
3) java
4) PHP
5) Javascript
6) Ajax
7) Adobe AIR

Suresh Kumar on June 9, 2008 9:42 AM

I'd argue for the debugger being the single greatest invention.

Jared Parsons on June 9, 2008 10:26 AM

Does no one ever read any further than the title and first sentence of Jeff's posts?

The point of his post, as I interpret it, was not to prompt a lengthy discussion whether the the routine was in fact the greatest invention in Computer Science (which is a quote from Steve McConnell, not some random assertion Jeff just came up with).

The point was to make you think about what an important concept a routine represents, how fundamental it is to programming and how we still manage to misuse and abuse this simple building block by not thinking enough about the basics.

Graham Stewart on June 9, 2008 10:32 AM

Amen, brother!

IMHO, competent use of this feature has become increasingly uncommon. Part of the reason, I think, is that modern editors and IDE's have made "copy-paste" programming far too easy. Combine this with short attention spans (also an increasingly common phenomenon), and you have a big mess. In one case, a coworker put together a unit-test program that had approx ~1200 occurrences of the (almost) exact same code sequence, each one blithely pasted from the previous. Makes you wonder...

For those of you wondering about how to create good routines, there is still no better guide than the following:

Reliable Software Through Composite Design (Paperback)
by Glenford J. Myers (Author)

(Yes, the mention of tapes, etc. makes it sound a little dated. But this is the seminal work in terms of defining coupling, cohesion, and all the other things that go into making good routines. Plus, you can get it real cheap).

BillAtHRST on June 9, 2008 11:30 AM

Jeff - this post definitely highlights the need for a post on "What does Computer Science mean to you?". I would LOVE to read the comments on such a topic.

Several people here assume CS is theoretical and claim turing machines / lambda calculus are the most important inventions. Likewise, several people including you see CS as more about programming, and say routines are the most important. Some have blurred the distinction between CS and computer engineering and state that the microprocessor is the most important invention. But the ones that make me cringe the most, are those who treat CS as purely user/business oriented and say the mouse was the most important invention.

KG on June 9, 2008 11:43 AM

@higgs: "You can't write code (at least useful code) without jz or jnz" -- You should examine both OISC (for laughs) and "The Program Counter Security Model" (for an arguably important real-world application of straight-line code).

@Hoffmann: You should check out any RISC processor, and then benchmark your code with and without the needless pre-optimizations, and then shut up.

@Jeff Atwood: Didn't you mention the blog post "Design Patterns of 1972" last year? It's certainly required reading for anyone interested in today's post.
http://blog.plover.com/prog/design-patterns.html

(My "greatest inventions of CS" nominees: The compiler; the subroutine; the pointer; the hash table; type theory; Union-Find.)

Anonymous Cowherd on June 9, 2008 12:39 PM

The question of this article is a bit silly. There have been many important, paradigm-shifting inventions in the short history of CS and the subroutine is merely one of them.

As other commenters have pointed out, there are a number of inventions that you could put right next to the subroutine on a list of the X most important developments in computer science. I don't think any 1 thing would take the cake.

-Variable Scoping
-Compilers
-Interpreted Languages (Java and .Net)
-Data Structures (classes)
-Standardized GUI Elements (small-w windows)
-Subroutines
-The Mouse

... I'm sure that I'm missing half a dozen important ones, and I'm deliberately leaving off stuff like the microchip (why not the vacuum tube?)

Personally, my favorite invention is interpreted languages. To me, interpreted languages are like icing on the cake (which is the compiler).

Evan on June 9, 2008 1:02 PM

Esotericly, a routine goes back to before 1725. The Jacquard Loom used stringed together cards that repeated a pattern. But The wikipedi states it's partially based on a paper tape loom from 1725. The wikipedi does mention it was based on a music organ. So a wheel or paper roll of a music box is a repeating set of instructions, is it a routine?

There are also very old brass machines (some toys) that also can be said to be programmed (cams and wheels) to repeat a performance several times. So whats a routine?

AL Pareigis on June 9, 2008 1:20 PM

Maybe if I say "binary numeral system" over and over again people will agree with me.

How about "digital"? :O

From Wikipedia: "Owing to its straightforward implementation in digital electronic circuitry using logic gates, the binary system is used internally by all modern computers."

ALL MODERN COMPUTERS. Bam! None of this other stuff is used in ALL modern computers. You specialists, all with your specialist ideas.

(Don't take me too seriously, just enjoying the discussion here) :)

Jeff Davis on June 9, 2008 1:59 PM

You said: 'It is, after all, the single greatest invention in computer science.'

While the routine was a great milestone on the journey that exploits abstraction to improve software development, the next invention, which built on top of the routine, also brought about a revolution: the polymorphic message send, also known as 'dynamic dispatch', took the idea of calling a routine whose location (provider) is specified at compile-time, and extended it to allow programmers to invoke a routine with a signature that is specified at compile-time, but whose location (provider) is specified at run-time. Object Oriented programming allows an object to send a message to another object which is only known by the fact that it provides a method implementing that message. The resulting flexibility, 'one message, many methods', gave us a way of realising the A HREF="http://en.wikipedia.org/wiki/Open_Closed_Principle"Open-Closed principle/A.

Philip Schwarz on June 10, 2008 2:08 AM

I reckon the greatest invention in computer science is the GUI. This has enabled non computer gurus the world over to actually use the things, giving us programmers something to do.

GM on June 10, 2008 3:10 AM

@all:

Maybe we should divide the inventions in CS (as broadly spoken as possible) between pure CS abstractions (data structures, compilers, languages,...) and engineering solutions to CS problems or simply enablers (transistor, CMOS, networks (those would fit into abstractions too), mouse, GUI,...)

???

Daniel Drozdzewski on June 10, 2008 5:03 AM

It seems that the concept at least of routines existed in the earlier posted PacMan code - unless this is a recent rewrite.

;; Indirect Lookup table for 2c5e routine (0x48 entries)
36a5 1337 ; 0 HIGH SCORE

I also like the next line :)

Graphain on June 10, 2008 5:21 AM

don't call and ret count as a routine? isn't therefore the concept of a routine even older than programming languages themselves? what about doing it by hand? pushing an address, jumping then jumping back when done?

Personally i think the jump from assembler mnemonics to a language with grammar was the biggest development in programming... its a highly non-trivial conceptual leap, where as routines seem like a natural side-effect of a person writing code... I think most coders, not necessarily even a good programmer, would invent them as needed and probably there are multiple "inventors" of the routine.

In essence its just an elaborate parallel to things like headed paper or mail merged letters... people recycle everything that costs them something to make, whenever they can. Laziness is a big driving force for invention. :)

Jheriko on June 10, 2008 6:04 AM

"What do you think the single greatest invention in computer science is?"

Honestly I just don't care. There is no satisfying answer and thinking about [with dark, booming voice] THE SINGLE GREATEST INVENTION IN CS doesn't make me a better programmer. It isn't important. Every invention (OOP, subroutine and so on) has advantages and disadvantages. You must which one is best suited for your current problem while avoiding falling into the old trap "If you have a hammer, every problem looks like nail."

"How long should this routine be? How long is too long?"
If the routine is longer than a screen page, it's too long.

"How short is too short?"
Maybe if the routine name is longer than the code it contains?

"When is code "too simple" to be in a routine?"
Wrong question. Are you writing the same three stupid lines of codes over and over again? Put them into a routine and call it several times instead.

"What's a good name for this routine?"
Okay that's a hard one. My general rule of thumb: routines called more frequently get shorter names. Yes I'm lazy. But hey I can always refactor it later.

"How will I know if the code in this routine succeeded? Should it return a success or error code? How will exceptions, problems, and error conditions be handled?"
If it encounters a problem, let it throw an exception. If things go wrong - and they will - at least you know where the error occured first. It's dangerous if you application seems to run flawlessly but internally has faulty data.

Just some suggestions

zorkis on June 10, 2008 6:16 AM

@zorkis:

Ah finally someone who read beyond the first line of the article.

bull; "How long should this routine be? How long is too long?"
"If the routine is longer than a screen page, it's too long."

Hmm.. can't say I agree with that one. Too vague for a start. How big is a screen page exactly? Are we talking a 24x80 character xterm or 9-point text on a 2560x1600 pixel WQXGA screen?

The usual suggestion is between 50 and 100 lines. But an arbitrary limit seems too, well, arbitrary. Routines should exhibit strong cohesion. As long as the body of the routine is only concerned with a achieving a single goal then longer may be appropriate - though even then I would typically try break that down into logical 'steps' and create private routines for each step.

bull; "How short is too short?"

I don't think there is a simple answer for that one. It may be entirely valid to have a method that does nothing at all, especially when using interfaces and polymorphism.

bull; "If it encounters a problem, let it throw an exception."

I would say "If it encounters a [unexpected] problem [that cannot be handled internally], let it throw an exception."

I wouldn't be pleased if a FindInArray() routine threw an exception when it couldn't find the item, or if a Set.Add() threw when I tried an object that was already there. These are both expected 'problems' and their status should be conveyed without using exceptions.

Likewise if I call File.Delete() and file cannot be found then (arguably) that problem can be handled internally and the method can return success.

Graham Stewart on June 10, 2008 7:16 AM

I'm a little surprised that the arguments around the greatest invention reolve around languages, subroutines, compilers, and microprocessors. As a programmer I agree that many of the things mentioned here have made huge strides in computing, but I don't any of these things would be possible without the sharing of information via the internet (otherwise I would have never read this post).

Kevin Z on June 10, 2008 11:04 AM

@Suresh:
Neither Ajax nor Adobe AIR is a programming language, so it looks like you stopped at JavaScript. ;-)

Martin Cooper on June 11, 2008 2:18 AM

From the post: "Good programmers -- regardless of whatever language they happen to be working in -- understand the importance of crafting each routine with the utmost care."

What a blithe thing to say. Not all good programmers have the resources (= time) to craft each routine with the utmost care every time it needs to change. If you are working in a decent language (I use Python and JS, there are others) then not every routine has to be perfect the first time. Often they are, but I find that my routines often break the 2nd or third time I change them, but it usually doesn't take very long to fix them if you have exception tracebacks (Python has them by default, you can get them in JS with custom code). Just because Steve McConnell says it doesn't make it true.

David on June 11, 2008 5:13 AM

@David: "Not all good programmers have the resources (= time) to craft... it usually doesn't take very long to fix them if you have exception tracebacks"

There are plenty of studies that cover the relative expense of fixing bugs at different times in the development cycle and I think pretty much all of them agree that spending extra time getting the code right to start with is still cheaper than debugging later. So the argument that you don't have time doesn't really work.

Besides, if you rely purely on "exception tracebacks" to find your errors then what about the logic errors that don't cause exceptions? And how do you even ensure you have found all your possible exceptions? Just fixing the exceptions that appear when you run it sounds like a recipe for producing code that "usually works".

"(I use Python and JS, there are others)"

Aaaah.. well that explains it. He did say GOOD programmers :p

Graham Stewart on June 12, 2008 3:00 AM

I disagree with most of the article.

I wouldnt use routines until they are adopted by a significant number of programmers and know for sure they are a good coding practice.

Sebastian on June 12, 2008 3:19 AM

Er, last comment should've read
Sebastian on June 12, 1948 02:19 PM

mappy on June 12, 2008 7:24 AM

Isaac Z. Schlueter basically hit it.

The answer is the invention of formal proofs in geometry by Pythagoras. After "writing" my first FORTRAN program on punch cards I was struck by the similarity it had to the geometry proofs I did in 9th grade. Recall the way a proof in geometry unfolds in your mind and on paper or papyrus. The abstraction and use of formal language in a sequence of the clearest logic. How is it different in any way from what a coder produces ?

Do you recall that in the greek Olympics, Geometry-Proof-Skill was an event?

The question posed here is an historical question, in essence, and we are all the children of pythagoras, euclid, thales and aristotle.

You have to give Babbage an honorable mention though. The audacity to create a machine out of wood, metal, cloth and paper that could do complex calculations ? That was thought to be pretty much insane at the time.

cheers

chris fitzmartin on June 12, 2008 11:33 AM

Jeff, do you even have a bachelor's degree in computer science? HOW can you ask this question and then write an entire post on just programming languages?

Aaaargh.

Posco Grubb on June 12, 2008 1:58 PM

@Kevin Z: Most of the inventions mentioned here (with the exception of a few not particularly revolutionary languages) were indeed possible, and actually existed long before the Internet.

@AL Pareigis (and others): None of the descriptions here of the early card-programmed mechanical machines mention anything that worked like a routine (callable from various points in a main sequence, often with parameters) - the most advanced structure seems to be the loop.

DavidR on June 13, 2008 9:27 AM

The invention of the Turing Machine by far is the most important invention of Computer Science.

Phil L on June 13, 2008 9:31 AM

Well,

While I thought this when I first read it I am glad that I am not alone in the idea of the compiler being the most important "invention" in computer science. While they could not be made without the use of routines, what's more important as a field wide invention the nuts and bolts or the final project? Personally I say the final project.

I noticed some were saying that wired routines (like in chip sets), may be the most important, but I would put that in the "computer itself" category as it is hardware.

Just my opnion, but then again that is what blogs and comments on blogs are for right?

A little late on June 14, 2008 8:45 AM

These individuals must have been contributors to: "The Greatest Invention in Computer Science" both in hardware or software:

Computer Hall of Fame
http://www.computer-museum.org/hof/

It includes Grace Hopper. But I'm surprised it didn't include Donald Knuth - "The Art of Computer Programming", TeX.

http://en.wikipedia.org/wiki/Donald_Knuth


The AS400 (Silverlake project) and ReXX (Michael Cowlishaw) are pretty cool.

dj on June 15, 2008 5:04 AM

When I first read the question, I thought about OOP.

I thought about structured programming too, but what I like about the OOP concept is something that is a connection with CS with the real world. Routine is pure CS, but OOP took programming to other level, more connected with how things are in reality, under a human conception, obviously.

I kind of like when programmers demonstrate they can look away from their computers and make associations. Routine is just a way of doing the same things, but better. OOP involves a philosophy behind.

But... it's just a matter of my likes, of what one thinks it's more important. Definitely the routine paved the way for a sustainable work... but, hey, what about the variable?

xmariachi on June 16, 2008 5:14 AM

h6hi/h6

me on August 16, 2008 5:14 AM

I agree OOP is the next big leap after routines structured programming.

Exception handling is also a big leap (but not when used for validation errors! or as a method to pass back an alternative return type).
IBM had simple exceptions in PL/I a long time ago. It took ages for that to be superceded with the current model I first saw in Delphi.

'Intelligent' IDE's that OOP makes possible are a massive leap too.

OOP involves a philosophy behind.
Loose data coupling and data hiding were around long before OOP. All OOP allows is a new way of sharing code/data which makes practical an extra level of indirection/abstraction allowing more complex taskes to be programmed. sadly it can lead to a lot of unnecessary fiddliness coz it gets used so badly so often!


In the early 1980's I worked on a very old PL/I or COBOL program (I can't remember which language). At 1st it looked horrible with GOTO's everywhere. Then I realised it was using label variables to branch to code that would branch back to the line after the invoking line.
The programmer had implemented routines and was doing structured programming before the language had a call statement - or else he was a structured assembler programmer who didn't know about the call statement!

Biffa B on November 7, 2008 7:11 AM

I hold the (admittedly unconventional) view that object orientated programming is actually hurting the industry. Object orientated thinking causes you to overly obsesses over the object model and focus less on the computation you're trying to perform.

Does anybody out there agree with me or am I just a raving lunatic?
Nope - you are the prophet that seems like a lunatic to the herd!

I have long had misgivings about OO in business programming - the over-use of objects and 'design patterns' and abstractions that make life harder not easier.
Business programming has become technical and complex partly due to the horrendous coding required (or used for flashness) for browser interfaces and partly coz of OO. I read ages ago some guru saying if you look at the design mess of large COBOL applications you wonder what these guys will do with OO! My brother used to say of C++ 'you just can't use average programmers'. But business computing wants de-skilled programming - coz they are cheap and fast to train. it also wants 'shallow' logic - that can be understood by average programmers quickly.

I believe if dates and times were stored as char strings (in ISO format?) and manipulated with stateless static methods dates would be a doodle. A date is data not an object. But look at java calenders!
The object paradigm is rather irrelevant in most business processing. You can't have 1 customer object owning all customer data and operations.
I tried implementing an object model for financial transactions and it made it far more complicated.

The unit of code for much business processing is the transaction which operates on a data store. When all code for a transaction is together and uses subroutines it is easy to follow. When it is scattered thru an object hierarchy and across xml/object/data store layers it is harder to follow. People have object models where things look like they are peers when one is a slave/service to the other.
The static stateless method (subroutine) that changes parameters is the simplest logical structure hence the best to use. My systems would have maybe less than 50% of code inside objects.

So I am another lunatic.
PS OO is great for GUI widgets for sure! And for some frameworks if designed well - if the logic is kept 'shallow' and simple.


Biffa B on November 7, 2008 7:34 AM

Agree with Johan Pretorius! I think practically speaking it is GUI [remember it is also the precursor to Web GUI].

Without GUI there wouldn't have been the explosive growth in CS we see now. Most of us would have been probably jobless as well.

Try to imagine normal clerks trying to accomplish their tasks, say reservation by typing
RESERVE fakrudeen male ... 40 more parameters!
It is when we compare inventions on the same vein as routine, language, assembler etc.

If we say in pure computer science terms, it has to be turing's computability papers [some problems are never computable etc.] followed by lambda calculus [lisp/scheme - precursor to all other languages] followed by finite automata theory which gave rise to regex [state machine], grammars [CFG etc.] etc. [precursor to compilers]

routine doesn't even come close as a great invention in my thinking. Then what about high level languages? Microprocessors? OOP and all other acronyms?

Fakrudeen on May 21, 2009 6:12 AM

Right on, Warren! Copypasta is king.


Followed by spam, and CAPTCHA (the thing below what I'm typing!)

Justin 'PenaltyKillah' Lai on May 27, 2009 10:09 AM

This is possibly the dumbest question you could ask. Next you'll be asking what the greatest variety of fruit is, or what the greatest instrument in the orchestra is. You're attempting to judge on a linear scale what is inherently not linear. C'mon Jeff, do better.

Simon Wright on February 6, 2010 10:24 PM

It dawned on me a couple of months ago that the very essence of programming is the routine. It isn't classes, design patterns or other window dressing but the routine. I think the industry has to realise that the routine is the basis of programming, not the class.

I hold the (admittedly unconventional) view that object orientated programming is actually hurting the industry. Object orientated thinking causes you to overly obsesses over the object model and focus less on the computation you're trying to perform.

Take refactoring, for example. Refactoring is the art of solving meta-problems in your code whose solution is orthogonal to the actual problem you're solving. The aim of course is to improve maintainability but is the cost benefit really there, or do developers just like having pretty object models? Is a refactored code-base really *that* much easier to maintain? To be worth the money, it'd have to be 50% or more faster to develop against. I have a hard time believing this could be the case.

Moreover, it is exceedingly hard to design a good object model. Every application I've worked on has had deficiencies in its object model, that become apparently only in the very late stages of construction.

Even if you could design the perfect object model for your application it will quickly disintegrates, under the weight of maintenance, in to a collection of "bucket" classes with weak cohesion and tight coupling.

However, this does not make its contribution entirely worthless. Studies *do* show that object orientated programs are easier to understand than their procedural counterparts.

However, I get the feeling that a lot of the issues you run in to with object orientated thinking is a result of the failure of the failure to appreciate the power of the higher-order function.

With proper namespacing and aggressive use of higher-order functions, I think you can have more maintainable, more flexible programs without resorting to object orientated design.

When I've worked in that style on my private work, I've found that I focus on solving the problem and not trying to correctly factor the program.

Does anybody out there agree with me or am I just a raving lunatic?

Simon

Simon Johnson on February 6, 2010 10:24 PM

Flexible/"pluggable" regular expression parsing is the most important invention in computer science. Without it, there wouldn't be many of the things we take for granted.

Jason on February 6, 2010 10:24 PM

The Internet, obviously.

Weston on February 6, 2010 10:24 PM

My first thought was the local variable. Reducing the scope of a piece of information so simplifies maintenance that it makes everything else possible. This reduction in scope is what allows one to make a large system and actually be able to use it.

Without the local variable, the subroutine only adds reusability of code, which is only half of its purpose.

OOP is just extending scope control to code as well as data.

Grant Johnson on February 6, 2010 10:24 PM

The best invention IMHO is something that no-one takes the trouble to learn about; Prolog. Obscure it may be, trivialized, certainly, but hugely powerful depending on the task.

Invented in the late 1970's, it is not at all procedural, but rather rules based. The small example as given above would be written like:

------------------------------------------
print_centered(X) :- atomic(X),
sformat(String, '~w', [X]), string_length(String, Len),
Center is (80 - Len)/2, !, print_indented(Center, String).

print_indented(SLen, S) :- SLen = 0, !, write(S), nl.
print_indented(SLen, S) :- write(' '), !, print_indented(SLen - 1, S).
------------------------------------------

The nice thing is that you can use the above to print not just strings, but also integers or floating point numbers. Just three rules to print just about anything as centered. Something you want to print centered that it can't handle? Just add a rule to deal with it!

Reads like English too: (from top)
print_centered(X) if X is atomic and format X as a String and the length of the String is Len and the Center is (80 - Len) / 2 and succeed if and only if print_indented(Center, String) etc. etc.

Paul Sephton on February 6, 2010 10:24 PM


Windowed GUI Interface Mouse - My parents would never use a command line and neither would 98% of other users. That with the advent of the "personal" computer certainly made computers more mainstream.

Certainly the routine was an important advancement in programming.

Jon Raynor on February 6, 2010 10:24 PM

6502 handled the push and pop automatically in the CPU. It was that important, even in the '70's.

$02D8 LDA $41
$02DA JSR $FFD2 -- Someone will recognize what that really does.

$FFD2 NOP
$FFD3 RTS

Grant Johnson on February 6, 2010 10:24 PM

Congrats on being dugg!

http://digg.com/programming/The_Greatest_Invention_in_Computer_Science

Brandon on February 6, 2010 10:24 PM

«Back

The comments to this entry are closed.