r/badcode • • Jun 09 '20

c++ EA published their Command&Conquer Code on github. This is my favorite part so far.

Post image
1.6k Upvotes

36 comments sorted by

View all comments

27

u/[deleted] Jun 09 '20

That looks quite normal, and yes, it's the constructor field. Ok, there are some ways to make it smaller - like element(element) - but it's far from bad code.

-30

u/Achereto Jun 09 '20

Yes, the code doesn't do anything horrible. It's also perfectly okay, that the constructor does nothing but initialization of fields. But that's not the point. ;-)

10

u/[deleted] Jun 09 '20

If it's perfectly okay, it doesn't belong here

-12

u/Achereto Jun 09 '20

There are different ways code can be bad. Once is horrible behaviour, another is bad maintainability. This is about the latter.