4 ms·
Using Union as an example is more understandable than using abstract types. I can also explain why abstract types are broken, but that would involve a complex i
by ningcongchen 2y ago
Using Union as an example is more understandable than using abstract types. I can also explain why abstract types are broken, but that would involve a complex interaction of subtyping and abstract interpretation.
In addition, I believe that abstract types are not that horrible since in industry we use OOP any way (https://github.com/Suzhou-Tongyuan/ObjectOriented.jl https://github.com/Suzhou-Tongyuan/ObjectOriented.jl). I coworked with the author of this package several years ago. Currently, he is developping a different branch of Julia compiler. Since OOP makes eveything easier to design (from linter to static compiler), and programmers prefer OOP over abstract types, I personally don't think they will cause huge problems.