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

> But that it has suggests that people see string templating as having real advantages over their alternatives and those advantages keep being compelling

I wholeheartedly disagree. Occam's razor:

Doing it the right way takes knowledge that string substitution is wrong. Many people don't have that.

Also, it's hard(er) than the simple string solution. It takes knowledge of dom APIs, or frameworks, or other things that a fresh grad wouldn't intuitively create in 5 seconds to insert a value.



We stop teaching EDSL design, we disparage EDSLs as unreadable and opaque in favour of “just” using the host language, we use host languages that are at best awkward at EDSLs, then when “many people” encounter a problem that calls for an EDSL it turns out they don’t have the knowledge to recognize it as such.

Seems fair.


It can be argued that constricting HTML using string manipulation is the right way, because HTML is defined in terms of strings. Alternatively, HTML standart leaves generation as an exercise to the reader.


Every output can be said to be "defined in terms of strings"

Get real, the whole point is some strings in HTML are HTML, and some are malicious code.

You're being adversarial to equate the two.


I am not making a point about "HTML uses strings", but calling out the lack of separation between encoding and logical structure in the standart. Just for example, and sorry for mentioning it, but ASN.1 with its encoding rules provides terminology and a way to talk about encoding and semantics, so library writers do not have to reinvent it. Or, say, you want to generate some C++ code — what options except string templates do you even have? Standart does not help you to understand how to represent and encode senantics of a c++ source.




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

Search: