Erik Engheim
2 min readJul 9, 2021

--

You are making this into a Julia specific problem, when it isn't. This is a problem every developer steep in OOP thinking faces when switching to a functional language.

You will find the same problems for people switching to Haskell, Scheme, Erlang, OCaml as well as languages like Go and Rust. Your claim is that all these languages in effect have a serious weakness because they don't support subclassing.

I am sorry but that just comes across as rather biased and narrow minded. You dismiss a new language outright after some light experimentation because it doesn't follow the programming paradigm you have been taught.

The people in these discussion on Julia admit they are beginners are are just trying to learn. They aren't using that as an excuse to say the language sucks.

So composition doesn't always work? You see multiple suggested solutions to similar problem? And this is a problem why?

In an OOP language almost everything is solved in terms of classes and objects. Often in an overly complicated manner. In Julia there are often way simpler ways to solve problems. Insisting that you use classes and inheritance at all times, simply create more problems than it solves.

Say you got a OOP designed program with an elaborate system of abstract factory classes which you want to recreate in Julia. That problem disappears in Julia as types are first class objects you can pass around.

Say your OOP solution has command objects. Now you complain you cannot recreate this in Julia due to lack of subclassing, not realizing that you don't need the command pattern when you got first class functions which you can pass around or when objects can be made callable like functions.

Or maybe you want to implement the subject-observer pattern and you are upset that you cannot subclass a model object to avoid boilerplante view observer notification. Except... this is trivially solved by specializing the setproperty function for your type.

A lot of problems you face when writing software which is solved in a clunky manner in OOP is solved more elegantly in Julia. Except when you try to replicate the clunky OOP solution in Julia, you do get into problems. But that isn't a reason to claim Julia has a weakness. It is a weakness to have better solutions than the one you try to implement due to old habits?

--

--

Erik Engheim
Erik Engheim

Written by Erik Engheim

Geek dad, living in Oslo, Norway with passion for UX, Julia programming, science, teaching, reading and writing.

Responses (1)