To mark Star Wars Day, a small request to all ABAP developers out there: no Yoda conditions. This isn’t just because Lars Hvam has defined it as an abaplint rule, but because it makes fundamental sense.
The following example confuses me, and hopefully most ABAP developers, when reading it (cognitive load +1):
IF abap_true = is_date_valid( date ).
[..]
ENDIF.
The following option is acceptable:
IF is_date_valid( date ) = abap_true.
[..]
ENDIF.
ABAP even allows you to omit the comparison against ABAP_TRUE here:
IF is_date_valid( date ).
[..]
ENDIF.
So please don’t make reading ABAP more difficult than it needs to be. Thanks in advance. By the way: please do not use EQ, GT, LT, etc.
