mdlawson / piping

Keep your code piping hot! Live code reloading without additional binaries
MIT License
219 stars 13 forks source link

avoid extra indent proposal #2

Closed davidmarkclements closed 11 years ago

davidmarkclements commented 11 years ago

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):

if (!require("piping")()) { return; }
mdlawson commented 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
davidmarkclements commented 11 years ago

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 .

mdlawson commented 11 years ago

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.