Reputation: 7934
This question is a more discussion oriented one that a simple problem specific question. Writing basic HTML is simple but writing fast light standards based, SEO best practices complaint, all browsers compatible HTML pages is hard and very time consuming.
But why it hard ?
In my opinion it hard because of the hundreds of different rules what need to be followed, rules what are hard to remember and even if you remember it hard to merge them together in not contradicting form and the only way to validate you work is by loading it in every browsers you support and validating every scenario.
But it really looks like a problem we had in the past in other areas of programming, previously before inventions of high level languages writing program in assembly is looks a lot like writing HTML files, you was forced to remember hundred of different rules for performance, correctness security and so on and the only way to validate them was by executing the program.
In other fields this problem was solved by compilers of high level languages what make a syntax simpler, make performance optimizations, check program syntactic correction before execution.
Don’t you think we need a different simpler language for writing web pages and compiler what could produce browser specific, standard complaint size optimized HTML from this language ?
Do you think it possible to create such languge and compiler ?
Upvotes: 3
Views: 386
Reputation: 11146
GWT, Dojo and ExtJS do exactly what you describe. Yes, they require javascript, but they do allow you to avoid remembering many of the "rules" (to a greater or lesser degree depending on the technology).
GWT especially is a good example, because it doesn't even require you to concern yourself with HTML, CSS or JS at all. You live in pure java land, cross-compile to a web app, and it just works.
Upvotes: 0
Reputation: 346317
The real problem isn't with writing standars-compliant HTML. The problem is that HTML+CSS is an extremely complex system without a reference implementation, which makes the standard essentially worthless since you can't test against it.
Yeah, you can test your HTML and CSS for syntactic correctness, but unlike programming languages, the rules for what effect a syntactically correct program will have are not unequivocal. The actual rendering rules are subject to interpretation, and so it's guaranteed that there will be browser incompatibilities for the foreseeable future. To cite Joel:
you’re pretending that there’s one standard, but since nobody has a way to test against the standard, it’s not a real standard: it’s a platonic ideal and a set of misinterpretations
Upvotes: 0
Reputation: 1838
Let's answer this in a way that's fair to what you want, but respects the ubiquity of HTML.
If what you wish is a high-level language for HTML, they already exist. Any good wiki system has a simplified syntax that abstracts away the "<html><head>...</head><body>...</body></html>" plumbing from the user. This is what PHP was made to do, and most popular blogging and wiki systems use it.
A separate problem entangled in your complaint is that a markup language (HTML) is used as an intermediary in the transmission from application (server) to renderer (client). The intent of the application may be lost, because markup is not code but rather a document description language.
What you propose is a method for the web application to direct its execution on the client-side. There are a lot of historical arguments against this -- freedom of browser/platform choice, need for a standard, privacy/security concerns, and possibly breaking MVC by agglomerating code as the transmission interface.
There is work being done in this area however. Look at XUL, which seeks to solve the problem on Mozilla browsers; also Prism, which is a very early applications framework. Also look at Google's GWT or NaCl, which facilitate the safe integration of "native" code on the web. The problem with all of these imho is that they assign work to the client. My belief is that the only good way to safely have true client-server interaction is either 1) a trusted cloud mediator or 2) virtualization.
Upvotes: 2
Reputation: 29009
There is some confusion about, I fear. The fact of the matter is that writing good HTML is easy. Very easy. Writing bad HTML is also very easy, but that's neither here nor there.
What is difficult, I think you'll find, is writing good, cross-browser, beautifully rendered CSS. Very difficult, in fact.
And no amount of abstraction will solve that. Only efforts to improve all browsers will help this; and that is no small feat.
Another issue, and this is a bigger one, is that recently HTML is being abused for things it was never meant for; applications that would benefit greatly from being implemented as "proper" desktop applications are being implemented in HTML and JavaScript because it is "easier" for developers on some level (which, as your post highlights, is a filthy rotten lie).
Compatibility issues cannot be defeated easily; and by implementing things on the wrong "platform" you are setting yourself up to fail. Miserably.
The web is not a platform; it's a tangled weave of danger and despair. And, of course, tubes.
Upvotes: 6
Reputation: 6958
With all due respect I am under the impression that you are comparing apples and oranges. Why? You are stating that modern programming languages take the burden of writing good code from the developer (by applying optimizations). IMHO, this statement is not quite correct: No optimizing compiler can compensate for a developer implementing an O(n²) algorithm where an O(n) implementation would have also been possible.
Back to your original question: I understand your need to build standards-compliant cross-browser web applications with less effort than is needed today. Probably somebody will (or already has) come up with a meta-language, which abstracts some of the complexity of writing HTML, but on the other hand this is already possible today with many of the template frameworks / CMS available. Of course, you still have to create the blueprint of your web site in HTML once so that it can later be used as a template, but that's something a meta-langauge also will not allow you to get rid of (even modern compilers make use of hand-crafted assembly language in some areas).
Upvotes: 0
Reputation: 518
Personally, I believe that with a decent amount of preparation, there is very little difference in writing 'basic' HTML and standards compliant HTML. Even starting from scratch, I don't think it's any harder.
Similarly, once you've developed a few sites, any rules regarding validation, etc will become second nature
Upvotes: 4
Reputation: 2507
The whole browser compatibility issues and its ramifications are tied to wars between companies, which by all chances doesnt give any shtick to the developer's pain because its all money and market share for them.
Its not easy to move away from it easily by corporate users and non-tech users.
Upvotes: 0
Reputation: 161773
What you are describing is a domain-specific language to describe HTML pages.
Upvotes: 2