2 ms·
Certainly there could be a better way, but HTML and CSS are what we have (and frankly they work pretty well considering that the web comprises mostly documents)
by dasil003 18y ago
Certainly there could be a better way, but HTML and CSS are what we have (and frankly they work pretty well considering that the web comprises mostly documents). Emitting HTML from a programming language can be useful, but it doesn't solve the fundamental inelegance of nested markup. Solutions like this are just indirecting the problem, adding another layer of complexity without a meaningful abstraction.
- abstractbill 18y ago...considering that the web comprises mostly documents... I found this interesting. I've been doing web stuff since 1996, and I would have agreed with you back then. But these days my perception is that the majority of stuff on the web should be considered to be applications rather than documents.
- dasil003 18y agoFair enough, though I would consider many many web apps to be document-oriented. It's a slippery definition to be sure.
- cosmo7 18y agoMy project, phpSprockets (http://code.google.com/p/phpsprockets/ http://code.google.com/p/phpsprockets/) does nested markup by working as a node system. After all, if you're going to generate HTML in code you might as well do it in an object oriented way. $table = new Sprocket( 'table' ); $tr = $table->tr(); $tr->td( "OMG I'm in a sprocket" ); I've done similar things using XElement in C#, though using PHP's magic methods makes for very short readable code. I agree that templates are handy for separation of concerns though.