DEV Community

Discussion on: What's the weirdest coding practice you've seen?

Collapse
 
scotthannen profile image
Scott Hannen

I once had a manager insist that we store thousands of mapping rules in XSLT. The incoming data was in XML. Of course, stored that way, the rules are useless unless your incoming data is in an expected XML format. The sane approach would be to convert incoming data to something more manageable and run the rules against that, so that a) if you ever get data in some other form you can also convert it to that same form and the rest still works, and b) you can test rules without having to create XML and XSLT.

Needless to say it broke constantly and was beyond impossible to maintain. That's what happens when you design something stupid and your plan to avoid failure is not making errors when you maintain a giant text file by hand.

I solved part of the problem by storing the rules in a database, writing code to convert the data to XSLT, and not telling her.