News for hackers. Stuff that matters.
Re:Ropes, an Alternative to Strings [pdf] (1995) by chubot on Sunday November 01, 2020 @12:56PM (#24961177)
Yeah it's a moot point either way, because ERB is like that... but

- This wasn't an optimization, it was literally the first thing I thought of when I wrote my first and only template engine 10 years ago. And I have seen plenty of others do it; it is "obvious".

The code is the exact same length as the string version, so I don't consider it an optimization.

- Python's WSGI accepts an iterable of strings for the body. From a cursory reading, looks like Ruby's rack does too:

https://en.wikipedia.org/wiki/Rack_(web_server_interface)#Ex...

e.g. it's ["Hello, World"] and not "Hello, World" (I don't know Ruby that well though)

Maybe frameworks mess it up in the middle...

There are no comments on this comment yet.