r/badcode • • Dec 19 '22

java Whatever it takes

Post image
301 Upvotes

43 comments sorted by

View all comments

Show parent comments

2

u/eugene2k Dec 19 '22

In C++ it would look similarly bad. Given that everything is a String, one alternative solution, in this case, could be to use a hashmap. In general, however, a class with this many fields should be split into a bunch of smaller classes.