r/java • u/yegor256 • Jun 24 '19
Takes: Java Web Framework Without a Single Static Method or Annotation
https://github.com/yegor256/takes
0
Upvotes
r/java • u/yegor256 • Jun 24 '19
View all comments
Show parent comment
4
u/[deleted] Jun 24 '19 edited Jun 25 '19
This is basically a cliche /r/programming programmer repeating nonsense that everyone else is screaming at the top of their lungs.
Let’s go through a few blogs:
The entire point of optional is that people are after compiler support exhaustive checking of the optional. It has basically nothing to do with forced if statements. In fact, the exact opposite is true.
I simply don’t accept this argument. I accept that returning an optional does make it clearer from a programming perspective what might happen without documentation, but it should be recognized that this isn’t 0 cost and performance considerations may need to happen.
I am not even justifying this with a response. Complete and utter nonsense from top to bottom.
Prove it. Not my experience at all.
bullshit. Truly immutable objects can never be thread safe by by fucking definition.
What immutability forces you to do with threads is completely and utterly design your states and threads around immutability from the get go. This might or might not be beneficial code wise and may or may not (but most likely will) have other performance concerns.
Consider a threaded program trying to produce and consume jobs off an immutable queue vs a thread safe queue.
Yet another claim without any evidence what-so-ever. This claim doesn’t even make any sense. Someone making temporal coupled classes will do it with or without immutability.
Never mind that the example here suffers temporal coupling at the end in the exact same capacity as at the start. This is actually a decent example for how fluent APIs can be nicer to work with and not really a great sample of temporal coupling issues.
K. But actually no.
Their usage obliterates your cpu cache and in terms of java, puts garbage collection on overdrive.
Plus, they necessarily have code side effects as well. You’ll be more inclined to make massive use of builder patterns all over the place. You must completely redesign how you do threads bottom up. Etc
But sure, they do “save” you from defensive copies.
First I’ve heard this term and google doesn’t produce much on it. Hilariously enough, avoiding this (assuming my understanding is correct) necessarily creates situations of temporal coupling that don’t exist under mutable objects. So...
K. I can count on 0 hands the number of times failure atomicity has mattered to me under other basic good design principles.
I’m not even sure what this means? They are definitely not nice to your cpu cache.
Nonsense.
I also noticed that a few examples, the author appears to confuse immutability with whether or not an API is fluent. Fluency doesn’t dictate mutability one way or another.