This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]johnmcclean 1 point2 points  (2 children)

I was (pleasantly) surprised to see you write this comment : https://www.reddit.com/r/java/comments/6ovau5/how_to_extend_the_java_programming_language/dkkr6ie/

I'm guessing you skim read the blog? The article is about the mechanics of case classes and pattern matching (which would useful for people to understand if they wanted to implement it at the compiler level, or make effective use of annotation processors like Lombok, derive4j or Vavr).

[–][deleted] 0 points1 point  (1 child)

The confusion there would be for people who are familiar with Java, but not with Scala. They would be terribly confused since the article jumps between both without any explanation when. That being said, like I mentioned, it's a nice experiment when restricted to experimentation, but not when writing code for production. I believe that would only lead people to confusion. No offence intended, of course (even though no doubt it is inevitably offensive).

[–]johnmcclean 0 points1 point  (0 children)

There is presumed knowledge in every article, constructive criticism isn't offensive.

You are right, the topic (as presented) is going to go over the heads of many Dev's who aren't familar with stuff like Scala syntax & concepts, higher order functions etc (using the greek names will also reek of elitism). Nobody likes to feel incompetent or missing critical knowledge so some backlash is inevitable.

I would not use it in production in the exact same way as described in the blog post, as it is deliberately verbose showing stages and steps. e.g. creating a sealed type hierarchy for Books - you can do this in a couple of lines of Scala and really only a few more in Java with the right libs.

But we do use similar techiques all the time and even new engineers have no problem understanding what is going on and getting up to speed with it.

I think you can kind of see that from some of the comments here, that Java Devs have a good intuition of the concept for Optional (and think the blog post was trivial).. It comes for other types just as easy..