7 ms·
honest question, not a serious SDE here. In what ways is julia not supportive of OOP?
by banku_brougham 8y ago
honest question, not a serious SDE here. In what ways is julia not supportive of OOP?
- RivieraKid 8y agoIt doesn't have interfaces for example. It doesn't have access modifiers. Also, not sure if this belongs to OOP but working with optionals is cumbersome.
- StefanKarpinski 8y agoPython also doesn’t have interfaces or access modifiers. Would you consider Python to have bad support for OOP by those criteria?
- spaced-out 8y agoYes, Python definitely has bad support for OOP.
- kbp 8y agoSmalltalk doesn't have them, either.
- StefanKarpinski 8y agoIndeed. Alan Kay might take some issue with this notion of OOP.
- h8hawk 8y agoOnly if define OOP as what java does.
- ken 8y agoSmalltalk might be a better example.
- RivieraKid 8y agoYes, although Python feels more suitable for OOP for some reason, not sure why... perhaps it's the object.method() notation. It's often more natural and readable and allows better autocompletion in an IDE. Also, I prefer that methods are defined inside of a class, it's immediately clear what is a top level functions and what is a method belonging to a class or struct.
- deleted 8y ago[deleted]
- dan-robertson 8y agoWell Julia sort-of does have interfaces, it’s just that those interfaces are protocols and only conventions (ie there’s no way to say “my type will implement Foo interface”). There is an interface for iteration. If you want to implement it then you just have to implement the iterate function for your type and zero and 1 parameters. Similarly the way to say that your type has a length isn’t to implement the HasLength interface but to just implement the length function.
- banku_brougham 8y agoAgain sorry for being dense but: - aren’t access modifiers the way to define scope? That is possible in julia. - getters and setters, wouldn’t those be defined in a struct in julia? - inheritance: pretty sure this doesn’t exist in julia. I seriously barely understand, i’m reading from the doc here: https://docs.julialang.org/en/v1/manual/types/index.html https://docs.julialang.org/en/v1/manual/types/index.html