Developer Hacks Together Object-Oriented HTML (github.com)
An anonymous reader writes: Ever since I started coding, I have always loved object-oriented design patterns. I built an HTML preprocessor that adds inheritance, polymorphism, and public methods to this venerable language. It offers more freedom than a templating engine and has a wider variety of use cases. Pull requests appreciated!
Another genius, building his own framework, just what the world needs.
John McAfee 'It was like that time I hired that Bangkok prostitute; to do my taxes, while I fucked my accountant'
It's really, really CLASSLESS to post stories about your own projects. That said, it's a preprocessor, that's all. Not seeing how this is different from say, PHP?
This repo hasn't had a commit in 2 years, why is this interesting now?
I use the Pelican static website generator for my static websites. I got Python to massage the data and Jinja2 for the template engine. I see no need to us OOP on the backend. If I did, Python can do OOP.
It says:
Latest commit d79333a on Jul 22, 2015 @Michaelkielstra Michaelkielstra Commented.
That's 2 years ago, so I wouldn't call this news. Also, it's just a template engine, so it isn't new either.
I hope not. I'm still polishing my Python script for scraping Slashdot comment history. When I publish it on GitHub, I'll be submitting it to Slashdot. Anonymously, of course.
that describes the structure of a document. It is not a graphical design language, as most webdesigners think, or a programming language as most webdevelopers think. It is as much of either as LaTeX.
I'm suspicious of anyone who calls HTML 'venerable.' They should call it, "notorious" or "infamous," maybe, "expectorant." Marc Andreesen points out there are just problems with it, and I can't see OOP fixing things.
So, I looked at this guy's project, and it's better than I expected. The major problem it solves is: "how do you avoid repeating yourself, while still keeping things flexible?" The common approach right now is to either throw it into a CSS library (like Bootstrap) or write Javascript to produce the HTML. The latter idea there sounds like a joke but it's not.
In comparison, this lets you break things into components (like React does), but without any cost to the front end. Overall a good approach, but likely to get lost in the noise of a thousand other web frameworks.
"First they came for the slanderers and i said nothing."
The Github page doesn't give any examples that look like OO to me, which is A) not surprising, because what the hell would an OO markup language look like and B) very surprising, given that the whole DOM is OO from the ground up in modern rendering engines.
Anyway, on a tangent...
I see no real call for OO in web rendering, but the one thing I think is missing from HTML is the ability to parameterise things like column widths etc. Why cant I call column 1's width "x" and ask the renderer to make column 2's width "3x"? Or use these parameters across tables, so that the columns in table 1, table 2 and table 3 are all the same size?
I know this can be done with CSS, but in order to do that, I need to choose a particular size -- I can say "I don't care about the actual size, but these 3 things should all be as big as each other."
Got them moderator blues I blieve I walk out the do', With these mod-points I been gettin', I 'most never post no mo'
because it's a horrible mess
It wasn't a horrible mess. Developers made horrible messes with it. And browsers did try to make sense of imperfect xHTML. I don't know of one that wouldn't render something when it came across errors.
I still type HTML in somewhat valid xHTML, even when incorporating HTML5-specific tags - because the alternative just isn't readable.