There is more and more support for pre- and post-condition checks, even in languages like Java. For instance, IntelliJ, a famous Java IDE, offers the @Nullable
and @NotNull
annotations. You can annotate your methods, attributes, or return values with them, and IntelliJ will alert you about possible violations. IntelliJ can even transform those annotations into proper assert
checks at compile time.
In addition, projects such as Bean Validation enable you to write more complex validations, such as “this string should be an email” or “this integer should be between 1 and 10.” I appreciate such useful tools that help us ensure the quality of our products. The more, the merrier.
Leave a Reply