Article 6HYKY CodeSOD: Get Results as What?

CodeSOD: Get Results as What?

by
Remy Porter
from The Daily WTF on (#6HYKY)

Before RESTful web services and JSON as a serialization format, XML was going to conquer the world. Circa 2001, I remember going to user's groups only to hear about how XML was going to allow legacy mainframes to be connected to modern applications (without discussing the fact that the legacy mainframe still needed maintenance and code support). These days, XML is (nearly) dead, and lighter-weight markup languages have replaced it, including JSON.

Which brings us to this method, from Chris:

public string GetResultsAsJSON(){return base.XmlResultText;}

This does, in fact, return a JSON string.

It's a delightful mix of stringly typed data (XML and JSON, I think we can agree, are different types), legacy code not being fully modernized, and fields being re-used. The exact kind of code you see in a codebase you inherit, you groan and grumble about, and then you pinch your nose and get back to work, because you know there are things that are much more urgent than fixing this.

proget-icon.png [Advertisement] Keep the plebs out of prod. Restrict NuGet feed privileges with ProGet. Learn more.
External Content
Source RSS or Atom Feed
Feed Location http://syndication.thedailywtf.com/TheDailyWtf
Feed Title The Daily WTF
Feed Link http://thedailywtf.com/
Reply 0 comments