The Daily WTF
Follow
CodeSOD: Prefixual
Maciek inherited a complex and confusing method in Dynamics Ax called "modified" that checks for record modifications.The method begins by extracting an item ID and prefix from the SalesLine table.It then queries the ResponseCodeTable using the item prefix, retrieving a full record instead of just an existence check.If a record exists, string manipulation and additional database calls are performed.Finally, the method calls "super()" to perform the actual record modification check.The irony is that the validation process itself may alter the record, making it dirty.This method violates the single responsibility principle and is likely a result of fitting functionality into a convenient lifecycle event.Such code can lead to technical debt for future developers or successors.The text highlights the absurdity of using the QWERTY keyboard layout to list the alphabet.BuildMaster is mentioned as a tool for creating self-service release management platforms.