Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Related Rants
So we had a class that should have 2 states 0 or 1, you think my coworker would be smart enough to represent it with a Boolean? NO!
Represent the state inside the object as an int then when using the object in a function creates a Boolean that determines the state of the object and after the function done it's job THEN call another function that takes the object and the Boolean and change the int state inside the object depending on the Boolean.
Wouldn't it have been whole lot easier to just you know..... Make the state a Boolean from the start.
When I saw this I knew I was witnessing a miracle of the human mind. God bless!
Ps: it wasn't connected to any kind of API nor server and there are never more than 2 states. It's just some local sequential code so don't assume it had a logical reason it's just a fuck up.
rant
boolean logic
logic
clean code
wk99