Tag Archives: javascript

Service workers, code smells and hiring

  • Service workers – an Introduction – learnt about service workers .
    • You can think of service worker as a static web-app(js and css) that gets cached and ‘registered’ to your web-app url in the web browser. You can register a service worker for a whole domain (like www.example.com) or for a specific path (like www.example.com/example). Think of them as offline code that is stored in the browser.
    • As they are ‘registered’ to your web-app url, they can act like a network proxy for calls from/to your web-app url domain – i.e they can see the request you send to your server and the response the browser receives and can manipulate them both.
    • Because of #2, you need https to register a service worker.
    • They use javascript web workers underneath- so, they can do multi-threading stuff within your browser.
    • If you think “they are cached in the browser so I can use them to store global state” – don’t.
  • A Method I’ve Used to Eliminate Bad Tech Hires – Overall, I agree with the idea of giving the candidate a take-home test , then bringing the candidate on site to discuss the solution and paying the candidate for her/his effort. However, I highly doubt if such an approach will fly in big companies (that are comfortably set in their old ways). Additionally, this approach is also biased against people who are on H1B visa like me – we can not take on such contract work since it is a violation of our visa status. Perhaps, a gift card instead?
  • 8 ways to become a better coder – a simple and straight-forward article on eight things you can do to become a better programmer. My favorite quote was

 “The code works” isn’t where you stop; it’s where you start.


Part of that process is defining what “better” means. Is it valuable to make it faster? Easier to document? More reusable? More reliable? The answer varies with each application, but the process doesn’t.

It might sound obvious, but I have met many who think that’s about it. I liked how the article kept what ‘better’ means as open-ended.

  • Code smells – A good list of code smells to watch out for. Something to share and discuss with your team.