Data-focussed coding better than OOP?

248 views
Skip to first unread message

Pascal Bergmann

unread,
Nov 25, 2018, 1:29:31 PM11/25/18
to Eve talk
https://dpc.pw/the-faster-you-unlearn-oop-the-better-for-you-and-your-software

I think it's a good read. The author talks about how OOP becomes complex and goes wrong. To avoid some of OOPs pitfalls, he designs his software architecture around data.

Sounds a little bit like Eve's fundamentals, haha :)

Christopher Russell

unread,
May 24, 2019, 4:04:57 PM5/24/19
to Eve talk
I came across this yesterday: http://doc.cat-v.org/bell_labs/pikestyle

... and this really resonated with me:

Programming with data.
      Algorithms, or details of algorithms, can often be encoded compactly, efficiently and expressively as data rather than, say, as lots of if statements.  The reason is that the complexity of the job at hand, if it is due to a combination of independent details, can be encoded A classic example of this is parsing tables, which encode the grammar of a programming language in a form interpretable by a fixed, fairly simple piece of code.  Finite state machines are particularly amenable to this form of attack, but almost any program that involves the `parsing' of some abstract sort of input into a sequence of some independent `actions' can be constructed profitably as a data-driven algorithm.
      Perhaps the most intriguing aspect of this kind of design is that the tables can sometimes be generated by another program - a parser generator, in the classical case. As a more earthy example, if an operating system is driven by a set of tables that connect I/O requests to the appropriate device drivers, the system may be `configured' by a program that reads a description of the particular devices connected to the machine in question and prints the corresponding tables.
      One of the reasons data-driven programs are not common, at least among beginners, is the tyranny of Pascal.  Pascal, like its creator, believes firmly in the separation of code and data.  It therefore (at least in its original form) has no ability to create initialized data.  This flies in the face of the theories of Turing and von Neumann, which define the basic principles of the stored-program computer.  Code and data are the same, or at least they can be.  How else can you explain how a compiler works? (Functional languages have a similar problem with I/O.)

... back to lurking in the shadows.
Reply all
Reply to author
Forward
0 new messages