Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> The whole point of this feature is to be terse...

I get that. I don't think you understood my objection, which was that being terse is not as important to me as being elegant and easily understood. {{foo -}} is not clear looking at it what that - is gonna do. You have to already know, or look it up. There is basically no way to know from context what the desired behavior is. That's bad design IMHO.



How much programming language syntax is really intuitive, as compared to what you've grown familiar with over time?

Once you use the Go(/Jinja/Perl) syntax once or twice, then putting a minus sign to remove whitespace will be easily understood.

I am interested in an alternative that you find more elegant.


> I am interested in an alternative that you find more elegant.

Why not make it a filter/pipeline (I haven't used template/text in ages, does it support this?), like in Django {{ thing|trimleft }}.


{{ foo -}} does not strip white space from the output of foo. It eats up the following white space.

So "{{ foo -}} bar" renders the same as "{{ foo }}bar".




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: