LemoineFairclough@sh.itjust.workstoProgrammer Humor@programming.dev•Take.Out.The.(Garbage|Cat)*English
1·
6 months agoHistorically, pattern matching notation is related to, but slightly different from, the regular expression notation
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_13
This might be educational: https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html
There are issues that the
Optional
class alleviates that are common enough to be documented: https://www.jetbrains.com/help/inspectopedia/ConditionalCanBeOptional.html (more detail is available at places like https://github.com/JetBrains/intellij-community/blob/a2d32ec64ed0fb37c7cc97856aa94cce95b17ee5/java/java-impl/src/inspectionDescriptions/ConditionalCanBeOptional.html (I believe this information used to be visible with the “inspectopedia” URLs but I don’t see that today))On the other hand, it seems there are some features / situations that require
null
to be present: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining https://www.jetbrains.com/help/inspectopedia/OptionalToIf.html