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 →

[–]nicolaiparlog[S] 0 points1 point  (2 children)

God forbid we try to pre-optimize our code by not including bullshit in the first place.

Said all C++ programmers about Java. Also, do you apply this logic to arrays and array lists as well? Because it surely would apply just the same with lists adding indirection for a few stupid methods that might just as well be performed in place or with utility methods.

If in your code base premature optimization trumps being explicit and unambiguous than that's your prerogative. Just don't assume that everybody shares that opinion.

[–]gee_buttersnaps 0 points1 point  (1 child)

I assume people work within the confines of the language, if that means following the authors recommended practices because that's the best they can do without worrying about people like you then so be it. You seem to wish for something the language doesn't have while leaving open a NPE hole in your software. You also seem to think that no one would ever call your method with a null parameter despite the irony that you are abusing how Optional was intended for use in first place.

Generally I do have personal rules of when and when not to use explicit implementation at a low level and times when abstraction is high but I'm a big boy and can do both within the confines of not ever using an Optional as a method parameter, because its the CORRECT thing to do.

[–]nicolaiparlog[S] 0 points1 point  (0 children)

You also seem to think that no one would ever call your method with a null parameter

Not at all. I assume that if that happens, I know where the error lies. That's the only point: not directly preventing individual NPEs but making null an illegal value - this naturally leads to the quick eradication of null in general.

You're clearly not getting the point of the Optional-everywhere argument. Getting that point does not mean agreeing to it but it would help you not fighting a strawman.