|
|
|
|
|
by digibo
4265 days ago
|
|
I find constructs like isAwesome() && alert("yay"); confusing as well, but in our codebase it's pretty much standard to use a simple falsy check like 'callback && callback()' for optional callbacks, but we don't use it anywhere else. To be honest, I like and use some of those, especially when writing experimental/disposable code, but otherwise I try to be gentle to less experienced developers and my future self. As of #5 - I used to do and love this when writing unit tests. At the end of the work day, if I'm in the middle of implementing a feature, I'd commit and then write the next unit test (inevitably) sitting in my head and leave it failing. Really helps when it's Monday. |
|