You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In February 2019, most of the (non-) null checks in the source code were replaced by calls to the Predicate function Objects.isNull(…) or Objects.nonNull(…). This does not bring any noticeable benefit and represents an additional and unnecessary hurdle for newcomer Production programmers. While the test for == null or != null (with exactly this syntax) occurs in a variety of programming languages, a new programmer has to deal with it at least first what the object Objects is, and what the function isNull() or nonNull() does. Following Ockham's razor, they must first assume that this function does something different or something more, than the primitive test == null or != null does, otherwise the primitive would have been used. (Although this corresponds to the behavior of C++, where primitive operators can be overridden, this is often viewed as a conceptual mishap of C++ and was probably deliberately not included in the Java language specification.)
Technically, an additional function call leads to an additional dependency and each time to an additional jump in the program flow, each time an additional entry has to be created on the stack, for no gain.
Goal: The calls to the functions Objects.isNull(…) and Objects.nonNull(…) should be reduced to the use of the primitive == null or != null again.
The text was updated successfully, but these errors were encountered:
In February 2019, most of the (non-)
null
checks in the source code were replaced by calls to thePredicate
functionObjects.isNull(…)
orObjects.nonNull(…)
. This does not bring any noticeable benefit and represents an additional and unnecessary hurdle for newcomer Production programmers. While the test for== null
or!= null
(with exactly this syntax) occurs in a variety of programming languages, a new programmer has to deal with it at least first what the objectObjects
is, and what the functionisNull()
ornonNull()
does. Following Ockham's razor, they must first assume that this function does something different or something more, than the primitive test== null
or!= null
does, otherwise the primitive would have been used. (Although this corresponds to the behavior of C++, where primitive operators can be overridden, this is often viewed as a conceptual mishap of C++ and was probably deliberately not included in the Java language specification.)The function's Javadoc also clarifies that it only exists to be used as a Predicate.
Technically, an additional function call leads to an additional dependency and each time to an additional jump in the program flow, each time an additional entry has to be created on the stack, for no gain.
Goal: The calls to the functions
Objects.isNull(…)
andObjects.nonNull(…)
should be reduced to the use of the primitive== null
or!= null
again.The text was updated successfully, but these errors were encountered: