plasmon

enjoy a tasty meal and live :)

physics undergrad (among other, evil things)


Back when I wasn't programming as much, I used to shit on object oriented programming because I thought it was universally bad. Now that I'm programming a bit more often, to be honest, I actually don't hate OOP—actually, it can be pretty useful.

I do most of my programming in Julia, so I can mix and match paradigms—e.g. functional and object oriented—as I please because it's so goddamn expressive. Of course, Julia doesn't focus on OOP, so that means I'm not burdened with a bunch of horseshit like you might see in Java.

The main way I use OOP is a way to abstract certain things, so, for example, if I have a box, I can just make a struct called Box.

struct Box
    length::Float64
    width::Float64
    height::Float64
end

Could this be done a different way? Sure, but having the ability to think in terms of tangible objects helps my pea brain out a lot. Of course, OOP isn't perfect or anything—nothing in programming, aside from Carmack's fast inverse-square root algorithm, is perfect—but it has its time for being useful.

I guess the biggest lesson I've learned is that you should just use whatever is the right tool for the job, even if you made fun of it because you were uneducated and stupid and only knew that tool's worst implementations (ahem Java).


You must log in to comment.

in reply to @plasmon's post:

Back when I used to teach a programming languages course, I'd constantly make the point that we present these concepts poorly in two awful ways:

  • We talk about languages and paradigms as tools, rather than a series of "blinders" and "jigs" to keep us focused on getting closer to a solution.
  • We pretend that the paradigm is some popular language, as if LISP (to pick an example) isn't mostly derived from 1960s IBM assembler instructions.

But also, since almost nobody who creates mainstream languages cares about programming paradigms, it's also often a hilariously useless concept, too...