Hacker News new | ask | show | jobs
by OneMoreGoogler 2446 days ago
I saw these during my 18 months at Google. They were never relevant to my work.

Working at Google you are bombarded with "nudges." The garbage cans have stop smoking signs. The plentiful candy is famously placed into jars to reduce consumption. There's signs telling you not to sit on the loo for too long. You'll get emails comparing your travel and server expenses to the average. All of this stuff is well-intentioned, but there's clearly part of the company seeking ways to manipulate its workforce.

3 comments

During my ~60 months inside Google, these nuggets sometimes proved to be useful, telling about a newly available tools (e.g screenshot diffing in UI tests), common pitfalls (like mixing up dates from different systems with and without timezone), common best practices (don't use `now()` in test, instead, imitate the flow of time using...). These are just off the top of my head after several years outside Google.

Nothing mind-blowing or earth-shattering. A number of useful things to learn at these 30-60 seconds when you can't read anything more interesting, though.

I agree, it's between useful and harmless.

But who considered someone taking a piss and thought "that time could be better utilized?"

I think this is a great way to spread info. You're there, probably doing nothing. And everyone has to pee!
Could you expand more on not using now()
Using the real-time clock makes your test impossible to reproduce. Using a mock clock leads to reproducible tests. Same with calls to PRNGs: these should be injected so your test failures can be reproduced.
Your now() in tests depends on current moment.

You cannot test how your code behaves when midnight passes, when daylight saving time changes either way, when it's 29th of February, etc.

More importantly, you cannot reliably (let alone quickly) test how your retry and timeout handling works, especially if two threads interact, or when you do (stubbed or mocked) remote API calls. All these things are the daily bread when working with Google's services, and basically at any setup with multiple (micro)services.

The first time I implemented an "IDateTimeService" in one of our applications, I was greeted with disbelief by my colleagues. Once I challenged them in running tests for certain edge cases, their mind shifted from "well, we cannot test that then" to "makes totally sense".
Another one is hiding the unhealthy drinks (e.g. soda) behind frosted glass in the fridge, so you can't see it. Kind of silly, in my opinion. Googlers are presumably adults, and can make their own decisions on what to consume.
Retail stores put high-margin items in key locations (next to checkout, at eye level, etc.) or companies actually pay for these spots. In a company kitchen/snack area, why not put the healthy options there? Everyone still makes their own decisions, just like anywhere else. Isn't this optimization more in the employees' interest than putting the cheapest items there (e.g. soda)?

(I'm at Google. I think these kinds of nudges are mostly good. Though it's certainly something to joke about.)

Yes! I noticed this at Google NYC when I interviewed there a few years ago.

Healthy (and tasty) fruit infused water was placed front and center. Sodas were hanging out in the fridges in a rather less convenient location.

Yes, we must free ourselves from the oppression of writing unit tests and having a tool auto-indent our code! How brave to take such a noble stand on this controversial issue!
We must also throw off the shackles of our near-perfect source code revision management system, so we can gloriously adopt the incredibly slow and notoriously unusable industry standard!
Example: my whole building was working in the android repo, but the ToT article would be about some tool for google3 (web) development.