4
Jifuna
62d

Guess who’s back after a few months. I was so frustrated because of something at work today that I needed to vent.

So currently we are working together with a frontend company, we make the api, they do the frontend.

I got a few feedback points, one of the things was that they asked if the dates could be formatted in our language. I said no that’s not really recommend because the api should only handle data not translations or date formatting.

They responded with that it was because of speed... Date formatting is literally a few fucking milliseconds. Technically it is even slower serverside because the fact that I need to process it in a serverless function which is probably less powerful than the average client machine.

Fucking lazy fucks.

Comments
  • 3
    I'm a DevOps engineer, and I know that point. Frontends handle date manipulation. Bad things happen to people who break that rule.
  • 0
    @devphobe That a threat? Because if it is, I'll help you fuck them up.
  • 3
    @TheCommoner282 hahaha! I'm still recovering from the last app I supported with "time zone issues". Hours and hours of meetings all deciding that we fucked up not using GMT in the backend and letting the FE do the work.
  • 2
    @Jifuna ..One fucking line of code in the frontend to get the local date formatting, dozens of classes to get the same thing from a backend. Stupid!
  • 3
    @devphobe I feel you. Mean it's supposed to be obvious.

    Who knows where the client is? The client or the server? Who knows which date formating the user prefers? The client or the server?

    And the kicker: If you don't treat it as strings, because you have to do some date math or comparison, the library translates it to an offset in milliseconds anyway. So, the client still has the work.
  • 2
    Just send them unix timestamp and link to momentjs. FFS, frontend is more than CSS!
  • 0
    @devJs I thought of doing that but my boss was like now we can send them another invoice because of this change so quess who’s gonna implement it today?
  • 1
    @Jifuna sorry to hear that! I'm on FE side of things and prefer to get timestamps from back, it solves so many potential issues. Just recomending to make this impementation easily reversible as they probably will get to the stage when they will say something like: 'we have issues now, can you make it like it was before?'
  • 0
    @devJs Yeah, you’re right. I was already thinking of adding an optional dateType parameter. Especially because this api call wil probably be used by our own microservices too.
  • 1
    @Jifuna Eeeey welcome back man!
  • 1
    @linuxxx Thanks man! I was suprised you were still on here
Add Comment