3 ms·
> p.raw(u'Hello, %s!' % thing) yeah I'm not so sure I want to subject myself to Python string substitution for templates. Seems like I would make more mistakes
by metamemetics 16y ago
> p.raw(u'Hello, %s!' % thing)
yeah I'm not so sure I want to subject myself to Python string substitution for templates. Seems like I would make more mistakes and designers wouldn't be able to debug it.
<title>{{name}} | {{section}} | {{page}}</title>
vs
p(html.title('%s | %s | %s' % (name, section, page)))
If I was going to obfuscate the way I write HTML I would use http://shpaml.webfactional.com/ http://shpaml.webfactional.com/ but I don't mind HTML as long as I have a good editor like Eclipse.
- ljlolel 16y agoGood point, would you prefer p.raw(u'Hello, ' + thing) and p(html.title(name + ' | ' + section + ' | ' + page))) or better yet (remember that these are all strings funcs) p(html.title(pipe_separate(name, section, page)))
- metamemetics 16y agonone! The semantic HTML and template logic are both in python and thus look too similar in all of them. You want the HTML in the template to look like HTML and visually distinct from the template logic so you or other designers working on the project can style these semantic structures easily with stylesheets. Writing HTML with an IDE like eclipse that autotypes the closing of an element and autovalidates if elements are closed is easy enough, and there's no string-joining nonsense.