Question about Julia's goals

To me, multiple dispatch leads to readable, and performant, code, unlike OOP which is horrible for performant code, also OOP code not too readable.

But it doesn’t rule out OOP if you want to opt into it. In fact Julia has at least 2-3 OOP systems available (see also Jeff’s small hack on OOP StackOverflow), i.e. with emulating Python’s OOP variant fully, as far as I remember:

and the newly already registered, despite there showing “open” (sadly the developer didn’t know of the other available, why I proposed in that comment documenting at least availability of both in Julia’s docs here):

OOP is about how you structure your programs, and its polymorphism can be very slow. That’s one reason OOP is optional in C++, i.e. you don’t pay for what you don’t use", but you DO pay if you opt into OOP/polymorphism/virtual functions.

There is one aspect that people like about OOP, which is that you can TAB-complete code (it also works in Julia, there have been discussion about improvements, I think Julia can match OOP, if not already), i.e. it’s helpful to find methods and maybe OOP-style is (currently) more writable that way. Code should be optimized for readable, for humans. I believe OOP leads you to write too much code, scattered, not too readable code-bases. It may not be obvious to begin with.

Julia also has features you may think missing. Many have pattern matching, even Java, and recently Python added support for it. Julia has had it available for many years in e.g. Match.jl and Rematch.jl. I’m not sure which package is best, but this is also optional to use, and some do not like pattern matching e.g. Rick Hickey developer of Clojure language. He usually knows what he’s talking about. The main idea of that language is persistent data structure (and Lisp [non]syntax), and using such (and functioanl programming) is the most important thing you can do for program correctness, and whe have such with Air.jl, FunctionalCollections.jl, PureFun.jl (I thought there was at least one more important package, where is HAMT?).

1 Like