DHH raised an interesting point on Rails-Core about PoLS:

http://www.ruby-forum.com/topic/99860#215804

Summarized: PoLS ... holds an assumption of universality that is  
rarely, if ever, present.

A better elaboration on this is on the Wikipedia article about Ruby  
(look in the philosophy section):

http://en.wikipedia.org/wiki/Ruby_programming_language

The key question under discussion is that what's unsurprising for me  
might be surprising for you and vice-versa. Or, to quote Matz,  
"principle of least surprise is not for you only."

In major part, I'm playing devil's advocate because this same  
discussion has been had several times and once Nathan or Hampton said  
use preserve or ~ everyone said, "now I see."

I don't mean to single you out, Irfy, this just happened to be where  
I jumped in to this thread. It's the concept that Haml's behavior  
should be like HTML's that I feel needs better examination. If you  
feel it is unsurprising for Haml to act like HTML in most cases, then  
I'm not sure you're really accomplishing much that your couldn't with  
rhtml.

It is surprising -- even jarring -- to use a whitespace-meaningful  
grammar when most parsing is whitespace-insensitive, yet all of us  
who have been using Haml do that without question (right?). We,  
therefore, have to ask: Are all our Surprise-O-Meters calibrated the  
same?

Just a few thoughts. And, for the record, I'm in favor of using ~ or  
preserve.

On May 5, 2007, at 5:06 PM, Irfan Adilovic wrote:

>
> I'm not really active in the group, but I follow every thread
> line-by-line, as I'm planning to use haml in the nearest future. So I
> felt compelled to give my two cents here, in favor of PoLS (and
> Nathan/Jeff):
>
> Where space normally matters, it should be preserved. Where not,  
> who cares.
>
> I think it's as simple as that. For all those specific cases requiring
> the space to be absent when it normally doesn't matter - there we
> could still use ~.
>
> So the two concepts could co-exist, mostly everything would work as
> expected - so there would (should...) be no problem.
>
> Ruby on Rails is *great* in taking various responsibilities and the
> need "to know details" away from the programmer, this little detail
> about space preservation would be against this principle, imho.
>
> -- Irfy
>
> 2007/5/5, Jeffrey Hardy <[EMAIL PROTECTED]>:
>>
>> I tend to agree with you about PoLS, Nathan. I'm always forgetting to
>> use the ~. I'd like to see it happen automatically, personally.
>>
>> Though, Hampton and I rarely agree ;-)
>>
>> /Jeff
>>
>>
>> On 5-May-07, at 4:44 PM, Nathan Weizenbaum wrote:
>>
>>>
>>> It seems to me like an issue of principle of least surprise. We  
>>> get a
>>> lot of questions like "How do I preserve whitespace?" or more
>>> tellingly
>>> "My whitespace isn't being preserved!" People aren't discovering  
>>> ~ on
>>> their own - they're expecting it to Just Work. Which is what it
>>> should do.
>>>
>>> Ideally, you shouldn't have to remember anything at all. It should /
>>> all/
>>> Just Work. This may not be feasible, but we should work towards  
>>> it as
>>> much as possible.
>>>
>>> - Nathan
>>>
>>> Hampton wrote:
>>>> Eh, I like it the way it is.
>>>>
>>>> Its a momentary 'gotya' but you quickly get over it and the  
>>>> solution
>>>> is efficient and easy to implement. Its an extra thing to learn,
>>>> but I
>>>> don't really mind that. I think it's just the nature of the  
>>>> problem.
>>>> I'd rather think I always have to ~ if I want to preserve  
>>>> whitespace
>>>> than to have to remember what is preserved in this version.
>>>>
>>>> -hampton.
>>>>
>>>
>>>>
>>
>>
>>>
>>
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to