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.
But but I thought we were working to build a classless society! For Great SocJus!
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."
No, just no.
We need this as much as we need Flash, Silverlight, Quicktime, RealPlayer, WinZIP, and systemd.
Please make it stop!
No, do not want!
pretty old news, latest commit is 2 years old
Scraping Slashdot is both child's play and not worth it. You're one of the only people here that actually posts under a name that is traceable to a real person. All the accounts here are just AC with Karma.
Html sucks and I don't think this is the answer. What's really needed is something which completely hides the mess of html+css like a compiler hides binary which you never actually look at. Then make your website in python or something (and I don't mean with templates like django).
Scraping Slashdot is both child's play and not worth it.
I found it quite useful. For example, someone said I wrote "dead wood" in a past comment. With my 8,000+ comment history in a CSV file, I ran a search for "dead wood" in Excel and a few seconds later found nothing.
You're one of the only people here that actually posts under a name that is traceable to a real person.
One of the advantages of having a named account.
All the accounts here are just AC with Karma.
I've never been able to tell one asshat from another asshat.
Noooo... please, no.
(facepalm)
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'
Frontend developers spend about 1/1000th of their time writing html (or they are doing it wrong). Why bother with this?
We already have enough features.
How or why do you put entire text comments into a *CSV* file? Are you a retard?
Made in Java? Born dead, hahahaha!
Spare us, there are various JS packages that allow you to attach objects and methods to HTML tags.
Custom electronics and digital signage for your business: www.evcircuits.com
He's scraping Slashdot to help him debate people on his post history...so at the very least, clinically insane.
Comment separated values, of course. Now who is the retard?
How or why do you put entire text comments into a *CSV* file?
I can import the CSV file into Excel for data analysis. I haven't written the functions to store the comments in HTML, JSON or Markdown files.
Are you a retard?
Don't work with big data?
Really? I think you strongly underestimate the data and metadata available on the net. Pseduo-anonymous accounts, sure, but for people like me that uses a nickname/tag/handle (whatever) on many sites it normally isn't too hard to link a user name to a "real" name.
He's scraping Slashdot to help him debate people on his post history...so at the very least, clinically insane.
That's one purpose. I've wrote quite a few stories on Slashdot over the years, most I remembered and some I have forgotten. I plan to write a series of essays on my misadventures in Silicon Valley.
No, it's not, b/c the submitter acknowledged he was promoting his own work. It would be classless if he tried to hide the connection by saying "I found this neat project on Github..."
Not seeing how this is different from say, PHP?
Maybe this won't suck. :-)
It must have been something you assimilated. . . .
2.0?
by TheSpoom (715771) Uncaring Linux user here. I have nothing to add to this but please continue. *munches popcorn*
I think you strongly underestimate the data and metadata available on the net.
Here's the metadata for my comment history:
as in, pull my finger?
You need to get out more precious.
You need to get out more precious.
My comment history goes back to 2008. Not sure what happened to the comments from 1999 to 2007.
Be sure to include a chapter on how you went to community college. That's the sort of unique experience that most of the rest of us here have never experienced, since we went to a real college (or university, for those Brits among us).
So your CSV 'database' is woefully incomplete, with it missing almost a decade of comments. Yet in another comment here today you wrote, 'I ran a search for "dead wood" in Excel and a few seconds later found nothing.' Has it occurred to you that the comment you say you can't find might exist within the years you do not have data for?
How many women have you made love to during that same period of time? Please break it down by real women, women you've just fantasized about, women who had penises, and crevices within upholstered furniture.
Self-submitting your two year stale project? Michael Kielstra, you're an ass.
You have javadocs on many of your functions, thank you. You didn't program defensively. There are potential bugs all over the place. For example, what if someone had a malformed command line arguments? Your program will crash. There's no error checking to handle things like that. When you program defensively, you often end up writing more error handling code than 'real' code, but your program is as stable as a skyscraper foundation and you can have trust and pride in the quality of your work.
So your CSV 'database' is woefully incomplete, with it missing almost a decade of comments.
My "database" is incomplete because Slashdot no longer has my earlier comments. Some kind of housekeeping or accident may have deleted my earlier comments.
Yet in another comment here today you wrote, 'I ran a search for "dead wood" in Excel and a few seconds later found nothing.' Has it occurred to you that the comment you say you can't find might exist within the years you do not have data for?
That was in reference to earlier discussion that took place in recent months. The words "dead wood" or "deadwood" aren't words that I normally use, especially in reference to my government IT job.
Is it 1994?
Be sure to include a chapter on how you went to community college. That's the sort of unique experience that most of the rest of us here have never experienced, since we went to a real college (or university, for those Brits among us).
That might be a separate book unto itself. I spent eight years in Special Ed classes, skipped high school, went to community college for four years (two years of remedial coursework and two years for General Education), transferred to the university, got kicked out of the university, and went back to school a decade later to get my A.S. degree in Computer Programming.
How many women have you made love to during that same period of time? Please break it down by real women, women you've just fantasized about, women who had penises, and crevices within upholstered furniture.
Whatever James Bond did, I did it twice as much. ;)
Have you ever found anybody who cares about your life story? Or do you just keep posting it because it's either that or cutting and you're all out of razor blades?
Perhaps someone else used it when giving his opinion of your curriculum vitae?
Have you ever found anybody who cares about your life story?
Yes. I'm known as the guy with the funniest stories at work.
Or do you just keep posting it because it's either that or cutting and you're all out of razor blades?
I'm living out my favorite demotivator poster that hangs in my home office: "Mistakes: It could be that the purpose of your life is only to serve as a warning to others."
"I built an HTML preprocessor that adds inheritance, polymorphism, and public methods to this venerable language"
HTML isn't a programing language. It's markup language, and it doesn't need you polluting it with bullshit like this.
Just cruising through this digital world at 33 1/3 rpm...
Why didn't you use Actor Mode
XSLT still seems like the better choice to me, as it's geared towards taking actual machine readable data (XML) and transforming it into HTML. With your system you would have to already be outputting your data as HTML for it to be further transformed into the final markup.
It's almost as hideous as the idea of Coldfusion and Spark back in the day (they went the way of the dinosaur for a reason).
The only reason anyone would care about this is if it actually integrates neatly with html (which it almost does. parameters without value aren't exactly common in html).
The practical problems will undoubtedly start coming as it blurs the lines between backend and frontend code too much to make out what exactly you are doing.
That is where PHP makes more sense than this, and coldfusion and spark. (there is a clear indication of where the PHP starts and ends)
Repeat after me:
Object oriented makes no sense here because there is no hierarchical data structure to encapsulate - the tags are descriptions, not content!
Yawn.
Another cynic whose dismissive apathy paves the way for techies to reject hard work in favour of glassy-eyed masturbation, just what the world needs.
https://twig.sensiolabs.org/
We'll make great pets
CVS files for big data?? I never went to community college but I'm pretty sure a database is the best place for big data. I can't even find a text editor that will load a multi gigabit sql file.
I've seen you around a bit, but I've never seen you getting shit on like this, the same way I often do, for being a real person. Ever notice how it's never done by anyone with an account that can be linked back to a real person?
I know it's hard (I routinely fail at it myself) but the best thing to do is look at who's posting and, if you can't figure out who the person at the keyboard actually is, just ignore it.
This is in no way a judgment; as I said, I routinely fail at it myself. The hardest part is remembering to look at the username of every post before replying. All too often I'll be conversing with one person and not notice than someone else has butted in.
APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
Be sure to include a chapter on how you went to community college. That's the sort of unique experience that most of the rest of us here have never experienced, since we went to a real college (or university, for those Brits among us).
I am not sure why you would say that??? It sounds like an insult to me. I went through a community college, and then transferred to a public university after I graduated from the community college. University don't teach freshman and sophomore classess better than a community college anyway because those classes aren't that useful but rather a transition from High school to college level. Why should I pay 2x~3x times tuition just to get not-so-useful knowledge, let alone other fees? To me, community college is a good and economic way to get through higher education.
So it looks like this is supposed to solve the same "problem" that web components was created to solve, but without all of the interesting parts like CSS, Javascript, Shadow DOM, and (run-time) HTML imports...
So you and James Bond have two things in common then. You both laid a lot of woman and both work for the government xD
CVS files for big data??
I routinely work with CVS files that are exported from the database. Since CVS files are text files, I can use this DOS command to merge multiple CVS files into a single 70MB+ CVS file.
With a single CVS file, I can open it in Excel and do my daily work.
I never went to community college but I'm pretty sure a database is the best place for big data.
Big data wasn't taught when I went to community college over a decade ago. I did take a course in database management for web developers. Most users today don't have direct access to the database and need to use CSV files instead.
I can't even find a text editor that will load a multi gigabit sql file.
Have you tried UltraEdit? It supports editing 4GB+ files from disk with minimum RAM usage.
https://www.ultraedit.com/
I am not sure why you would say that???
Whenever someone brags about having a university education, it means that they want you to sniff their underwear because you're a lowly-educated peon in comparison, or they're insecure about the very expensive education that took out loans for but have nothing to show for. Some of the stupidest people I know have graduated from universities.
Some of the stupidest people I know have graduated from universities.
Well you've got to consider where you work. People who have an AA with your job are doing all right for themselves. People with a degree who still have your job are more likely to be stupid.
Obviously there is a relationship between intelligence and college degrees, even if it's not direct - Google says people with a Bachelor's have an average IQ 9 points higher than people with an AA.
Well you've got to consider where you work.
Not sure if that's a valid comparison. We have people with a high school diploma and 20 years in the military. A mixed bag of AS/BS degrees. A team lead who is studying for her masters in computer engineering 20 years after she got her high school diploma.
Obviously there is a relationship between intelligence and college degrees, [...]
I never gave a shit about IQs. I spent eight years in Special Ed classes being told that I'm stupid, skipped high school, and got two associate degrees without any student loans. If you're smarter than me because you have BS degree, so what?
Didn't they get the message, that you now use javascript to create
asdf
by writing html("p").html("b").content("asdf"), so that the website takes longer to render and doesn't work with browsers which disabled javascript?
If you're smarter than me because you have BS degree, so what?
But you were talking about people who have BSs who aren't you. If it's "so what," why bring it up in the first place?
But you were talking about people who have BSs who aren't you. If it's "so what," why bring it up in the first place?
I'm not going to worship the ground you walk on because you went to the university and I went to community college. Guess what? I transferred to the university — and got kicked out in my junior. The snobbery doesn't impress me. I've known people with no degrees who were smarter than me. I've known people with higher degrees who are stupider than me.
LOL
What utter rubbish. Want a quick and easy database? Sqlite. It's self-contained, no configuration required, fast, and efficient. You don't want to run your production services with millions of users on it, but for a quickly and easily mucking about with data sets on a dev system, it's perfect.
Loading gigs of data into a CSV so you can muck about with it in an excel spreadsheet is just fucking dumb.
Sqlite. It's self-contained, no configuration required, fast, and efficient.
Not sure if they run that in a Windows shop.
Loading gigs of data into a CSV so you can muck about with it in an excel spreadsheet is just fucking dumb.
Yet thousands of my coworkers do that to work on a small slice of the data set daily.
Obviously there is a relationship between intelligence and college degrees, even if it's not direct - Google says people with a Bachelor's have an average IQ 9 points higher than people with an AA.
Mostly there's a relationship between college degrees and people with money. As for the IQ differences, if you take (or at least look at) enough IQ tests, you'll find that many (most?) are designed in such a way that they are more reflective of your education level and social background than actual intelligence.
It's available on Windows. And you specifically were talking about YOUR OWN use - why can't YOU run that in a windows shop?
The fact that thousands of your coworkers do it daily doesn't make it smart. Thousands of people commit suicide every year - that doesn't mean it's a good idea. It's still pretty fucking dumb, no matter how many people do it.
And you specifically were talking about YOUR OWN use - why can't YOU run that in a windows shop?
You misunderstood my comments. I'm using CVS files at home AND at work. My Python script at home requires four lines of code to save data to a CVS file. I don't have direct access to the database at work, but I can export a small slice of the data set into a CSV file to use in Excel.
The fact that thousands of your coworkers do it daily doesn't make it smart.
When I worked at Google to build out a data center, I asked the project manager why the serial numbers for the port mappings were scanned into an Excel spreadsheet and not into a text file. Two reasons: spreadsheets can be open in Excel and Python can read/write data from spreadsheets (either Excel or CSV formats).
What part of self-contained database do you not understand? Save the sqlite database to a file, copy the file to a USB key, and you have access to it anywhere you've got a computer.
"Hey boss, instead of doing this stupid thing, why don't we do this OTHER stupid thing?"
Again: just because a lot of people do it, does not mean it's the smart thing to do. Asset tracking in a spreadsheet that gets mailed around and manually edited is monumentally dumb, even if Google does it.
What part of self-contained database do you not understand? Save the sqlite database to a file, copy the file to a USB key, and you have access to it anywhere you've got a computer.
Why would I use this for my own project then? My script scrapes my Slashdot comment history to a CSV file. From there I can import CSV into Excel and search for comments. Or if I want to get fancy, import it into Filemaker Pro and design forms for it.
Asset tracking in a spreadsheet that gets mailed around and manually edited is monumentally dumb, even if Google does it.
A CSV file is an intermediate format. It can be imported into a database or manipulated with Python for data massaging. Just because it isn't your preferred solution doesn't make it stupid.
Sounds like the 90s called. These days, composition is the new king.