DEV Community

Cover image for Java Counter Culture - Cultural Javism

Java Counter Culture - Cultural Javism

Fernando Ollé on December 17, 2024

What is Cultural Javism? Haven't you heard about Cultural Javism? It's terrible! đŸ˜± For those unaware, here's a taste of it. You know w...
Collapse
 
citronbrick profile image
CitronBrick

Speaking about counter-culture, as I fullstack developer I feel with ES6+ & Angular2+ especially,
JavaScript is trying to become like Java.

Collapse
 
lionelrowe profile image
lionel-rowe • Edited

If by "ES6+" you just mean the class keyword and the associated classical OOP features, I can see the argument. But most of the features since ES6 have nothing to do with classical OOP, so if anything it's just continuing to diverge further away from Java. Usually new TC39 proposals cite Java implementations as prior art only among a large number of other languages, and it rarely seems to be the biggest influence design-wise.

Collapse
 
lionelrowe profile image
lionel-rowe

Maybe I'm missing something as I don't know much Java, but how does validator know what it's validating when it's called as validator.validate()? Surely it needs to be validator.validate(this)?

Collapse
 
nandoolle profile image
Fernando Ollé

In this example, the validator only illustrates what you can do within the custom constructor of record; on a real code base, you would most likely need a different implementation for the validator. Or you can opt for an even more straightforward implementation without any validator.
I'm studying DOP lately, so I felt like a validator feat nicely on this example.

PS.: The validation can be done like this: new Validator.validate(), using reflection, but it's not a standard (nor a simple) way to do it. I strongly do not recommend the usage of reflection to do this.

Collapse
 
authbigvertex profile image
James Hogan III

I'm glad i'm not the only one confused by that

Collapse
 
seanevans profile image
Sean Evans

I worked on some projects with Kotlin until I discovered that I couldn't avoid NullPointerExceptions from third-party libraries.

Now, I use modern Java too.

Collapse
 
seanevans profile image
Sean Evans • Edited

I strongly agree with Fernando's point in this post, and I wrote a related short post: Get Started with Modern Java Today: A Concise Guide

Collapse
 
shrsv profile image
Shrijith Venkatramana

One often wonders how the JVM turned out so good, while its de facto language turned out so poor.

I've always been a spiritual member of the Java counter culture - so consider me part of the movement :)

Collapse
 
seanevans profile image
Sean Evans

Kotlin is a good JVM language (when using third-party libraries written in Kotlin)

Collapse
 
leonardorafaeldev profile image
Leonardo Rafael Dev

You are the only person in the world who makes Java good, big fan

Collapse
 
nandoolle profile image
Fernando Ollé

Thanks!! đŸ˜â€ïž

Collapse
 
felipe_falkiner profile image
Felipe Magosso Poveda

Awesome!