New blog post: "Fifty Shades of OOP." Put in a surprising amount of research for this one!

https://lesleylai.info/en/fifty_shades_of_oop/

Fifty Shades of OOP | Lesley Lai

This post talks about the many different aspects under the umbrella term OOP

@lesley very nice breakdown, thanks!
@lesley I once had a career with flash which changed from prototype to oop. But no longer in software but experiment with haxe a language that seems to mix functional aspects from ocaml with oop from actionscript with other influences and likely influenced newer languages. I think stuff like it's macros which I don't really use and it's abstract types - i use too much, both seem quite powerful, tricky and a bit novel. But really Haxe seems to allow you to choose how much oop and functional you use and to blend them and since it targets other languages the amount of oop or functional may even vary with the target!
@lesley ( due to limited char, rest of my comment )
Still looking at other languages but I was captivated with the integration of graphics and code in as1, and I am captivated by the integration of OOP and Functional in haxe. Have you played with haxe language do you have suggested languages for me to explore? My feelings are the alternatives to haxe are Swift, TS and C#... perhaps better for jobs and most similar in ways but all seem kind of disabled or overly ecosystem tied, and probably not as fast! I have looked at less mainstream languages and prefer less corporate focused, but some of these seem more effort for creating graphics than haxe. I am likely biased so interested in ideas.
@lesley but I was captivated with the integration of graphics and code in as1.. partially ment the mix of animation/graphical and code allowing people that have cross over brains... ie have a mix of art, graphics, even music, and code but may not be naturally pure coders, but are pure creators and perhaps inovators.

@nanjizal Haxe looks really cool! Though I am not familiar with it.

For languages to learn, I am not sure what kind of suggestions I can give you since there are so many options. From an intellectual curiosity perspective, probably learn something drastically different from what you know? Though if you want to focus on creating art/graphics/music, then maybe JS/TS is a good fit (if you don't already know them) because of how easy to set up and to generate graphics and sounds

@lesley it is really hard to justify using JS or TS if you know Haxe before TS existed! To target JS with Haxe you initially had to read a lot of JS code!
For instance one of my old Canvas JS experiment. ( since I had to switch git profiles it may actually have been created before TS existed ).
https://nanjizal.github.io/Letters/web/textPathway.html
a canvas jigsaw ( have kha webgl version also )
https://rawgit.com/nanjizal/JigsawX/master/bin/JigsawDivtastic.html
( there was a haxe flash version that allowed webcam! and an android haxe java version using swing/awt ).
then WebGL tetris ( there are versions that use haxe toolkits and run on c++ )
https://nanjizal.github.io/PolyominoTriangles/binWebGL/index.html?2
Text on a pathway

@lesley Tried to port a triangulation lib but it was slow
https://rawgit.com/nanjizal/triangulationsWebGLtest/master/index.html
Then spiro port was interesting but licence limitations :(, tried to create a cleaner port and with the creators blessing release it MIT but the GPL complained so removed the cleaner code.
Have lots of experiments in haxe that run on C++ often via a haxe toolkit and also Canvas or WebGL.
The reality is that TS and JS tend to feel a bit limited since all they add is less effort to use others libraries, which commercially is important but they are not able to target native as well and they are less expressive languages??
So more curious on languages perhaps outside web perhaps?
Find lots of the fast languages look rather awkward to use, and to create the stuff I used to make in flash easily would be serious effort! There is a dynamic or reliable code, code that is actually easy to be creative with, and fast code... and last of all perhaps most important code that pays the bills.
@lesley So far I think haxe does the first 3 quite well! But sure always interested in obscure but technically revolutionary languages!
@lesley
Great post.
I sent it to all my co workers.
I think it's missing some simple code example snippets. It will be easier to understand the concepts with some illustrations and pseudo code examples.

@lesley @aartaka One thought I've had for a while is that programming languages and the rhetoric around it focus too much on tangible things like member variables and methods.

David Parnas was the first to point out [1] that each piece of a system -- whether you call it a function or method or object or class -- should exist to "protect" a single coherent invariant. That's the thing we need to ensure we preserve in the course of extension, not any particular member or method.

[1] David Parnas, "On the Criteria To Be Used in Decomposing Systems into Modules," 1972

@akkartik @aartaka Sounds like the syntax vs semantics debate. This reminds me of the "Wadler's law." That said, while we probably spend too much time bikeshedding syntax, I do think it matters because that's how _human_ interface with a programming language. Somewhat related:

https://slim.computer/concrete-syntax/

Concrete syntax matters, actually

@lesley Hmm, I think this is more about pragmatics. I want the syntax of a programming language to guide you to think more clearly about the problem. Should a member variable be public or private? It's irrelevant. What matters is whether an invariant is violated at some point in a program. Languages should better emphasize invariants.

Hmm, I wonder what Eiffel did? No, https://en.wikipedia.org/wiki/Eiffel_(programming_language)#Scoping also seems weird. So I'm suggesting some speculative new research direction.

Eiffel (programming language) - Wikipedia

@akkartik Ahh. I misunderstood what you said.

D also supports an `invariant` keyword. I wonder whether this has a performance implication (do they assert the invariant all the time?) It is kind of interesting, but I don't see many languages following Eiffel's footsteps.

@akkartik That's something that has been on my wish list as well for quite a while.

I'd like a language to let me express whatever I know or want to be true of a software system, irrespectively of whether some tool (compiler, type checker, ...) can make use of it.

@lesley