Search This Blog

Tuesday, February 8, 2011

CS Education is fat and weak – 2

In my last post, we looked at the CS timeline as it is usually given. Now we start

Deconstructing the History of CS

with a view to figuring out why in a field so flush with cash, education is faring so badly.

My Gpa used to sometimes fight with me.  I remember one particularly vigorous argument: The TV news was blaring about some celebrity who had been fined and jailed for killing a wild-cat.
Gpa:  Tsk Tsk! In my time a man who killed a tiger was a hero. Today he's a criminal. Are tigers more valuable than humans?

I of course vigorously disagreed with him.

And now that he's gone I wonder…  Most of what we consider absolutely, inviolably true is true in one context and false in another: In my gpas time if a man did not kill a tiger, the tiger would kill the man and perhaps many others. Nowadays we never see a tiger and there is a very real possibility that they will completely disappear – a possibility gpa just could not envisage1.

Academic CS today is like my grandfather – clever, well-meaning and painfully out of sync with the times.

CS teachers are teaching mostly the wrong things, and when right, in the wrong order.
It is true that the optimal solution to this problem of packing stuff into bins – physical or conceptual – is hard. Yet if this problem is even somewhat corrected I believe that the CS curriculum could be collapsed to much less with the same content.

All that is needed is to awake from our…

Historical hangovers

30s Seminal Period
Turing invented the Turing machine in 1936.  By the 50s when algorithmic languages had become a reality he could restate his proofs in much more simple and succinct terms.  Yet in the 21st century we still teach Turing machines as a theoretical foundation! Of course there are exceptions like Neil Jones' Computability and Complexity that uses Lisp instead of Turing machines but they are so thin and far, that computing theory could as well still be in the 1930s! Likewise Hehner gives a proof of Gödel's theorem that is an order of magnitude shorter than Gödel's own proof.  Unfortunately such an approach is mostly unknown in CS, math or logic. Here's Harper:
Models of computation may be divided into two categories, the λ-calculus, and all the others… And yet  while λ-calculus is directly useful for programming and for mechanization of logical systems…it is the machine models that dominate
40s War
The code-breaking efforts of Bletchley Park – one of the important factors for the allies winning the war – produced one of the most enduring jargons of CS – the word 'code' to describe program texts.   The result which still continues more than  half a century after its necessity and wonder and truth have ceased, is the idea (mostly subconscious) that good program texts are those imbued with a maximum mystique of incomprehensibility. The heroes of war are rarely good citizens in peace.
50s Computer
Just as the war of the 40s left us the word 'code', the peacetime's legacy is the word that defines our field: computer. Is this name relevant or appropriate in 2011?  Many of the problems of computer science start from the word 'computer.'  Dijkstra is famous for the statement:
Computer science is as much about computers as astronomy is about telescopes. 
However changing the focus from compute-er to compute-ing only worsens the problem because something even more unimportant than the machine is overemphasized. An analogy will explain.  Physics is generally accepted to deal with matter and energy.  What kind of physics will result if one only concentrated on energy and ignored matter?  Computer scientists' overemphasizing algorithms at the cost of data is a similar error.  Naur – by recommending that CS be re-christened to datalogy – is an exception to the rule that algorithms and math are respectable whereas data-processing in the real world is not.
60s Mainframes
The age that set the value-system of academic CS.
  • Compiled languages are the only propah ones.
  • System programming/Software engineering are hep. 
  • Interpreted languages not kosher,  hacking in a REPL not something for the serious respectable computer scientist.
  • Lisp and Apl are of the freaks for the freaks by the freaks
It took 40 years for garbage collection to stop being garbage in isolated academic ivory towers and move to the mainstream – Java. Can one imagine the mind-boggling cost of all those years of dangling pointer errors?  And 30 years for polymorphic types in ML to become generics in C++.  Can we even work out the cost of the useless drudgery of programmers writing the same code over and over again using main-stream first order languages like C?
Exception: My teacher hvs was one of the freaks2 who replaced Pascal by Scheme in CS101 in 1988. I carried on his legacy in the early 90s using gofer, a predecessor of Haskell.  Unfortunately as of 2012 we see that C, C++, Java remain the norm for teaching programming. Brings me to the next…
70s Computer Science
If the 50s gave us the Computer, the 70s respectabled it into Computer Science.  Hopcroft's Turing award, speaking about the motifs of this time, is largely about how it would be a good thing for our discipline to be treated as computer science. And what did this 'science' consist of?
  1. Programming Languages
    Isn't it ironical that even though the inventor of the first high level language – Backus – owns up to having made a mistake4 in allowing the von Neumann bottleneck to leak into hi-level languages, almost all modern mainstream languages remain completely or mostly imperative. In effect we continue to use and teach with C, Pascal and Simula, only changing the gift-wrapping to assuage our guilt for not doing due diligence. As Knuth's Art of Programming started becoming staple in CS departments, some important invariants got established: CS became more and more the study of complicated…
  2. Algorithms
    and their analysis using arcane mathematics rather than a deep understanding of simple algorithms (eg straight search).  Knuth did say:
    We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil
    Evidently the bible has more authority than its author – CS departments still behave as though program efficiency is paramount, programmer efficiency less so and usability, portability, documentation… hardly at all. Leonardo's laptop is an exception to this stupidity. The earlier age was one which gave us the synonym for 'program' – 'code' (and we forget the original meaning of code (= cipher) : something deliberately inscrutable – un-de-cipher-able). When it was realized that machines could do coding and decoding much more effortlessly than humans, assembly and machine coding got replaced by hlls with increasingly long toolchains. So being an expert in C means not just knowing C and the compiler but also: librarians, archivers, make, automake, object-file readers, autoconf and other such wonders of gothic art. Which brings us bang into the culture of…
  3. Unix
    We can find much literature from the unix-fanboy club and less from the unix-haters club. In fashionable CS education, its hip to deride windows and drool over unix.  Those who do this most usually know least (about both). This is a subject that would require more than one blog-post to itself alone, so for now I'll only make a couple of comments:
    1. Most fresh CS graduates think its fine to use printf/scanf on stdin, stdout for their programs/projects rather than guis3.  Maybe they should stick to Hollerith cards instead?
    2. The PDP-7 on which Unix took birth is dead but the skeleton on which it was built – C – is not. Now pragmatically, C as a foundation on which more modern languages – Python, Haskell, Erlang, etc – are built is fine.  But when serious CSists think (and teach) that programming in C is kosher and programming in VB is not, it continues to create generations of kids with pickled brains. Years back, I wrote a paper on the dangers of using C to teach programming.  If C is a dated language for you then that paper is dated.  If however one thinks that C is fine for serious general purpose CS education, then it deserves a read.

In short this was the age where a premature commitment to science without any towering scientists to idealize as in more mature fields, created a proliferation of computer scientists. They exhibited the hubris of traditional scientists without the clarity of real science, whence we have the sad stereotype: no creativity, no rigor, no art, no fun – the nerd.


Naturally it was only a question of time for the pendulum to swing…
80s Democratization, DOS
If Unix-culture gave the nerd who can type out long command-lines but not hold a conversation, DOS provided the proverbial Dummy/Idiot – uses a computer but has no clue.

The real idiots of course are the academics who accentuate/perpetuate the divide. I particularly remember a day when the university's finance department issued a note saying that computers had been 'moved' from the fixed asset to the consumable category.  How many CS academics really understand what this implies? Brings me to the issues of…

System administration: In the mainframe era the white-clad gentlemen and ladies who managed the computer gave something of the air of a space-station or at least a hospital. After computer morphed from mainframe to PC everyone is now obliged to manage their own computer. How many CS departments today teach students how to set up their own computers or home networks?
90s IT and the Internet
Data-processing began to go out of fashion in the 70s and CS was too academic.  The 90s provided two wonders of hype to answer – IT and the Internet.

It was of course fashionable to blare the hype about the internet in the 90s (as the cloud is fashionable today) but as teachers do we teach the interconnectedness as an addon or as fundamental fact? Live huge public repos of information in general (wikipedia) and source-code in particular (sourceforge and descendents) make development a new game altogether. Programming language research in the last century focused on language arcana; Now suddenly it feels irrelevant and 'Oh So 70s!' So if theoretical cerebration on programming languages was increasingly irrelevant, what actually changed in the landscape? Some memories of how that change crept over us unnoticed:
  1. I remember someone telling me there's this thing (dont remember whether we called it a 'language') called perl which ran on DOS and on Unix… I was incredulous: To me DOS-Unix was Never the twain shall meet and the only program that could span the two worlds was the asymptotic null program:
    main() {}
  2. Somewhere in the late 90s an ex-student came back to the univ and told me about a language called 'python', suggesting I look at it for teaching programming. Again I was skeptical – the typical stupidity of the academic.
So while academics dreamed of ever more 'powerful' languages – Pascal → Modula-2 → Modula-3 – real-world-programming was simplifying its life with Tcl → Perl → Python.  In short, academics have largely missed the scripting language revolution.

One of the most invisible (to academics) but far-reaching (to the rest of the world) change came from a medium-sized, not very respectable company in Seattle.  If you were an academic, you'd say things like:
  • Guis? Came out of Xerox and pushed further by Apple.
  • Rock Solid System? Nothing to beat Unix
  • Windows? Ha! A poorly engineered half-baked copy of Mac and Unix that runs terribly slowly when it does and keeps crashing
And while the academics mocked, the world moved on. If Windows was a second-rate clone of Mac then, today KDE and Gnome are third-rate clones of Windows. The cardinal error that academics made then and continue to do now is to say: Windows or Unix while the world is increasingly going: Windows and Linux.

As for IT, here's Thomas Haigh:
As it spread … IT increasingly lost its association with communications (and, alas, any vestigial connection to the idea of anybody actually being informed of anything) to become a new and more pretentious way of saying "computer". The final step in this process is the recent surge in references to "information and communication technologies" or ICTs, a coinage that makes sense only if one assumes that a technology can inform without communicating
The buzzword convergence which Thomas Haigh is poking fun at above, is usually applied to the convergence of communication media like mobile and Internet. And yet it has a far wider reach.  Which brings us to…
2000 Convergence
  • Languages are converging
      - Vertical: Python C (dozens of options)[5]
      - Horizontal: JS coffescript
      - Multi-paradigm: Ruby-Erlang polyglotism
      - Competitors:  python-haskell
  • OSes are converging
     Today:
       All desktops are windows or clones
       All networks are TCP/IP (= Unix)
       'GUI' means (rip-off) of mac
  • Data and code
     Converged with von Neumann, again with lisp and s-sepressions, again with resurgence of lisps like clojure etc
  • Web and desktop
      pyjamas
  • Sequential and parallel/concurrent computation
     Mainstreaming of concurrency/parallelism eg erlang, go, haskell [The confusion between concurrent and parallel remains and is increasing[6]]
It is true that convergence is a buzzword. Yet when we choose to teach with C (C++ is the same in this regard),we are ignoring Bell's law and teaching for an obsolescent and increasingly narrow medium – the desktop computer.  With Java on the other hand I could program the desktop or an android phone or…
2010 Cloud Computing
…or google-app engine. As a language I dont care for Java but I also need to admit that this concern for programming language clearly dates me as someone educated in the '80s. Brings me to…
Now
Here's  Weinreb on why Scheme was replaced by Python at MIT:
In 1980, computer engineering was based on starting with clearly-defined things… Nowadays, a real engineer is given a big software library, with a 300-page manual that’s full of errors…
In effect, what matters is not whether Python or Scheme are 'better' languages, but which has the more powerful 'batteries included'. One of the fundamental differences between the last century view of programming languages and the view that is relevant today is that then we talked of languages; now we talk about ecosystems.
It is my belief that if some of these points are taken into account (I would be surprised if all turn out accurate!!) a CS curriculum can be redesigned that is current, relevant and engaging – not something that can be said for most CS curricula today.  And above all it would fit in one-third the space and time devoted to the so-called current but actually antiquated crufty messes. Key to this revamping of the CS curriculum is to morph Churchill:
Plans are of little importance, but planning is essential
into
Languages are obsolete, languaging is essential

Now to go from our current disorder to a better order would be great!. But how? My next post deals with that.  Towards that, it will be helpful to stand aside from CS and watch two renderings of a well-known piece of music:

Footnotes
[1] There is more personal history to this: My gpa's gpa was in the depths of Africa (around the time of Livingstone?). When he was still a noob to the wilds and went outside to 'answer a call of nature' in the night, he was visited by a lion.  His trusted lieutenant shot the lion before the lion got him.  However he remained dangerously sick from the encounter for weeks after only from the fear
[2] Even today, with Haskell getting close to mainstream status, it requires some courage to use FP to teach programming, what it required in 1988 is left to the imagination
[3] Blushful admission: I am one of those
[4] In fact more than just this blog's title comes from John Backus.  Much of the stupidity in CS education can be connected to the tardiness in the adoption of functional programming.
[5] 1. 'Classic' extending/embedding 2. SCXX 3. PyCXX 4. Boost 5. Cython 6. Swig 7. Sip 8. ctypes
[6] Pike, Harper Simon Marlow discussion
[7] Yeah without some nice cartoons here I am sounding nerdy myself… Any suggestions anyone?

6 comments:

  1. A combined the responses to both the posts.

    I like the historical, logical and pedagogical views of cerebral activities. I agree with the CS pedagogy being tied to history in the current era. I'd wait for post #3 where you propose a possible logical structure, and maybe another post where we see a possible pedagogical structure. That said, here are my two bit ideas on the logical and historical side.

    Technology and Engineering go historically, since they directly deal with practice. Market forces being operative over short time scales exert pressure on technology to not bother distinguishing between curing symptoms or curing cause, as long as cure takes place! On the other hand, such distinctions help to reduce costs over long term - costs of various kinds like cost of thinking, cost of acting on the thought to introduce change, and the market costs in trade. You don't produce electricity by rubbing cat fur ;-). Or you don't compute using only the Abacus. Instead you combine principles from Electrodynamics (and solid state physics) and Computer science to create CPUs :-).

    The breadth and depth of the logical structure - the science - lends this economy. The critical mass of ideas that organise a technology and thus yield a science appear (at this point to me) as very subjective judgement. To me it appears that there is a sufficient body of ideas in CS to distinguish between the principles and practice. I prefer to place models of computation as a response to the central question (Hilbert!) - what 'thought' is 'mechanisable'? This as a 'deep question' places CS in its proper role in the scheme of the sciences. Natural sciences observe a 'machine' and 'induce' the formal structure, that is checked and verified by deductions that lead to falsifiability tests. CS as a formal science, asks what 'machines' can be conceived. It is then a natural bridge between the natural and formal sciences! The (ideally) deductive processes of program expression and program execution (ought to) become part of the science structure of CS.

    The problem of pedagogy is to devise routes of instruction that convert a 'huge' body of information from technological efforts into the contemporary logical edifice built by the science focused research (as opposed to the 'arcane' technology focused research). I often use the technique of abstracting out the principles from the mass of information, and then subsequently making it diffuse enough to reach current levels of ignorance (i.e. opportunities for research). For instance, I use complexity theory to give a rigorous - as opposed to an intuitive - base to algorithm analysis, and then introduce complexity classes. From here I gradually move to P=NP? problem. The level of detail changes depending on the target student base - usually 'informational' for undergrads, some 'repercussions' for grads, and (although I am not good enough for it), with discussions about some formal attempts towards that problem. There are a number of different styles (e.g. Q/A style), but I do not see that as a problem. The absence of alternate styles, i.e. rigid delivery of instruction, is a far more insidious and dangerous problem.

    Ahem!!! ... My two bits has turned out to be a mouthful. Sorry, but it is a combined response. Hope you don't mind.

    Regards.
    AMV

    ReplyDelete
    Replies
    1. Wooo! Now thats a bumper comment!

      The point 'bridge between natural and formal science' is the exciting part and reminds me of the intro to SICP wherein they talk of:
      "procedural epistemology – studying the structure of knowledge imperatively"
      (or something to that effect).

      And probably calls for a separate blog post!

      Delete
  2. Many authors think it's fine to write books with only words and no pictures or illustrations. Maybe they should stick to a Gutenberg press?

    ReplyDelete
  3. Not sure whats your point…
    Pictures can be useful and 'can be worth a thousand words?' Of course!

    My blog has not enough pictures? Yes that is so…
    Still have you seen our summary of FP?
    http://blog.languager.org/2011/10/lambda-mindmap-1.html

    And if you dont mind an equivalencing of art and poetry:
    http://blog.languager.org/2011/10/vagaries-of-intelligence.html

    ReplyDelete
  4. I second AMV's suggestion. What would the proposed logical and pedagogical structures of CS be? I'm just beginning my education in CS. In the meantime, I'll be at Code Academy learning html and css.

    And thank you for the insightful lessons.

    ReplyDelete
    Replies
    1. You are welcome Meecho :-)

      There's some more stuff up at my other site http://www.the-magus.in/ and of course things being worked at for going here or there.

      If you tell me what kind of stuff (you think) you need/want, I'll see if I can prioritize accordingly

      Delete