2 ms·
Heh, just today I made this https://gist.github.com/jstimpfle/a4f2661f8d042d9862b9fecdd85a7c93 https://gist.github.com/jstimpfle/a4f2661f8d042d9862b9fecdd8... a
by jstimpfle 10y ago
Heh, just today I made this https://gist.github.com/jstimpfle/a4f2661f8d042d9862b9fecdd85a7c93 https://gist.github.com/jstimpfle/a4f2661f8d042d9862b9fecdd8... as a poor-man's PHP. It looks for made-up tags and calls with the tag attributes as arguments, to make text substitutions (no, not a very innovative idea).
I used a cheap regex to look for these tags instead of parsing the DOM properly to avoid unnecessary allocations and parsing overhead. So after reading the article, I guess I'm still in the 90s!
> TreeWriter::AppendChild(parent, child);
That's soo the right approach. OO must die. And the argument why method calls are (typically) wrong already on a syntactic level can be found in the article.