Skip to content

{ Category Archives } OOP

Why inheritance never made any sense

There are three different types of inheritance going on. Ontological inheritance is about specialisation: this thing is a specific variety of that thing (a football is a sphere and it has this radius) Abstract data type inheritance is about substitution: this thing behaves in all the ways that thing does and has this behaviour (this […]

In defense of `id`

Something you can’t see about my dotSwift talk on OOP in FP in Swift is that to make the conference more interesting while the AV was set up for the next speaker, Daniel Steinberg invited me over to a side table for a question and answer session. He had some great questions and I had […]

On Inheritance

I recently had the chance to give my OOP-in-FP-in-Swift talk again in NSLondon, and was asked how to build inheritance in that object system. It’s a great question, I gave what I hope was a good answer, and it’s worth some more thought and a more coherent response. Firstly, let’s look at the type signature […]

machoo – Object-Oriented Programming in Object-Oriented Programming in the GNU HURD

For the last few weeks, my when-I-get-to-it project has been machoo, which is sort of an object-oriented system on the HURD but mostly an excuse to learn about how Mach messaging works. I decided to build a Smalltalk-style “give me any old selector, and I’ll do something with it” messaging system on Mach, which is […]

An update on the HURD project

Last time, on Structure and Interpretation of Computer Programmers, I was building an object-oriented programming system on top of the HURD, and had realised that I needed to use its trivfs library for a sender to be able to discover an object to send messages to. I got it working very quickly, but ended up […]

Gently HURDing the side projects

I find it problematic that even at times when I’m avoiding computing outside of work, I still have ideas about things I would like to try out or improve in computing “if I had the time”. I tend to capture these somehow – usually written notes in paper or Evernote, and my personal technology radar. […]

An unhelpful distinction

Object-Oriented Programming is quite simple: it’s just choosing what function to run based on the parameters to the function (whether through method sending like Smalltalk, polymorphic lookup like CLOS, or table searching like C++: usually pattern-matching like Haskell would be excluded here). Object-Oriented Analysis and Design is the thing where we represent our problem domain, […]

OOP as an organic approach to computing

I’m reading How Not to Network a Nation, which talks a lot about cybernetics. Not merely cybernetics as the theory of control in complex systems (cybernetics shares a root with “governor”, fans of the etymological fallacy!) but cybernetics as the intersectional discipline matching organisational and management theory with computer science, anthropology, and biology. The study […]

Give me an S

S – I can find the thing I need to change. O – My change will either be an extension or a replacement. L – My replacement or extension needs to be a drop-in change. I – Here’s what my replacement can do. D – I have somewhere to put my replacement.

When Object-Oriented Programming Isn’t

A problem I was investigating today led me to a two-line Ruby method much like this: class App # … def write_file_if_configured file_writer = FileWriter.new(@configuration.options) file_writer.write if file_writer.can_write? end end This method definitely looks nice and object-oriented, and satisfies many code quality rules: it’s shorter than 10 lines, contains no branches, no Boolean parameters (unless […]