Developer Hacks Together Object-Oriented HTML (github.com) 184
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!
Spare us. (Score:5, Insightful)
Another genius, building his own framework, just what the world needs.
Re: (Score:2, Insightful)
Object oriented is very overblown methodology. It has its advantages but overall it just gets in the way, because it takes the effort away from logic and workflow and more towards design. So you often end up with a well designed product that doesn't do what it needs to do.
Re:Spare us. (Score:5, Insightful)
You know, I disagree vehemently with those who proclaim OO an abject failure. But I'm always a bit bemused with people who feel the need to build OO into everything, whether it needs it or not. The trick, of course, is to use it as it makes sense.
One of the problems with OO is that poorly designed programs can be much worse to grok the logic and flow of than poorly designed procedural programs, mostly because of how scattered the logic can be throughout an object hierarchy.
A much more modern* trend is to avoid deep class hierarchies whenever practical, preferring instead to try to use smaller, more reusable objects that are only responsible for a single task, and use composition of objects. This allows you to more easily test each individual component and assure correctness of behavior, and then build on that behavior. These days, a lot of my classes are very shallow, either a single class, or perhaps derived from an interface class to hide implementation details when necessary.
Class hierarchies still have their place on occasion. There are still cases when you must manage a number of types of related-but-different objects with a lot of common properties. But if you keep this paradigm to a minimum, you'll be a lot happier with OOP, and keep your code more manageable.
* If you consider the last 15 years or so "modern"
Re:Spare us. (Score:4, Interesting)
Nice post! Most of my utility classes are stateless and contain only static methods. A lot of common logic is in there instead of being in the instantiated class. Inheritance here and there were it makes sense.
Yet, I still see OO heads around who think; the more it inherits, the more it is OO. The ultimate case is those projects where all classes inherit from an often called "RootObject" that contains all utility methods for the project hence effectively making all utility methods global methods.
Re: (Score:2)
Yet, I still see OO heads around who think; the more it inherits, the more it is OO.
You can thank Grady Booch for this. (The other early 90s "gurus" can share some of the blame, but Booch is the worst offender.)
Compare Alan Kay, who coined the term "object-oriented":
OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things. It can be done in Smalltalk and in LISP. There are possibly other systems in which this is possible, but I'm not aware of them.
with Grady Booch, who has some very expensive CASE tools [wikipedia.org] to sell you:
Object-oriented programming is a method of implementation in which programs are organized as cooperative collections of objects, each of which represents an instance of some class, and whose classes are all members of a hierarchy of classes united via inheritance relationships.
There are three important parts to this definition: object-oriented programming (1) uses objects, not algorithms, as its fundamental logical building blocks (the “part of” hierarchy [...]); (2) each object is an instance of some class; and (3) classes are related to one another via inheritance relationships (the "is a" hierarchy [...]). A program may appear to be object-oriented, but if any of these elements is missing, it is not an object-oriented program. Specifically, programming without inheritance is distinctly not object-oriented; we call it programming with abstract data types.
Now to be fair to Booch, he was working at a time when it was believed that analysis was the really hard part of software development. You have to remember that this was a boom era when old paper-based businesses were computerising their processes. There was a
Re: (Score:2)
Nice, thanks!
Re: (Score:2)
Also, an easy way to know what you are getting into when you come to help on a project is plug the source code into something like Enterprise Architect and see a graphical representation of the classes, along with the relations.
I don't use such tools extensively but the graphical snapshot is amazing if only for that.
Re: (Score:2)
OO isn't a failure. But it isn't often the best tool for the job.
Re: (Score:2)
OO isn't a failure. But it isn't often the best tool for the job.
I'd say "rarely", but that's just me.
Re: (Score:2)
You know, I disagree vehemently with those who proclaim OO an abject failure.
I don't think OO is an abject failure, I think it's more like driving your aircraft carrier down to the mini-market for a candy bar.
98% of the OO projects I've seen use OO only because someone told someone told someone that they should use OO...and usually for a variety of nebulous reasons that either never made sense in the first place or or because they were just enamored with OO and wanted to strut their OO shit for all to see.
Nearly all of those projects would have been better off using traditional line
Re: (Score:2)
OOP and functional programming, and probably other paradigms/methodologies have something in common: there's a right place and way to use them and wrong places and ways. They are helpful in the right place, but can make Yuuuge messes in the wrong place.
The "art" of programming is often using the right tool for the job: hammers are not "bad", but don't use them to drive in screws. Always remember not to make things hard on future maintainers who may not know about or share your grand code design philosophies
Re: (Score:2)
It was overblown, but I think it's settling down now. There is a trend towards non-Simula object models (e.g. prototypes), pure (or as pure as possible) functional programming, the actor model, generative programming (e.g. "Modern C++") and so on.
Re:Spare us. (Score:4, Interesting)
Yes, but also no.
Look at JavaScript. ECMAScript 2015 [wikipedia.org] finally added something kind of resembling real classes. Why is that?
Because the first job of JS has always been to manipulate DOM which was designed in the "90s class hierarchy bloat" aesthetic. The need, but not the ability, was there from the beginning.
If Eich had managed to get Scheme in, we wouldn't be having this conversation now.
Tha half-arsed Smalltalk/Erlang style OO that node.js developers seem to be embracing is more "real" than this. I do not think that OO is a failure. I think that Alan Kay has beaten Grady Booch but the world hasn't realised it yet.
Re: (Score:2)
I know there are newer languages like Go and Rust that don't do real OO, either, but that's rarely looked upon as a benefit of them. In fact, it's one of the biggest complaints about Go, along with its lack of generics. Go is what happens when folks who are more familiar with 1970s procedural C and Pascal try to bolt on something resembling OO. They screw up the type system, and they screw up the OO, too.
Complaints by who? There's a lot to like about Go and one the standout items is how it is not overly obsessed with OO.
Lack of generics, on the other hand...
Re: Spare us. (Score:2)
Re: (Score:2)
Object oriented is very overblown methodology. It has its advantages but overall it just gets in the way, because it takes the effort away from logic and workflow and more towards design. So you often end up with a well designed product that doesn't do what it needs to do.
Exactly.
Form over Function writ large.
Re: (Score:2)
Object oriented is very overblown methodology.
Unless you use CLOS, which very few people do.
Re: (Score:2)
The problem OO has is that we have forgotten the mindset of the designers.
Much of the early work in computer languages was born out of the study of human language with formal grammars. I never fully appreciated OO until I started trying to do simple language generation, and OO actually seemed like the perfect model for dealing with verb conjugation groups and irregular verbs. All the examples for beginners about "mammals have four legs", "dogs are mammals", "Fido is a dog" are a bit trivial and aren't actu
Re: (Score:2)
Just out of curiosity what kind of development do you do and what languages do you use.
I prefer c++ over c but most of the stuff built on java is probably the worst example of object oriented programing.
Re: (Score:2)
You don't want to hire people who are willing analyze the strengths and weaknesses of the tools? I've seen to many programs written in OO languages. But are just coded procedural inside a class wrapper. A lot of coding in today's world doesn't require full life cycle product development. Often throwaway code that does something simple and does it well offers the best bang for the buck. However if I were interviewing for a software development shop making some big clunky product I can just as easilly stat
Re: (Score:2)
But are just coded procedural inside a class wrapper.
That's an extremely reasonable approach. If the problem is procedural, but you're working in an OO language without a real module system, many programmers use the object system as a de facto module system. Modularity is important.
However if I were interviewing for a software development shop making some big clunky product I can just as easilly state all the greats OO has to offer.
Sure, but if you don't want your product to be unnecessarily big and clunky, you could consider hiring programmers with some self-restraint. And possibly better taste.
Re: (Score:2)
OO is not an overblown methodology. OO designs are so popular because they reduce complexity (when implemented properly) by representing logic in the form of re-usable, extensible objects. Opposition to OO design typically comes from junior programmers who haven't yet struggled to maintain or update existing, non-OO systems.
That was the case in the mid-90s, but it's simply not true today. Today, junior programmers are trained on object-oriented languages, and most of the opposition comes from senior programmers who have struggled to maintain existing non-reusable, non-extensible, and (especially) non-scalable OO systems which have bloated over time.
It took the existence of legacy OO systems to truly understand this.
Re: (Score:2)
OO can redu
Re: (Score:2, Insightful)
Your response is about as short-sighted as possible. I'm sure you would prefer to have been spared all of the other many geniuses that have tinkered and built across the many generations. Sure, many of those creations have been left on the scrapheap of time, but the remaining ones facilitate and amplify our abilities.
Go move into a cave in the deep wilderness where you can spare yourself.
Re: (Score:3)
You are soo right. He should have written it in JavaScript instead
Re: (Score:2)
The true test of any language is whether it can be self-descriptive, so obviously it should have been written in itself. Also, it doesn't make use of any of the modern breakthroughs in semantic design theory, like functional re-isms, kwanzaa clauses or multilevel reflexisms. You know what? I'll just implement my own and show everyone how it ought to work.
Re: (Score:2)
Got you covered! [github.com]
Re: (Score:2)
I particularly like how he is apparently under the impression that HTML is a programming language, since that's the only way object orientation could be desirable or even make sense.
Re: (Score:2)
Just to be fair, here is the first sentence on the GitHub page (README.md):
HTML isn't a programming language as such, it's actually a markup language...
Re: (Score:2)
its classless to post stories about your own stuff (Score:4, Funny)
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?
Re: (Score:3)
Re: (Score:2)
Scraping Slashdot is both child's play and not worth it.
I found it quite useful. For example, someone said I wrote "dead wood" [slashdot.org] 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.
Re: its classless to post stories about your own s (Score:1)
Re: (Score:2)
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?
Re: (Score:2)
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.
Ha
Re: (Score:2)
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.
Re: (Score:2)
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
Re: (Score:2)
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.
Re: (Score:2)
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.
Re: (Score:2)
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.
Re: (Score:2)
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 [despair.com] 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."
Re: (Score:2)
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 r
Re: (Score:2)
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
Re: (Score:2)
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.
Re: (Score:2)
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?
Re: (Score:2)
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.
Re: (Score:2)
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.
Re: (Score:2)
I think you strongly underestimate the data and metadata available on the net.
Here's the metadata for my comment history:
Re: (Score:2)
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.
Re: (Score:2)
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.
Re: (Score:2)
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. ;)
Re: (Score:2)
Not seeing how this is different from say, PHP?
Maybe this won't suck. :-)
Stale project, new news? (Score:5, Insightful)
This repo hasn't had a commit in 2 years, why is this interesting now?
Re: Stale project, new news? (Score:4, Insightful)
That's just how late Slashdot is. When he submitted it, it was brand new.
Re: (Score:2)
Re: (Score:2)
No, there is a big commit on Apr 30, 2017 :
Tag != attribute
README.md
-Use the `expose` tag to mark a public block of HTML.
+Use the `expose` attribute to mark a public block of HTML.
No thanks... (Score:3)
Not news (Score:2)
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.
html is a markup language (Score:4)
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.
venerable language (Score:4, Interesting)
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.
Re: (Score:2)
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.
Hate it all you like, you have to admit that it's been a success by pretty much any measure. Tim got the basics pretty sound.
Re: (Score:2)
you have to admit that it's been a success by pretty much any measure
It wins in exactly one measure: popularity. It's a huge pain to get things on the page where you want them.
Re: (Score:2)
It's a huge pain to get things on the page where you want them.
You're literally using it wrong.
Re: (Score:2)
Re: (Score:2)
I took a look at it and to me it appears to be a similar idea to the functionality of XSLT. Also a mandatory XKCD reference. [xkcd.com]
Re: (Score:2)
I'm suspicious of anyone who calls HTML 'venerable.' They should call it, "notorious" or "infamous," maybe, "expectorant." Marc Andreesen points out [zerobugsan...faster.net] 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.
I'm suspicious of anyone who calls HTML a "LANGUAGE", let alone "venerable".
Despite the "L" in the acronym, HTML is NOT a computer Language. It lacks several of the criteria. Must I list them for a Slashdot audience?
Re: (Score:2)
Must I list them for a Slashdot audience? If you've been here long enough to remember a time when the answer to that question would have been "no", you've been here long enough to know the answer is "yes".
Re: (Score:2)
Re: (Score:2)
Ugh... HTML quote fail... Whatever, you know which part of that you wrote and which part was written by me...
I fingered it out, LOL!
And actually, I was busy when I posted that, so decided to use the snarky comment to hide the fact that I was too lazy to find a reference to "What is necessary for something to be called a computer language?"
Hey, "Snarky" without citation works for all the damn ACs; so why can't I use it once in awhile? ;-)
Re: (Score:2)
Besides, Stack Overflow agrees with me that HTML, despite the "L", is NOT a Programming Language (pretty much for the reasons I was thinking).
http://stackoverflow.com/quest... [stackoverflow.com]
Re: (Score:2)
Re: (Score:2)
I'm not sure I'd use "Stack Overflow agrees with me" as a supporting argument. I mean, in this case you're not wrong, but... Just be careful with it :)
They seem to be fairly level-headed for an internet forum. Sure, every forum has flamewars and trolls; but in my experience, they don't seem to be that bad...
Maybe I've just been lucky, eh?
Oh, and another reason I continue to use capitalization instead of HTML "font tags" for stuff, especially italicizing, is that, when I am home on my iPad, iOS insists on changing the "i" to "I" in that tag, and I can never remember if that tag is case-sensitive or not. My HTML knowledge is very weak; so don't flame me if
Re: (Score:2)
One commonly missed detail about web development is that web developers must write a single codebase that works everywhere. We don't get to fork our code for Windows, Mac, Linux, iOS, Android, and BlackBerry. We don't get to pr
I don't see any OO (Score:4, Interesting)
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."
Re: (Score:3)
column sizing with X, and then X*3 or whatever for the next is actually possible now with flex-box. Instead of setting actual sizes, you can just set ratios (example, width:10px on first, width:30px on the next), and set the columns to flex-grow:1. This will grow them out proportionally to fill up their parent container width, instead of staying the fixed input value. Essentially it works like old HTML table formatting, but with quite a bit more granularity, and each row can optionally be different proporti
Re: (Score:2)
The reason HTML doesn't do that is that it's not about prentation. It's a semantic language, describing types and the semantic relationship of things to other things. CSS is a presentational language, concerned with layout (like width /height), colour, size, and other visual relationships. Properties like height don't mean anything to a screenreader.
I completely, completely get the point of semantic markup. However, I see "these two things are the same" as being part of semantics. Say I want to take a table published by someone else, and split it into multiple segments and comment on them after the rows. Suddenly, I now have ten tables instead of one single table. Each time I start a "new" table, the HTML renderer will render it independently of the previous ones. If I could set the column widths to table_col_width1, table_col_width2, ... , table_col_w
Re: (Score:2)
Re: (Score:2)
Because the browser is supposed to render the page however it feels is best for the end user. As a web developer, you're not supposed to be manually doing that.
That's why the web is so fucked up. Very few people actually use it the way it was designed to be used. Instead now we have shit pilled on crap to do things that were supposed to be taken care of for us. I don't fully understand my industry. Apparently if it isn't hard to do then it isn't worth doing. We have to artificially make everything harder than it needs to be.
My mistake was mentioning proportionality. The most basic use case for parametrisation of column widths would be a semantic one, and not a design one. If I have two tables that are supposed to be the same -- that are supposed to mean the same thing -- and I leave them to render as the engine sees fit, then visually they become different and semantics of the content are lost to the human reader. Maybe verb tables on a language learning site; maybe a single table that I want to break into sets of rows with an
Re: (Score:2)
Aside from flex-box, which is pretty new, you could also use percentages. Column 1 can be 10%, column 2 can be 30% -- you can also specify the width of the table as a percentage of the parent container. Oh, and with CSS classes, you can share those parameters across tables.
I know this can be done with CSS, but in order to do that, I need to choose a particular size
You already want to set a particular size, expressed in relative terms. Just use a relative unit, like percentages. I don't know how you've managed to miss this.
I can't say "I don't care about the actual size, but these 3 things should all be as big as each other."
Yes can. You've been able to do that for ~20 years. You just didn't know how. Now you do.
I know about percentages, but percentages are useless. If I have a small table (say 3 columns of 1-10 characters each), it may well be 100% of a mobile phone screen, but I wouldn't want to fill out 100% of desktop monitor with it. As soon as we start using percentages (which I learned ~20 years ago, incidentally) we are talking about size. I don't want to talk specifics, I just want to state a semantic relation between two items.
Re: (Score:2)
Those are percentages of their container. Just make sure the container flows the way you want and it will fill 100% of that container.
Don't give the C++ standardization team any ideas (Score:1)
We already have enough features.
Java? KILL IT! (Score:1, Insightful)
Made in Java? Born dead, hahahaha!
Another jQuery? (Score:2)
Spare us, there are various JS packages that allow you to attach objects and methods to HTML tags.
Wait is this PHP (Score:2)
2.0?
Pull requests (Score:2)
Idiot (Score:2)
"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.
XSLT still seems like the better choice (Score:2)
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.
Re: (Score:3)
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.
Twig (Score:2)
Reinventing XML? (Score:2)
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?
Re: (Score:2)
Re: (Score:2)
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.
Adobe Dreamweaver and Microsoft FrontPage I remembered quite well. As a software testing intern (circa 1997), I had to clean up the HTML/CSS whenever a graphic designer couldn't get her sliced image to line up neatly in the table rows.
Re: (Score:2)
Did you export the data into to CSV format and then import into Microsoft Excel?
Post to the wrong thread, friend?
Re: (Score:2)
No he is taking the piss because CSV is probably one of the worst ways to store verbose text data, as all escaping sequences are likely to turn up in the text, plus newline characters complicate record delimiting.
Wrong thread then. I used a text editor to fix HTML back in 1997.
Out of interest, how are you handling this?
Python and Beuatiful Soup 4 [crummy.com] to parse the HTML tree. Once I have the comment text, I use string manipulation to remove the newlines, extraneous tags and white space. The end result is straight HTML.
This is what the previous comment [slashdot.org] looks like in the CSV file:
Re: (Score:2)
How do you escape the comma?
I don't. The csv [python.org] module handles the details.
The csv module implements classes to read and write tabular data in CSV format. It allows programmers to say, "write this data in the format preferred by Excel," or "read data from this file which was generated by Excel," without knowing the precise details of the CSV format used by Excel. Programmers can also describe the CSV formats understood by other applications or define their own special-purpose CSV formats.
Re: (Score:2)
So the module must conform to these requirements then?
Yes, by default.
I don't think mixing HTML with Excel's arbitrary CSV rules makes for a very portable or useful file format.
I've yet to have a problem saving my 8,000+ comment history to CSV. Don't worry. HTML, JSON, Markdown and XML are coming soon.
Anyway, this thread has gone on long enough over such a trifling thing, good luck keeping control over your file.
A thread doesn't end until it has 256 comments. The system won't let you comment after that.
Re: (Score:2)
how are these on any way like python or some other programming language?
Spaghetti code.
Re: (Score:2)
Re: (Score:2)
Indeed.