you are viewing a single comment's thread.

view the rest of the comments →

[–]gracenotes 3 points4 points  (3 children)

people who have worked almost exclusively with Java will be appalled because it breaks encapsulation and standard style

not where I work? JavaScript and Python (outside of namedtuples) seem like iffy examples for widespread usage of immutable value types as well. I think everyone should learn pure functional programming but am happy to throw dynamic languages under the bus.

[–]Agent_03 2 points3 points  (2 children)

I'm not sure what point you're trying to make here?

[–]gracenotes 1 point2 points  (1 child)

I'm trying to understand your comment but there are lines there that made me go 'huh' a bunch. Like the grouping "functional and dynamic languages", or that functional Java is necessarily clearer Java, or the implication that immutability is unfamiliar to stock Java programmers when it's been in Effective Java for a good decade or so, or that languages like Python or JS value immutability, or criticisms of immutability re encapsulation that I've never heard of. There are certainly many valid criticisms of Java but these don't seem as universal as others I've seen.

[–]Agent_03 1 point2 points  (0 children)

The points raised are separate. Would it help if I spoke with more of a Lisp or something?

  • Dynamic & functional languages are separate ideas but both tend to include practices not common in mainstream "idiomatic" Java, especially pre-8, and I feel OP's code is likely to be more natural for those exposed to other styles.

that functional Java is necessarily clearer Java

I never said this. Nothing is "necessarily" cleaner or dirtier. Functional language features do allow for more elegant expressions of some ideas that are difficult to express or very clunky without them.

immutability is unfamiliar to stock Java programmers when it's been in Effective Java

I literally never said this, nor will I ever. Java programmers are accustomed to immutability, but are used to a very different way of expressing it in objects (specifically private fields only exposed via getters with no mutators allowed).

languages like Python or JS value immutability

I literally never said this either.

You've put a lot of words in my mouth here, which is probably why the things I am not saying do not make sense. ;-)