3 ms·
haha I've grown to prefer it, sort of like regular conditionals vs postfix conditionals, you set up the expectation first: if (user.isAuthenticated) doSomethin
by tjholowaychuk 13y ago
haha I've grown to prefer it, sort of like regular conditionals vs postfix conditionals, you set up the expectation first:
if (user.isAuthenticated) doSomething()
vs
doSomething() if (user.isAuthenticated)
the first is less readable perhaps but I think it's more useful for a programmer. To each their own! Maybe some day I'll be convinced otherwise, I like it better for asserts too:
assert(200 = res.statusCode)
assert('application/json' == res.headers['content-type'])
assert(res.headers['content-type'] == 'application/json')
looks weird to me now but maybe I'm just used to it