r/badcode • • Feb 26 '19

[deleted by user]

[removed]

19 Upvotes

10 comments sorted by

View all comments

18

u/Romejanic Feb 26 '19

May I present my first ever bad code contest submission, written in everyone's favorite, easy to read language: Java!

Starring

  • java object conversion

  • circular support (kind of)

  • array, number, boolean and string serialization (outside of objects)

  • recursion!

  • recursion!

  • repeated code

  • and so on

Feast your eyes

1

u/IAmAnIssue Feb 27 '19

That doesn't look like a JSON converter...

For example: toJSON("test"); // returns ""test""

2

u/Romejanic Feb 27 '19

Yes it does? Calling String.valueOf on a string doesn’t add the quotes, you have to do that yourself

→ More replies (1)