25

I inherited some Java code from a guy that thought you could only return strings from a method.

So how did he ever pass anything other than a string, I hear you ask? He had a (hand crafted, using no libraries, and not escaping anything properly) toXml() and fromXml() method on each object.

Yeah...

Comments
  • 5
    Wow. That's.... Wow
  • 3
    How did he never read the language tutorials and see stuff like int addTwo(int)
  • 9
    How can someone be SO FUCKING retarded to NEVER try to change the fucking return type to something else and see if it works instead of writing a XML parser?
  • 2
    @tokumei @hell Yup, these thoughts, and others, have all gone through my head about this guys code...
  • 1
    Inherited a project which used to transform objects as XML, internally. Two times. Once with SAX, then with XStream.

    It was like that because those were two separate applications, then merged into one, by including the jar. My first successful refactoring was cleaning this mess. Just no one wanted to code a mapper for those objects. Doing it I gained TONS of experience. I appreciate it.
  • 2
    Wouldn't fromXml() return an object?
  • 1
    I don't suppose you could publish that code? There's a few people I'd like to show it to
  • 1
    For that guy, everything in java is either string or xml 😂
  • 1
    Was he originally a Tcl/tk developer? Just curious if the hurp durp was contracted elsewhere.
  • 2
    @sSam Good point - I think it must have been a constructor rather than a fromXml() method, now you mention it. This was some time ago, I'm fortunate enough to have forgotten the specifics...
  • 0
    @M3m35terJ05h I'm long gone from there I'm afraid, and I wouldn't have been able to anyway (commercial property and all that.)
  • 1
    @tamusjroyce I've no idea. That would make sense, since I've never seen anyone else come close to doing that...
  • 1
    @AlmondSauce ok, if it was a method returning an object and he was still returning strings elsewhere it's even worse (surprisingly possible).
  • 1
    Fake af. Nobody could be that... I dunno, I don't Think that beginner me could even write a xml parser
  • 0
    @AI-Overlord Believe me, I wish it was fake.
Add Comment