Ranter
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
Comments
-
kleopi8735y... tbf even with quite a bit of experience, id write solution 0...maybe dragging out duplication
-
I guess I just see the problem differently.
If you zoom something, you need to have constraints on too small/too large. So you have a range.
If you have a range, a slider can help with that. -
I for real thought you were talking about Zoom; the application that is trying to replace webex lmao
-
Any chance you could share your insights with whomever wrote solution 0? I don't know the specific situation or dynamic, but I'm wondering if your feedback and tips could be put to use as a learning opportunity for them.
I don't understand how people can write code, but be completely inept at developing software.
Take a zoom feature:
SOLUTION 0:
- Use 2 buttons
- Use 2 button listeners
- Use 2 float variables (for each button).
- Don't log anything.
- Use 3 crazy, hardcoded, constant, int literals like 66, 30...
- both buttons manipulate the same text field.
- no logging.
- Both listeners use if/else to check if the variable is within a range -- one if/else for each listener.
- Use crazy method calls to get text size.
SOLUTION 1:
- Use a slider.
- Use a single listener.
- No variables needed.
- Use a linear equation for zooming.
- has logging.
rant
shitty ass code