Hacker News new | past | comments | ask | show | jobs | submit login

Every web framework uses some sort of template engine. You're going to need to know the way it works and what syntax it uses and any gotchas that are there.

Also, the logic is going to bleed over into the HTML anyway. Why burden yourself with ugly line noise?

    renderContentOn: html
        50 timesRepeat: 
            [ html div 
                class: #SomeStyle; 
                onClick: (html element hide);
                with: 'Who needs HTML?' ]
vs.

    <% for x in range(50) %>
        <div class="SomeStyle"
             onclick="javascript:hide(this);">
            Who needs HTML?
        </div>
    <% endfor %>
In the above example, I'm mixing the JavaScript with the HTML and I also see Python code (the last template engines I've used were Python-based). Three languages mixed into one template.

The Seaside/Smalltalk example, on the other hand, has one language with code that generates another language (which I don't have to touch at all, it knows how to generate a valid DIV element). So I just have to analyze the logic of the Smalltalk code and not the HTML or JavaScript unless there is a specific reason for me to do so (such as adding a new type of HTML element).




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

Search: