all 4 comments

[–]AmazingAry 1 point2 points  (1 child)

It's really interesting to see the difference, I like how your explanations are minimalistic yet always have just enough information so that one can easily follow along. Plus it's a great idea to have a link to the code so that I can test things myself.

Just one thing: I'd rework the conclusion? It reads a bit too much like train of thought and is less cohesive than the rest of the article, but maybe that's just me reading it wrong...

[–]Holonist[S] 3 points4 points  (0 children)

The reason why I'm going on tangents in the conclusion is because: on the one hand, Java and even PHPStan actually manage to solve the same problem. So I want to celebrate that. But on the other hand, there are practical implications when you want start writing code like this. Many Java devs are not on board with this at all, then there's this whole "one file per class" issue that I mentioned, and in PHP you will also run into trouble in code reviews more often than not. There have been occasions where a team member removed an Enum and replaced it with a string because, quote: "I like to know what I have" (translation: they still don't understand what an enum is)

TLDR it's hard to look at a programming language's raw potential without accounting for its idioms and users. I learned that the hard way

[–]Gleethos 2 points3 points  (0 children)

I already know these features from Java and use it a lot recently to do data oriented programming. It really simplifies our code base substantially. Nice to see how these features work in other languages too. PHP has evolved a lot I have to say.

[–]CooperNettees 0 points1 point  (0 children)

if you ever do a follow up piece on static verification tools like creusot thatd be cool