Category: Object-oriented Software

  • Summary: Software Programming Languages

    This is a summary with links to all my posts on software programming languages.

    Computers need to be “told” what to do. Each computer has a native language it understands, a “machine language.” Each machine language has a human-readable version called “assembler language.” Starting in the 1950’s “high level” languages for telling the computer what to do (programming it) have been developed.

    111

    Here are the basics of that amazing progression.

    https://blackliszt.com/2020/09/the-giant-advances-in-software-programming-languages.html

    Software programming language core concepts

    How do you learn a programming language so you can be a programmer? No one wants to tell you that the best way to learn is on your own!

    https://blackliszt.com/2025/01/how-to-learn-to-be-a-computer-programmer.html

    One of the core features of all programming languages is the subroutine. Everyone who programs uses subroutines, but their power can be underappreciated.

    https://blackliszt.com/2021/03/fundamental-concepts-of-computing-subroutine-calls.html

    Among the earliest features added to languages were structures, blocks and macros. Each of these contributed to more concise and understandable programs.

    https://blackliszt.com/2021/09/software-programming-language-evolution-structures-blocks-and-macros.html

    Once you get past the basics of language, you find that widely used languages have rich collections of subroutine libraries and sometimes what are called frameworks, which contribute a large fraction of any program’s solution.

    https://blackliszt.com/2021/10/software-programming-language-evolution-libraries-and-frameworks.html

    The way programs flow is a key aspect.

    https://blackliszt.com/2022/06/flowcharts-and-workflow-in-software.html

    Programs consist of a combination of instructions and definitions of the data on which the instructions operate.  Exactly how those relate to each other has been the subject of major disputes – which continue to this day.

    https://blackliszt.com/2015/06/innovations-that-arent-data-definitions-inside-or-outside-the-program.html

    Some programming "advances" basically try to restrict the possible relationships betwen code and data. Bad idea.

    https://blackliszt.com/2021/08/the-relationship-between-data-and-instructions-in-software.html

    Software programming language evolution

    When talking about software languages, the term high level language was introduced early. Here’s what it means.

    https://blackliszt.com/2020/10/what-is-high-about-a-high-level-language-in-software.html

    Decades ago a couple of languages were invented and enjoyed an explosion of use that were major steps ahead of the standard languages of the time in terms of productivity.

    https://blackliszt.com/2020/11/software-programming-language-evolution-beyond-3gls.html

    Not long after these amazing, productivity-enhancing languages had their rapid growth, the modern DBMS came onto the scene, with its own language for data definition, query and update. The impact of the DBMS revolution was huge.

    https://blackliszt.com/2021/01/software-programming-language-evolution-impact-of-the-dbms-revolution.html

    One of the major reactions to the DBMS revolution was the introduction and rise to prominence of what were called 4-GL’s, all which of incorporated the DBMS as an integral part.

    https://blackliszt.com/2021/02/software-programming-language-evolution-4gls-and-more.html

    There has been an explosion of programming language invention.

    https://blackliszt.com/2014/04/continents-and-islands-in-the-world-of-computers.html

    It just goes on and on and on and on, with no end in sight.

    https://blackliszt.com/2022/04/software-programming-language-cancer-must-be-stopped.html

    Software programming language innovations

    Experts tout the major advances in programming languages made since the early days, but they don’t amount to much.

    https://blackliszt.com/2020/09/software-programming-languages-50-years-of-progress.html

    A comparison to the virtues of various human languages makes this clear.

    https://blackliszt.com/2020/12/the-bronte-sisters-and-software.html

    Attempts have been made by experts to fix problems that have been widely noted for many decades.

    https://blackliszt.com/2021/09/software-programming-language-evolution-the-structured-programming-goto-witch-hunt.html

    One of the serious detours into unproductive swamps taken by programming languages has been what’s called object-orientation. It had a promising start and would have been fine had it stopped there.

    https://blackliszt.com/2021/11/the-promising-origins-of-object-oriented-programming.html

    Lots of people have things to say about O-O languages. There are the academics and other authorities and then there are the people with real experience who aren’t groupies.

    https://blackliszt.com/2022/01/object-oriented-software-languages-the-experts-speak.html

    Here are some facts and logic to explain why O-O should be referred to exclusively in the past tense.

    https://blackliszt.com/2022/03/why-object-orientation-in-software-is-bad.html

    O-O is so bad that people who actually know stuff take pleasure from mocking it:

    https://blackliszt.com/2022/05/making-fun-of-object-orientation-in-software-languages.html

    Another category of hyped but harmful programming languages have been “functional” ones. These arose early in programming evolution and keep popping up.

    https://blackliszt.com/2021/05/software-programming-language-evolution-functional-languages.html

    The attraction of functional language has a strong basis. It’s true that increasing the declarative aspect of a total solution brings strong benefits. But embedding it in the language neuters it.

    https://blackliszt.com/2021/07/software-programming-languages-the-declarative-core-of-functional-languages.html

    Here are some detailed examples of how supposed advances in programming languages have worked out in practice, including failures of Java and 4-GL’s and a huge success with a brand-new system written in that ancient bit of history called COBOL.

    https://blackliszt.com/2021/01/software-programming-language-evolution-credit-card-software-examples-1.html

    https://blackliszt.com/2021/02/software-programming-language-evolution-credit-card-software-examples-2.html

    https://blackliszt.com/2022/08/software-programming-language-evolution-credit-card-software-examples-3.html

    After all those failed advances, there's the amazing case of HTML, a wildly successful language without all the bells and whistles that takes the winning principle of "just get the job done."

    https://blackliszt.com/2010/05/html-assembler-language-easy-to-use-tools.html

    Software programming language evaluation

    Promoters of new languages tout how they prevent programmers from making errors (ha!) and result in cleaner programs that somehow promote productivity – which is never measured or tested.

    The fact is, there is a standard by which programming languages should be judged – along with the support systems and metadata that are an integral part of the solution. It’s simple: how many places do you have to go to make a change? The right answer is one. Here’s the idea.

    https://blackliszt.com/2014/03/how-to-evaluate-programming-languages.html

     

  • Making Fun of Object-Orientation in Software Languages

    When a thing is held in exaltation by much of the world and its major institutions, when that thing is sure that it's the best thing ever, and when people who support the thing are convinced that they're superior to the rest of us, who are nothing but unsophisticated hackers, then you've got something that's fun to make fun of. A target-rich environment.

    There are lots of things to make fun of in software. There are project managers who solemnly pronounce that, due to their expertise, the project is on track and will be delivered on time and to spec. There are the software architects who haven't met a real user or written a line of production code in years, who proudly announce their design of a project to migrate to a graph database or micro-services. There are other juicy targets. But none comes close to the exalted ridiculousness of object-oriented languages (the purer the better) and those who shill for them.

    Are you a member of the O-O cult, offended by this talk of making fun of supposed imperfections of the one true approach to programming languages? My sincere sympathies to you. Check this out. It's heavy-duty cult de-programming material. It probably won't work for you, but give it a try.

    Back to the fun. Here's a start from an excellent essay by someone who tried for years to make OOP work.

    OOP

    Here are some wonderful highlights from a collection made by a person who supports OOP but thinks most programmers don't know how to program it well.

    Edsger W. Dijkstra (1989)
    “TUG LINES,” Issue 32, August 1989
    “Object oriented programs are offered as alternatives to correct ones” and “Object-oriented programming is an exceptionally bad idea which could only have originated in California.”

    Paul Graham (2003)
    The Hundred-Year Language
    “Object-oriented programming offers a sustainable way to write spaghetti code.”

    Here are highlights from a wonderfully rich collection.

    object-oriented design is the roman numerals of computing.” – Rob Pike

    The phrase "object-oriented” means a lot of things. Half are obvious, and the other half are mistakes.“ – Paul Graham

    The problem with object-oriented languages is they’ve got all this implicit environment that they carry around with them. You wanted a banana but what you got was a gorilla holding the banana and the entire jungle.” – Joe Armstrong

    I used to be enamored of object-oriented programming. I’m now finding myself leaning toward believing that it is a plot designed to destroy joy.” – Eric Allman

    OO is the “structured programming” snake oil of the 90's. Useful at times, but hardly the “end all” programing paradigm some like to make out of it.

    From another section of the same wonderfully rich collection.

    Being really good at C++ is like being really good at using rocks to sharpen sticks. – Thant Tessman

    Arguing that Java is better than C++ is like arguing that grasshoppers taste better than tree bark. – Thant Tessman

    There are only two things wrong with C++: The initial concept and the implementation. – Bertrand Meyer

    More from a good extended essay on OOP:

    “C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg.”

    It was Bjarne Stroustrup who said that, so that’s ok, I guess.

    “Actually I made up the term ‘object-oriented’, and I can tell you I did not have C++ in mind.” — Alan Kay

    “There are only two things wrong with C++: The initial concept and the implementation.” — Bertrand Meyer

    “Within C++, there is a much smaller and cleaner language struggling to get out.” — Bjarne Stroustrup

    “C++ is history repeated as tragedy. Java is history repeated as farce.” — Scott McKay

    “Java, the best argument for Smalltalk since C++.” — Frank Winkler

    “If Java had true garbage collection, most programs would delete themselves upon execution.” — Robert Sewell

    Object-oriented design and programming remains a useful way to think about parts of some software problems, as I've described here. As a universal approach to software, it's beyond bad. Beyond ludicrous. It is such a joke that the only thing to do is visit it briefly, make jokes, and then move on, with a tinge of regret about the science-less-ness of Computer Science.

     

  • Why Object-Orientation in Software is Bad

    What?? Object-oriented programming (OOP) is practically the standard in software! It’s taught everywhere and dominates thinking on the subject. Most languages are O-O these days, and OO features have even been added to COBOL! How can such a dominant, mainstream thing be bad?

    The sad truth is that the badness of OOP isn’t some fringe conspiracy theory. An amazing line-up of astute, brilliant people agree that it’s bad. A huge collection of tools and techniques have been developed and taught to help people overcome its difficulties, which nonetheless persist. Its claims of virtue are laughable – anyone with experience knows the benefits simply aren’t there.

    Object-oriented languages and novels

    Object-orientation is one of those abstruse concepts that makes no sense to outsiders and is a challenge for people learning to program to understand and apply. To make OOP monstrosity clear, let’s apply OOP thinking to writing a novel.

    There are lots of ways of writing novels, each of them suitable for different purposes. There are novels dominated by the omniscient voice of the author. There are others that are highly action-based. Others have loads of dialog. Of course most novels mix these methods as appropriate.

    Some novels feature short chapters, each of which describes events from a particular character’s point of view. There aren’t many novels like this, but when you want to strongly convey the contrast between the contrasting experiencing of the characters, it’s a reasonable technique to use, at least for a few chapters.

    What if this were the ONLY way you were allowed to write a novel??!! What if a wide variety of work-arounds were developed to enable a writer to write  – exclusively! — with this sometimes-effective but horribly constricting set of rules?

    What if … the Word Processors (like Microsoft Word) from major vendors were modified so that they literally wouldn't allow you to write in any other way, instead of giving you the freedom to construct your chapters any way you wanted, with single-person-point-of-view as one of many options. What if each single small deviation from that discipline that you tried to include were literally not allowed by the Word Processor itself!? All this because the powerful authorities of novel creation had decided that single-person chapters were the only good way to write novels, and that novelists couldn't be trusted with tools that would allow them to "make mistakes," i.e., deviate from the standard.

    There would be a revolution. Alternative publishing houses would spring up to publish the great novels that didn’t conform to the object-novel constraints. The unconstrained books would sell like crazy, the OO-only publishing houses would try to get legislation passed outlawing the unconstrained style of writing, and after some hub-bub, things would go back to normal. Authors would exercise their creative powers to express stories in the most effective ways, using one or several techniques as made sense. The language itself would not be limited or limiting in any way.

    Sadly, the world of software works in a very different way. No one sees the byzantine mess under the “hood” of the software you use. No one knows that it could have been built in a tiny fraction of the time and money that was spent. Industry insiders just accept the systematized dysfunction as the way things are.

    This is objects – a special programming technique with narrow sensible application that has been exalted as the only way to do good programming, and whose rules are enforced by specialized  languages only capable of working in that constrained way.

    Is there nothing good about OOP?

    It isn’t that OOP is useless. The concept makes sense for certain software problems – just as completely other, non-OOP concepts make sense for other software problems! A good programmer has broad knowledge and flexible concepts about data, instructions and how they can be arranged. You fit the solution to the problem and evolve as your understanding of the problem grows, rather than starting with a one-size-fits-all template and jamming it on. You would almost never have good reason to write a whole program in OO mode. Only the parts of it for which the paradigm made sense.

    For example, it makes sense to store all the login and security information about a body of software in a single place and to have a dedicated set of procedures that are the only ones to access and make changes. This is pure object-orientation – only the object’s methods access the data. But writing the whole program in this way? You're doing nothing but conforming to an ideology that makes work and helps nothing.

    However. When you embody OOP in a language as the exclusive way of relating data and code, you’re screwed.

    In this post I describe the sensible origins of object-orientation for describing physical simulation, for example for ships in a harbor. Having a whole language to do it was overkill – I describe in the post how hard-coding the simulation in statements in a language made it hard to extend and modify instead of moving the model description into easily editable metadata — and then into a provably best optimization model..

    That is the core problem with object-oriented languages – they are a hard-coded solution to part of a programming problem, rather than one which creates the most efficient and effective relationships between instructions and data and then increasingly moves up the mountain of abstraction, each step making the metadata model more powerful and easier to change. Object-oriented concepts are highly valuable in most metadata models, with things like inheritance (even multiple inheritance, children able to override an inherited value, etc.) playing a valuable role. Keeping all the knowledge you have about a thing in one place and using inheritance to eliminate all redundancy from the expression of that knowledge is incredibly valuable, and has none of the makes-things-harder side effects you suffer when the object-orientation is hard-coded in a language. In the case of simulation, for example, the ultimate solution is optimization – getting to optimization from object-oriented simulation is a loooong path, and the OOP hard-coding will most likely prevent you from even making progress, much less getting there.

    Conclusion

    Any reasonable programmer should be familiar with the concepts of encapsulation, inheritance and the other features of object-oriented languages. Any reasonable programmer can use those concepts and implement them to the extent that it makes sense, using any powerful procedural language, whether in the program itself or (usually better) the associated metadata. But to enforce that all programs be written exclusively according to those concepts by embedding the concepts in the programming language itself is insanity. It's as bad as requiring that people wear ice skates, all the time and every day, because ice skates help you move well on ice when you know how to use them. If everything were ice, maybe. But when you try to run a marathon or even climb a hill with ice skates on, maybe you can do it, but everyone knows that trading the skates for running shoes or hiking boots would be better. Except in the esoteric world of software, where Experts with blinders on declare that ice skates are the universal best solution.

  • Object-Oriented Software Languages: The Experts Speak

    On the subject of Object-Oriented Programming (OOP), there are capital-E Experts, most of academia and the mainstream institutions, and there are small-e experts, which include people with amazing credentials and accomplishments. They give remarkably contrasting views on the subject of OOP. Follow the links for an overview, analysis and humor on the subject.

    The Exalted Experts on OOP

    Here is the start of the description of Brown's intro course to Computer Science, making it clear that "object-oriented design and programming" is the foundational programming method, and Java the best representation language:

    Brown intro

    Here's their description of OOP, making it clear that there are other ways to program, specifically the nearly-useless functional style, never used in serious production systems.

    Brown OOP

    See below to see what Dr. Alan Kay has to say about Java.

    Here is what the major recruiting agency Robert Half has to say on the subject:

    Object-oriented programming is such a fundamental part of software development that it’s hard to remember a time when people used any other approach. However, when objected-oriented programming, or OOP, first appeared in the 1980s, it was a radical leap forward from the traditional top-down method.

    These days, most major software development is performed using OOP. Thanks to the widespread use of languages like Java and C++, you can’t develop software for mobile unless you understand the object-oriented approach. The same goes for web development, given the popularity of OOP languages like Python, PHP and Ruby.

    It's clear: OOP IS modern programming. Except maybe some people who like functional languages.

    The mere experts on OOP

    We get some wonderful little-e expert witness from here.

    Implementation inheritance causes the same intertwining and brittleness that have been observed when goto statements are overused. As a result, OO systems often suffer from complexity and lack of reuse.” – John Ousterhout Scripting, IEEE Computer, March 1998

    Sometimes, the elegant implementation is just a function. Not a method. Not a class. Not a framework. Just a function.” – John Carmack

    OO is the “structured programming” snake oil of the 90' Useful at times, but hardly the “end all” programing paradigm some like to make out of it.

    And, at least in it’s most popular forms, it’s can be extremely harmful and dramatically increase complexity.

    Inheritance is more trouble than it’s worth. Under the doubtful disguise of the holy “code reuse” an insane amount of gratuitous complexity is added to our environment, which makes necessary industrial quantities of syntactical sugar to make the ensuing mess minimally manageable.

    More little-e expert commentary from here.

    Alan Kay (1997)
    The Computer Revolution hasn’t happened yet
    “I invented the term object-oriented, and I can tell you I did not have C++ in mind.” and “Java and C++ make you think that the new ideas are like the old ones. Java is the most distressing thing to happen to computing since MS-DOS.” (proof)

    Paul Graham (2003)
    The Hundred-Year Language
    “Object-oriented programming offers a sustainable way to write spaghetti code.”

    Richard Mansfield (2005)
    Has OOP Failed?
    “With OOP-inflected programming languages, computer software becomes more verbose, less readable, less descriptive, and harder to modify and maintain.”

    Eric Raymond (2005)
    The Art of UNIX Programming
    “The OO design concept initially proved valuable in the design of graphics systems, graphical user interfaces, and certain kinds of simulation. To the surprise and gradual disillusionment of many, it has proven difficult to demonstrate significant benefits of OO outside those areas.”

    Jeff Atwood (2007)
    Your Code: OOP or POO?
    “OO seems to bring at least as many problems to the table as it solves.”

    Linus Torvalds (2007)
    this email
    “C++ is a horrible language. … C++ leads to really, really bad design choices. … In other words, the only way to do good, efficient, and system-level and portable C++ ends up to limit yourself to all the things that are basically available in C. And limiting your project to C means that people don’t screw that up, and also means that you get a lot of programmers that do actually understand low-level issues and don’t screw things up with any idiotic “object model” crap.”

    Oscar Nierstrasz (2010)
    Ten Things I Hate About Object-Oriented Programming
    “OOP is about taming complexity through modeling, but we have not mastered this yet, possibly because we have difficulty distinguishing real and accidental complexity.”

    Rich Hickey (2010)
    SE Radio, Episode 158
    “I think that large objected-oriented programs struggle with increasing complexity as you build this large object graph of mutable objects. You know, trying to understand and keep in your mind what will happen when you call a method and what will the side effects be.”

    Eric Allman (2011)
    Programming Isn’t Fun Any More
    “I used to be enamored of object-oriented programming. I’m now finding myself leaning toward believing that it is a plot designed to destroy joy. The methodology looks clean and elegant at first, but when you actually get into real programs they rapidly turn into horrid messes.”

    Joe Armstrong (2011)
    Why OO Sucks
    “Objects bind functions and data structures together in indivisible units. I think this is a fundamental error since functions and data structures belong in totally different worlds.”

    Rob Pike (2012)
    here
    “Object-oriented programming, whose essence is nothing more than programming using data with associated behaviors, is a powerful idea. It truly is. But it’s not always the best idea. … Sometimes data is just data and functions are just functions.”

    John Barker (2013)
    All evidence points to OOP being bullshit
    “What OOP introduces are abstractions that attempt to improve code sharing and security. In many ways, it is still essentially procedural code.”

    Lawrence Krubner (2014)
    Object Oriented Programming is an expensive disaster which must end
    “We now know that OOP is an experiment that failed. It is time to move on. It is time that we, as a community, admit that this idea has failed us, and we must give up on it.”

    Asaf Shelly (2015)
    Flaws of Object Oriented Modeling
    “Reading an object oriented code you can’t see the big picture and it is often impossible to review all the small functions that call the one function that you modified.”

    Here is Wiki's take on issues with OOP. It goes into detail.

    Here is Linus Torvald's take on object-oriented C++. Linus is merely the creator and leader of the open-source software that fuels the vast majority of the web.

    More details:

    Essay by Joe Armstrong. "After its introduction OOP became very popular (I will explain why later) and criticising OOP was rather like “swearing in church”. OOness became something that every respectable language just had to have."

    A talk given at an OOP conference by an OOP supporter who lists 10 things he hates.

    A Stanford guy telling his evolution to OOP and then out of it. Lots of detail.

    A professional who gradually realized there were issues with objects.

    I have therefore been moving away from the object-oriented development principles that have made up the bulk of my 17 year career to date. More and more I am beginning to feel that objects have been a diversion away from building concise, well structured and reusable software.

    As I pondered on this topic, I realised that this isn’t a sudden switch in my thinking. The benefits of objects have been gradually declining over a long period of time.

    A detailed explanation of how the noun-centricity of OO languages perverts everything. Here is an extended quote from the start of this brilliant essay:

    All Java people love "use cases", so let's begin with a use case: namely, taking out the garbage. As in, "Johnny, take out that garbage! It's overflowing!"

    If you're a normal, everyday, garden-variety, English-speaking person, and you're asked to describe the act of taking out the garbage, you probably think about it roughly along these lines:

      get the garbage bag from under the sink
    carry it out to the garage
    dump it in the garbage can
    walk back inside
    wash your hands
    plop back down on the couch
    resume playing your video game (or whatever you were doing)


    Even if you don't think in English, you still probably still thought of a similar set of actions, except in your favorite language. Regardless of the language you chose, or the exact steps you took, taking out the garbage is a series of actions that terminates in the garbage being outside, and you being back inside, because of the actions you took.

    Our thoughts are filled with brave, fierce, passionate actions: we live, we breathe, we walk, we talk, we laugh, we cry, we hope, we fear, we eat, we drink, we stop, we go, we take out the garbage. Above all else, we are free to do and to act. If we were all just rocks sitting in the sun, life might still be OK, but we wouldn't be free. Our freedom comes precisely from our ability to do things.

    Of course our thoughts are also filled with nouns. We eat nouns, and buy nouns from the store, and we sit on nouns, and sleep on them. Nouns can fall on your head, creating a big noun on your noun. Nouns are things, and where would we be without things? But they're just things, that's all: the means to an end, or the ends themselves, or precious possessions, or names for the objects we observe around around us. There's a building. Here's a rock. Any child can point out the nouns. It's the changes happening to those nouns that make them interesting.

    Change requires action. Action is what gives life its spice. Action even gives spices their spice! After all, they're not spicy until you eat them. Nouns may be everywhere, but life's constant change, and constant interest, is all in the verbs.

    And of course in addition to verbs and nouns, we also have our adjectives, our prepositions, our pronouns, our articles, the inevitable conjunctions, the yummy expletives, and all the other lovely parts of speech that let us think and say interesting things. I think we can all agree that the parts of speech each play a role, and all of them are important. It would be a shame to lose any of them.

    Wouldn't it be strange if we suddenly decided that we could no longer use verbs?

    Let me tell you a story about a place that did exactly that…

    The Kingdom of Nouns

    In the Kingdom of Javaland, where King Java rules with a silicon fist, people aren't allowed to think the way you and I do. In Javaland, you see, nouns are very important, by order of the King himself. Nouns are the most important citizens in the Kingdom. They parade around looking distinguished in their showy finery, which is provided by the Adjectives, who are quite relieved at their lot in life. The Adjectives are nowhere near as high-class as the Nouns, but they consider themselves quite lucky that they weren't born Verbs.

    Conclusion

    No big surprise, the experts beat the Experts hands-down. But you'd never know if you go through typical Computer Science "education," absorb the way that object-orientation is the "dominant" paradigm of computing and read the job requirements that talk about how the hiring group is serious about their object-hood. Programmers who are serious about what they do and try to understand it soon see the lack of clothing on King Object and move on.

  • The promising origins of object-oriented programming

    The creation of the original system that evolved into the object-oriented programming (OOP) paradigm in design and languages was smart. It was a creative, effective way to think about what was at the time a hard problem, simulating systems. It’s important to appreciate good thinking, even if the later evolution of that good thinking and the huge increase in the scope of application of OOP has been problematic.

    The evolution of good software ideas

    Lots of good ideas pop up in software, though most of them amount to little but variations on a small number of themes.

    One amazingly brilliant idea was Bitcoin. It solved a really hard problem in creative ways, shown in part by its incredible growth and widespread acceptance. See this for my appreciation of the virtues of Bitcoin, which remains high in spite of the various things that have come after it.

    The early development of software languages was also smart, though not as creative IMHO as Bitcoin. The creation of assembler language made programming practical, and the creation of the early 3-GL’s led to a huge productivity boost. A couple of later language developments led to further boosts in productivity, though the use of those systems has gradually faded away for various reasons.

    The origin of Object-Oriented Programming

    Wikipedia has a reasonable description of the origins of OOP:

    In 1962, Kristen Nygaard initiated a project for a simulation language at the Norwegian Computing Center, based on his previous use of the Monte Carlo simulation and his work to conceptualise real-world systems. Ole-Johan Dahl formally joined the project and the Simula programming language was designed to run on the Universal Automatic Computer (UNIVAC) 1107. Simula introduced important concepts that are today an essential part of object-oriented programming, such as class and object, inheritance, and dynamic binding.

    Originally it was built as a pre-processor for Algol, but they built a compiler for it in 1966. It kept undergoing change.

    They became preoccupied with putting into practice Tony Hoare's record class concept, which had been implemented in the free-form, English-like general-purpose simulation language SIMSCRIPT. They settled for a generalised process concept with record class properties, and a second layer of prefixes. Through prefixing a process could reference its predecessor and have additional properties. Simula thus introduced the class and subclass hierarchy, and the possibility of generating objects from these classes.  

    Nygaard was well-rewarded for the invention of OOP, for which he is given most of the credit.

    What was new about Nygaard’s OOP? Mostly, like Simscript, it provided a natural way to think about simulating real-world events and translating the simulation into software. As Wikipedia says:

    The object-oriented Simula programming language was used mainly by researchers involved with physical modelling, such as models to study and improve the movement of ships and their content through cargo ports

    In some (not all) simulation environments, thinking in terms of a set of separate actors that interact with each other is natural, and an object system fits it well. Making software that eases the path to expressing the solution to a problem is a clear winner. Simula was an advance in software for that class of applications, and deserves the credit it gets.

    What should have happened next

    Simula was an effective way to hard-code a computer simulation of a physical system. The natural next step an experienced programmer would take would be to extract out the description of the system being modeled and express it in easily editable metadata. This makes creating the simulation and making changes to it as easy as making a change to an Excel spreadsheet and clicking recalc. Here's the general idea of moving up the tree of abstraction. Here's an explanation and illustration of the power of moving concepts out of procedural code and into declarative metadata.

    This is what good programmers do. They see all the hard-coded variations of general concepts in the early hard-coded simulation programs. They might start out by creating subroutines or classes to express the common things, but you still are hard-coding the simulation. So smart programmers take the parameters out of the code, put them into editable files and assure that they're declarative. Metadata! There are always exceptions where you need a calculation or an if-then-else — no problem, you just enhance the metadata so it can include "rules" and you're set.

    The Ultimate Solution

    As you take your simulation problem and migrate it from hard-coded simulation to descriptive, declarative metadata, the notion of "objects" with inheritance begins to be a value-adding practicality … in the metadata. You understand the system and its constraints increasingly — for example ships in cargo ports.

    Then you can take the crucial next step, which is worlds away from object-orientation but actually solves the underlying problem in a way simulation never can — you build a constraint-based optimization model and solve it to make your cargo flows the best they could theoretically be!

    People thinking simulation and programmers thinking objects will NEVER get there. They're locked in a paradigm that won't let them! This is the ultimate reason we should never be locked into OOP, and particularly locked into it by having the object-orientation concepts in the language itself, instead of employed when and as needed in a fully unconstrained language for instructions and data.

    The later evolution of OOP

    In spite of the power of moving from hard-coding to metadata, the language-obsessed elite of the computing world focused on the language itself and decided that its object orientation could be taken further. Simula’s object orientation ended up inspiring other languages and being one of the thought patterns that dominate software thinking. It led directly to Smalltalk, which was highly influential:

    Smalltalk is also one of the most influential programming languages. Virtually all of the object-oriented languages that came after—Flavors, CLOS, Objective-C, Java, Python, Ruby, and many others—were influenced by Smalltalk. Smalltalk was also one of the most popular languages for agile software development methods, rapid application development (RAD) or prototyping, and software design patterns.The highly productive environment provided by Smalltalk platforms made them ideal for rapid, iterative development.

    Lots of the promotional ideas associated with OOP grew along with Smalltalk, including the idea that objects were like Lego blocks, easily assembled into new programs with little work. It didn’t work out for Smalltalk, in spite of all the promotion and backing from influential players. The companies and the language itself dwindled and died.

    It was another story altogether for the next generation of O-O languages, as Java became the language most associated with the internet as it grew in the 1990’s. I will tell more of the history later. For now I’ll just say that OOP is the paradigm most often taught in academia and generally in the industry.

    Conclusion

    OOP was invented by smart people who had a new problem to solve. Simula made things easier for modeling physical systems and was widely used for that purpose. As it was expanded and applied beyond the small category of problems for which it was invented, serious problems began to emerge that have never been solved. The problems are inherent in the very idea of OOP. The problems are deep and broad; the Pyramid of Doom is one of seemingly endless examples.

    When OOP principles and languages were applied to databases and GUI’s, they failed utterly, to the extent that even the weight of elite experts couldn’t force their use instead of simple, effective approaches like RDBMS for database and javascript for GUI’s. OOP has evolved into a fascinating case study of the issues with Computer Science and the practice of software development, with complete acceptance in the mainstream along with widespread quiet dissent resulting from fraudulent claims of virtue.

  • The Dangerous Drive Towards the Goal of Software Components

    Starting fairly early in the years of building software programs, some programs grew large. People found the size to be unwieldy. They looked for ways to organize the software and break it up into pieces to make it more manageable. This effort applied to the lines of code in the program and to the definitions of the data referred to by the code, and to how they were related. How do you handle blocks of data that many routines work with? How about ones whose use is very limited? The background of this issue is explained here.

    These questions led to a variety of efforts that continue to this day to break a big body of software code and data definitions into pieces. The obvious approach, which continues to be used today, was simply to use files in directories. But for many people, this simple, practical approach wasn't enough. They wanted to make the walls between subsets of the code and data higher, broader and more rigid, creating what were generally called components. The various efforts to create components vary greatly. They usually create a terminology of their own, terms like “services” and “objects.” Such specialized, formulaic approaches to components are claimed to make software easier to organize, write, modify and debug. In this post I’ll take a stab at explaining the general concept of software components.

    Components and kitchens

    When you’re young and in your first apartment, you’ve got a kitchen that starts out empty. You’re not flush with cash, so you buy the minimum amount of cooking tools (pots, knives, etc.) and food that you need to get by. You may learn to make dishes that need additional tools, and you may move into a house with a larger kitchen that starts getting filled with the tools and ingredients you need to make your growing repertoire of dishes. You may have been haphazard about your things at the start, but as your collection grows you probably start to organize things. You may put the flour, sugar and rice on the same shelf, and probably put all the pots together. You may put ingredients that are frequently used together in the same place. You probably store all the spices and herbs together. It makes sense – if everything were scattered, you’d have a tough time remembering where each item was. The same logic applies to a home work bench and to clothes.

    The same logic applies for the same reason to software! It’s a natural tendency to want to organize things in a way that makes sense – for remembering where they are, and for convenience of access. This natural urge was recognized in the early days of software programming. Given that there aren’t shelves or drawers in that invisible world, most people settled on the term “component” as the word for a related body of software. The idea was always that instead of one giant disorganized block of code, the thing would be divided into a set of components, each of which had software and data that was related.

    A software program consists of a set of procedures (the actions) and a set of data definitions (what the procedures act on). Breaking up a large amount of code into related blocks was helped by the early emergence of the subroutine – a block of code that is called on to do something and then returns with a result; kind of like a mixer in a kitchen. The problems that emerged were how to break a large number of subroutines into components (each of which had multiple subroutines), and how to relate the various data definitions to the routine components. This problem resembles the one in the kitchen of organizing tools and ingredients. Do you keep all the tools separate from the ingredients, or do you store ingredients with the tools that are used to process them?

    In the world of cooking, this has a simple answer. If all you do is make pancakes, you might store the flour and milk together with the mixing bowls and frying pans you use with them. But no one ever just makes pancakes – duh! And even if you did, you’d better put the milk and butter in the fridge! Ditto with spices. Nearly everyone has a spice drawer or shelf, and spices used for everything from baking to making curries are stored there.  Similarly, you store all the pans together, all the knives, etc.

    In software it’s a little tougher, but not a lot. One tough subject is always do you group routines (and data) together by subject/business area or by technology area? The same choice applies to organizing programmers in a department. It makes sense for everyone who deals primarily with user interfaces to work together so they can create uniform results with minimal code. Same thing with back-end or database processing. But over time, the programmers become less responsive to the business and end users; the problem is often solved by having everyone who contributes to a business or kind of user work as a team. Responsiveness skyrockets! Before long, things begin to deteriorate on the tech side, with redundant, inconsistent data put into the database, UI elements that varying between subject areas, confusing users, etc. There’s pressure to go back to tech-centric organization. And so it goes, round and round. Answer: there is no perfect way to organize a group of programmers!. Just as painfully, there is no perfect way to organize a group of procedures and their relationship to the data they work on!!

    The drive towards components

    There are two major dimensions of making software into components. One dimension is putting routines into groups that are separate from each other. The second dimension is controlling which routines can access which data definitions.

    Separating routines into groups can be done in a light-weight way based on convenience, similar to having different workspaces in a kitchen. In most applications there are routines that are pretty isolated from the rest and others that are more widely accessed. Enabling programmers to access any routine at any time and having access to all the source code makes things efficient.

    Component-makers decided that programmers couldn't be trusted with such broad powers. They invented restrictions to keep routines strictly separate. While there were earlier versions of this idea, a couple decades ago "services" were created to hold strictly separate groups of routines. An evolved version of that concept is "micro-services." See this for an analysis.

    The second major dimension of components is controlling and limiting the relationship between routines and data. The first step was taken very early. It was sensible and remains in near-universal use today: local variables. These are data definitions declared inside a routine for the private use of that routine during its operation. They are like items on a temporary worksheet, discarded when the results are created.

    Later steps concerning "global" variables were less innocent. The idea was to strictly separate which routines can access which data definitions. Early implementations of this were light-weight and easily changed. Later versions built the separation into the architecture and code details. For example, each micro-service is ideally supposed to have its own private database and schema, inaccessible to the other services. This impacts how the code is designed and written, increasing the total amount of code, overhead and elapsed time.

    Languages that are "object oriented" are an extreme version of the component idea. In O-O languages, each data definition ("class") can be accessed only by an associated set of routines ("methods"). This bizarre reversal of the natural relationship between code and data results in a wide variety of problems.

    These ideas of components can be combined, making the overhead and restrictions even worse. People who build micro-services, for example, are likely to use O-O languages and methods to do the work. Obstacles on top of problems.

    Components in the kitchen

    All this software terminology can sound abstract, but the meaning and consequences can be understood using the kitchen comparison.

    What components amount to is having the kitchen be broken up into separate little kitchenettes, each surrounded by windowless walls. There are two openings in each kitchenette's walls, one for inputs and one for outputs. No chef can see or hear any other chef. The only interaction permitted is by sending and receiving packages. Each package has an address of some kind, along with things the sending chef wants the receiving chef to work on. For example, the sending chef may mix together some dry ingredients and send them to another chef who adds liquid and then mixes or kneads the dough as requested. The mixing chef might then put the dough into another package and return it to the sending chef, who might put together another package and send it to the baking chef who controls the oven.

    If the components are built as services, the little kitchenettes are built as free-standing buildings. In one version of components (direct RESTful calls), there is a messenger who stands waiting at each chef's output window. When the messenger receives a package, the messenger reads the address, jumps into his delivery van with the package and drives off to the local depot and drops off the package; another driver grabs the package, loads it into his van and delivers it to the receiver's input window. If the kitchenettes are all in the same location the vans and depot are still used — the idea is that a genius administrator can change the location of the kitchenettes at any time and things will remain the same.

    Another version of components is based around an Enterprise Service Bus (ESB). This is similar to the vans and the central office depot except that the packages are all queued up at the central location, which has lots of little storage areas. Instead of a package going right to a recipient, it's sent to one of these little central storage areas. Then, when the chef in a kitchenette is ready for more work he sends a requests to the central office, asking for the next package from a given little storage area. Then a worker grabs the oldest package, gives it to a driver who puts it in his van and delivers the package to the input window of the requesting chef.

    If this sounds bizarre and lots of extra work, it's because … it's bizarre and requires lots of extra work.

    The ideal way to organize software

    The ideal way to break software into components is actually pretty similar to the way good kitchens are organized. Generally speaking, you start by having the same kinds of things together. You probably store all the pots and pans together, sorted in a way that makes sense depending on how you use them. You probably pick a place that’s near the stove where they’ll probably be used – maybe even hanging on hooks from the ceiling. You probably have a main store of widely used ingredients like salt, but you may periodically put containers of it near where it is most often used. An important principle is that most chefs work at or near their stations – but (it goes without saying) can move anywhere to get anything they need. There aren't walls stopping you, and you don’t bother someone else to get something for you when you can more easily do it yourself.

    Exactly the same principle applies whether you are creating an appetizer, an entree, a side dish or a dessert — you do the same gathering and assembly from the ingredients in the kitchen, but deliver the results on different plates at different times.

    In software this means that while routines may be stored in files in different directories for convenience, and that usually your work is confined to a single directory, you go wherever you need to in order to do your job. Same thing with data definitions; you can break them up if it seems to make things more organized, but any routine can access any data definition it needs to. When you’re done, you make a build of the system and try it out. That's what champion/challenger QA is for.

    Are you deploying on a system that has separate UI, server and storage? No problem! That's what build scripts (which you would have anyway) are for! This approach makes it easier to migrate from the decades-old DBMS-centric systems design and move towards a document-centered database with auto-replication to a DBMS for reporting, which typically improves both performance and simplicity by many whole-number factors.

    Are the chefs in your kitchen having trouble handling all the work in a timely way? In the software world you might think of making a "scalable architecture" with separate little kitchenettes, delivery vans, etc. — which any sensible person knows adds trouble and work and makes every request take longer from receipt to ultimate delivery. In the world of kitchens (and sensible software people) you might add another mixer or two, install a couple more ovens and hire another chef or two, everyone communicating and working in parallel, and churning out more excellent food quickly, with low overhead.

    If you think this sounds simple, you’re right. If you think it sounds simplistic, perhaps you should think about this: any of the artificial, elaborate, rigid prescriptions for organizing software necessarily involves lots of overhead for people and computers in designing, writing, deploying, testing and running software. Each restriction is like telling a chef that under no circumstances is he allowed to access this shelf of ingredients or use that tool when the need arises.

    Arguments to the contrary are never backed with facts or real-world experiments – just theory and religious fervor. Instead, you should consider the effective methods of optimizing a body of software, which are centered on Occamality (elimination of redundancy) and increasing abstraction (increasingly using metadata instead of imperative code). Both of these things will directly address the evils that elaborate component methods are supposed to cure but don't.

Links

Recent Posts

Categories