Thursday 4 April 2019

Some additional* forgotten history of OOP

* still partial

Eric Elliott has written a nice history of dynamically typed OOP, but I found it missing some developments the way JavaScript misses them. That's why I felt like adding this contribution. To convey two phenomena by individual words, I'll call them Eiffel and Python.

To those that don't know it, Eiffel is a programming language initially developed in the 1980s by Bertrand Meyer. At a recent event in Sofia, Bulgaria knowing how strong he feels about it, I asked Bertrand: given that he's known to truly believe in Eiffel, what does he think is the second best (whatever he puts in such a notion) programming language. The rather amusing answer: "Maybe Eiffel 5 years ago".

But what are the reasons Meyer is so confident about his ideas. Here's his shortlist, which admittedly sounds very convincing:

  1. Strong typing
  2. Void safety
  3. Design by contract

Why is his first argument diametrically opposite to Kay's love for late-binding? As someone who was involved in the development of Sophie (probably the most complex application ever written in Alan Kay's Squeak Smalltalk), I have my own answer. And it is that large complex systems require all the support developers could get to ensure system validity and early identification of potential problems. Rephrasing Meyer, as a developer you may choose to have it easy, but at some point you have to face the difficulty arising from complexity and for usable software ultimately it is better that this happens to the developer rather than the user. In fact, this is why TypeScript came about and gained so much traction. Notice that since v2.0 it also supports void safety.

And then there's Python that in 1991 came about to promote code readability and with this, ease of maintenance. To be fair, one needs to acknowledge that obviously Smalltalk also put lots of emphasis on code readability. Yet Smalltalk still uses square brackets for its block, whereas text formatting via whitespaces often does this job in Python. As a consequence today Python is by far the most popular non-bracket-based language, and people have commonly preferred indentation to brackets not only since LISP. But that's not all. Python is continuing to push the boundaries of better code readability with docstrings, and more specifically doctest and docopts. And just on the side, since version 3.6 Python introduces optional static typing (also known as gradual typing).

All this comes to say nothing else than the banal reality that history did not end in the 1970s and is not going to do so.

No comments:

Post a Comment