123

"Coding is solving puzzles".

I think everyone has heard that platitude. But it's not exactly right.

So I grew up in a very poor environment, a moldy building full of jobless addicts.

And in my town there was this shop where super poor parents could take their kids to borrow free toys and stuff.

So as a kid I remember being frustrated by these second hand jigsaw puzzles, because there were always a few pieces which had been teared up or chewed on, or were even completely missing.

That is what development is.

You pull in this seemingly awesome composer package, and that one super useful method is declared private, so you need to fork the whole thing.

Your coworker has built this great microservice in python, but instead of returning 404 not found, it returns 200 with json key/value saying "error": "not found".

There's a shitload of nicely designed templates for the company website, but half of them have container divs inside the components, the other half expect to be wrapped in container divs when included.

You're solving puzzles, but your peers are all brainless jigsaw-piece-chewers. They tried to mend a problem, but half way through got distracted, hungry and angry, started drooling over the task and used a hammer to fit in the remaining stuff.

Comments
  • 10
    That's one way of looking at it... Interesting
  • 3
    But... but... I hate puzzles 😨😨
    I find em boring 😭😭
  • 5
    Wonderful analogy, and sadly true.
  • 3
    That's my problem having to cleanup after monkeys after their shitty code make it into production...
  • 2
    The part related to sending an error message with a 200 status is so true!

    My previous organization's CTO once justified it by saying that some web clients do not handle response status codes, (which might be true) and we must explicitly define the error status code and message in the response body. (which sounds fair)

    But it should not be an excuse for making life difficult for web clients that do handle response status codes.
  • 2
    @the20ofPareto I rather doubt any such client exists. Status codes are part of the standard; thus, all http clients should handle them. If they don't... well what about Google, etc. using status codes?

    Your CTO is being very dumb.
  • 4
    @Root @the20ofPareto

    You can always send a body together with the status code. There's no shame in sending back a HTTP 422 together with a response body like: { status: 422, message: "validation failed", information: "nipplelicker is not a valid username" }

    The client (browser, or another server) can choose to just pay notice to the HTTP status code, or also check the response body.

    Returning 200 with an error code is like replying to "Do you want a cup of tea" with "Thanks I'm not thirsty" while nodding your head vigorously and giving a thumbs up.
  • 1
    @Root he was being dumb, or either too lazy to fix all the response handlers in the project's code. :D
  • 2
  • 2
    @bittersweet Beautiful! That's why I'm being subscribed to you. :D
  • 1
    "programming is to be puzzled"
Add Comment