13

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.

Comments
  • 2
    Also, it looks like devRant scaled that image down, sorry.
  • 17
    @ManBunMike Could you implement a zoom feature for it ? :)
  • 1
    @alexbrooklyn that made me lol.
  • 3
    ... tbf even with quite a bit of experience, id write solution 0...maybe dragging out duplication
  • 0
    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.
  • 0
    I for real thought you were talking about Zoom; the application that is trying to replace webex lmao
  • 1
    Symptom of coding without planning first.
  • 1
    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.
Add Comment