Friday, 18 September 2020

Day's until Xmas

Last night there was a question on Jay's Virtual Pub Quiz asking how many days there were until Xmas. I worked something up years ago but decided to revisit it today while waiting for Visual Studio to build my solution, this is the result:

const days2Xmas = Math.ceil(
  (
    new Date(
      new Date().getMonth() == 11 && new Date().getDate() > 25 ?
      new Date().getFullYear() + 1 :
      new Date().getFullYear(),
      11,
      25
    )
    .getTime() -
    new Date().getTime()
  ) /
  (1000 * 60 * 60 * 24)
)
console.log(days2Xmas)

Tuesday, 15 September 2020

Frontend vs backend developers (well, not really)

@backend1: @frontend1, @frontend2 - a bug here
@frontend1: @backend1 OMW
@frontend2: @backend1 Sure thing. @frontend1, let me know if you need a hand.

...

@frontend2: Not sure if this is a frontend or backend issue
@backend2: Frontend! Set the flux capacitor to true

...

@frontend2: Flux capacitor set to true, will look some more
@backend2: Are you sure?
@frontend2: @backend2, yep, just double-checked, shall I call you and show you what's happening?
@backend2: Sure

...

@backend2: @frontend2 backend issue.

Frontend and backend (or, for that matter, fullstack) developers are a funny lot, collectively. They're funny individually as well, but communication between them can be hilarious. I work with a brilliant team, and I've noticed a specific trend when it comes to the allocation of bugs to fix. I'm working with a backend technology I'm not overly familiar with, so I know I can be a pain when it comes to making requests or asking questions. I also acknowledge, wholeheartedly, that I'm guilty of making prototypes for the frontend with absolutely no regard to the information I'm likely to receive from the server - but I live in hope.

I have, however, noticed a specific trend with bugs that fall in the grey area between the responsibilities. Or those bugs where the cause is unclear. Generally speaking, it's obvious, but now and again much less so.

When a bug is a frontend issue, we (my fellow frontend developer and I) rush to take the issue and solve it just as soon as we can. Any delay is incurred only as a result of testing the solution in Chrome, Firefox, Edge and IE11. We make the PR and move along, avidly waiting for the next thing to fix, all the while searching for issues ourselves.

It's those grey area bugs that cause issues though. I'll take a look at something, clock that it's wrong and investigate. We're using Vue, so I'll open up the Developer Tools and check what we're sending back to the server using the Vue.js devtools and think about what I'm expecting back. If it's wrong, I'll tentatively suggest that the backend developers take a look and check to see if it's the responsibility of the frontend or backend developers to fix. The majority of the time the response will be that it's a frontend issue so I'll take another, more exhaustive, look and document the process. I'll perhaps prepare screenshots and videos to illustrate the process to go along with the documentation. Only then will I ask my teammates to check again and see if it's the responsibility of the frontend or backend developers to fix the bug. 9 out of 10 times I'll be right, and it will probably be a simple matter for them to fix. It's good for me to investigate though, I gain a far greater understanding of the working methods of my fellow developers, but it would be nice to be trusted now and again.

I wrote this the previous weekend, today I clocked that I'd argued with a backend developer over a very similar issue, which was eventually discovered to be a frontend issue!

Doh! I've also just clocked this is my 500th post!