this post was submitted on 17 Feb 2024
1 points (100.0% liked)

Programming

17526 readers
614 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
top 4 comments
sorted by: hot top controversial new old
[–] zartcosgrove@beehaw.org -1 points 9 months ago

This seems wrong to me. Existing paradigms like try catch or returning result codes enable handling these situations gracefully and in an informed manner. Making an inert api as is suggested here means that now you have an api that doesn’t behave as expected but without an explanation why.

“The app was probably only tested against a PC so an exception would be unhandled” means that they did not implement it well against a PC. There are a bunch of possible reasons you’d get an exception while adding a printer on a PC, and I can’t imagine that the correct behavior would be to crash whatever it is you’re doing.

[–] Kuinox@lemmy.world -1 points 9 months ago (1 children)

This is exactly what the browsers have been doing for decades and why the developer experience with html/css is infuriating.

[–] abbadon420@lemm.ee 1 points 9 months ago

It seems like a decent approach when you're working with an existing tech stack and not some shiny new technology that has every sorted appropriately. At first I was like "just return an empty list of printers and let the user think there might be printers? Are you mad?" But than I was like "Well, that's what I would do in an API as well"

[–] brisk@aussie.zone -1 points 9 months ago

I've seen far too manny error messages claiming I did something I most certainly didn't do. This seems like a good way to make those far more prolific.