Closed davidmarkclements closed 11 years ago
Absolutely no reasons not to do that, and in some ways its a much nicer solution that I'm not sure why I overlooked. Thanks for the suggestion, I'll add it alongside the current examples in the readme soon. Dropping the block makes it look even neater
if (!require("piping")()) return
and the coffeescript version is nice as well
if not require("piping")() then return
Aye :)
Drop the {} if you want, just know that it won't lint against the standard jslint setup - that may be important to some ppl.
Sent from my iPhone
On 16 Mar 2013, at 21:53, Michael Lawson notifications@github.com wrote:
Absolutely no reasons not to do that, and in some ways its a much nicer solution that I'm not sure why I overlooked. Thanks for the suggestion, I'll add it alongside the current examples in the readme soon. Dropping the block makes it look even neater
if (!require("piping")()) return
and the coffeescript version is nice as well
if not require("piping")() then return
— Reply to this email directly or view it on GitHubhttps://github.com/mdlawson/piping/issues/2#issuecomment-15012894 .
True... Fails the default jshint as well. Personally I'm fine with omitting the block on a single statement condition, and I'm a coffee script guy anyway, but I better keep to at least jshint's conventions. Thanks for the heads up.
hey just a quick thought,
Instead of wrapping code, and causing an extra indent in an already indent attracting language, would this work (placed at top of code):