- akkad33 parentLast year I moved to fedora because tired of adware and forced updates on Windows
- > Java type shenanigans are endless if you want some fun but baseline you can cast to arbitrary types at runtime and completely bypass all compile time checks.
For this reason Java is a bad example of a typed language. It gives static typing a bad rep because of its inflexible yet unreliable type system (only basic type inference, no ADTs, many things like presence of equality not checked at compile time etc ) Something like ocaml or fsharp have much more sound and capable type systems.
- 5 points
- In python, those give a mutable set, which is what I was referring to above. Also not to put too a fine a point, you'll never see python code like that in the wild, but even in code reviews these days, it's common to find Java code written like in my example because the syntax for sets in Java came after Java 8
- > The language itself is quite beautiful when used properly and with modern features.
I respect your opinion but I wouldn't call Java beautiful (of course it depends on your definition of beautiful). It takes so much ceremony to do things you would do without any thought in other languages .
Initiating a mutable set
Python
`a = {1,2}`
What most Java programmers do
``` var a = new HashSet<>(); a.add(1); a.add(2); ```
Shorter one but requires more ceremony, and hence knowledge of more language semantics
``` var a = new HashSet<>(new Arraylist<>(List.of(1,2)) ```
I don't know if the above works but the Idea is to initiate a list and pass it into a HashSet constructor.
Similarly Java 21 allows you to model union types but doing so requires you to define N+1 classes where N is the number of union cases whereas in other languages it's as simple as `type A = C |D`
- But if you're not good technically does it matter if you're good? I notice two type of people who I see as successful in my company
1. People who are extremely good technically. They don't have great people skills. They are almost hard to get chummy with. They only respect you if you're as good as them technically or if you belong to the following group 2. People with great personalities, charisma. They are not technically excellent. They are not the people you go to if you want to develop a streaming database. But they have vision, they have a broad view of things and know what to improve, where to work etc. They are not software engineers, more like team leads.
Then there are people who are neither great technically nor have charsima that make people gravitate towards them. People who are just fumbling in mediocrity, wondering if they are in the right place and feeling stuck (like me )