From: Seebs Date: 2009-12-14T08:30:19+09:00 Subject: Re: Poll: Significant Indentation On 2009-12-13, David Masover wrote: > What is your favorite Ruby template language for generating HTML? I've been using erb since that's what's handy in rails. > Which editor do you use to edit HTML templates? vi > Which editor do you use to edit Ruby source? vi > If Ruby had optional significant whitespace as a core language feature (maybe > like http://gist.github.com/117694), would you use it: > - Never? > - Sometimes? > - All the time? > - Don't care? > - Only with different syntax (lazibi, colon, something else?) Never, ever, ever, ever, ever. I would weep for the horror of knowing that people would send me code which was broken that way. > If your favorite template language is Haml, would you prefer Erector if Ruby > had significant whitespace? > (yes/no/NA) NA. > If you actually dislike Haml, is it because of the significant whitespace? > (yes/no/NA) Pretty much. > Have you done any significant development in Python? > (yes/no) No. I did a little bit, and quit because I couldn't get past the horror of significant whitespace. It turns out to be surprisingly error-prone. I'd rather have actual tokens drive indentation (through tools like indent/cb) than have spaces break things. If there are tokens for, e.g., blocks, or beginning and end of grouping, it's reliably possible to figure out what's happening and to modify the indenting to fit. If you go the other way, you are totally, completely, screwed if anything goes wrong -- there's neither information to let you determine what was intended, nor a way to detect that something else was intended. -s -- Copyright 2009, all wrongs reversed. Peter Seebach / usenet-nospam@seebs.net http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!