|
|
|
|
|
by fedlarm
4265 days ago
|
|
One I've never thought of using before is the:
isAwesome && alert("yay"); I have used the name || "no name" operator a lot and thought to myself that it looked cool on first impression. But having something like:
isAwesome() && alert("yay");
Already makes it harder to read I think. I'm curious to what others think of this one? Maybe its just because it is new to me.. |
|
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.