Skip to content

{ Category Archives } OOP

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 […]

If Object-Oriented Programming were announced today

Here’s an idea: the current backlash against OOP is actually because people aren’t doing OOP, they’re doing whatever they were doing before OOP. But they’re calling it OOP, because the people who were promoting OOP wanted them to believe that they were already doing OOP. Why is that? Because the people who were promoting OOP […]

Prototypical object-oriented programming

Some people think that the notion of classes is intrinsic to object-oriented programming. Bertrand Meyer even wrote a textbook about OOP called A Touch of Class. But back in the 1980s, Alan Borning and others were trying to teach object-oriented programming using the Smalltalk system, ostensibly designed to make simulation in computer programmers accessible to […]

The package management paradox

There was no need to build a package management system since CPAN, and yet npm is the best. Wait, what? Every time a new programming language or framework is released, people seem to decide that: It needs its own package manager. Simple algorithms need to be rewritten from scratch in “pure” $language/framework and distributed as […]

Minimum Viable Controller

The book “NeXTstep Programming Step One: Object-Oriented Applications” by Garfinkel and Mahoney said this about Controllers in 1993: A good rule of thumb is to place as little code in your controller as necessary. If it is possible to create a second controller that is only used for a particular function, do so – the […]

Dogmatic paradigmatism

First, you put all of your faith in structured programming, and you got burned. You found it hard to associate the operations in your software with the data upon which they act, and to make sure that the expectations made on the data in one place are satisfied when that data has been modified in […]

*-Oriented Programming

Much is written about various paradigms or orientations of programming: Object- (nee Message-) Oriented, Functional, Structured, Dataflow, Logic, and probably others. These are often presented as camps or tribes with which to identify. A Smalltalk programmer will tell you that they are an Object-Oriented programmer, and furthermore those Johnny-come-latelies with their Java are certainly not […]

Protocol-Oriented Programming in Objective-C

Hi, this is a guest post from Crusty. I’ve been doing a tour of the blogosphere, discussing Protocol-Oriented Programming. This time, Graham was kind enough to hand over the keyboard for SICPers and let me write a post here. Back when Graham was talking about Object-Oriented Programming in Functional Programming in Swift, he mentioned that […]

Functional Programming in Object-Oriented Programming in Functional Programming in Swift

The objects that I’ve been building up over the last few posts have arbitrarily broad behaviours. They can respond to any selector drawn from the set of all possible strings. As with all art, beauty is produced by imposing constraints. An important class (pardon the pun) of objects only has a meaningful response to one […]