Camen Design Forum

HTML was designed to last. JavaScript wasn’t. Rebuttal.

append delete indieinvader

First off, Kroc, I'm a long time reader and a big fan of your work but I disagree with you here and, this being the internet, I'm going to point out how you're wrong, you'll probably do it back and it'll all go back again.

HTML and JavaScript are in two entirely different universes:

JavaScript is a LISP disguised as Java, making it a general purpose programming language, a very good one at that. One running on some of the fastest VMs in the world. Heck, V8 can performance match programs written in C in some perf tests! It has a lot of warts but the next couple of revisions are going to take care of that. (I can't wait for TC-39!)

HTML, on the other hand, is a declarative markup language that, despite its complexity, is significantly less complex than JavaScript or even BASIC! It is also much, much, older: HTML has its roots in SGML (1986) which is based on GML (1960). (JavaScript is only now beginning to reach maturity) HTML5 only makes things easier.

You're comparing apples to oranges.

Reply RSS


#1. Jose Pedro Arvela

This post was deleted by its owner

append delete #2. JJ

Who said anything about speed or complexity?

He's not comparing apples to oranges because both HTML and JavaScript are used as manipulators and creators of DOM.

append delete #3. Kroc

"You're comparing apples to oranges."

Exactly, that’s the point!

They are not the same thing. Yet, many developers do see them as similar. They are two different program models entirely as you’ve pointed out, and the problem is when people use JavaScript to make HTML that doesn’t work with JavaScript, they are locking people out of data for no good reason.

HTML stores the information. JavaScript is a programming language that evolves, changes and breaks old code (ES5). One day we may be scripting web sites in a language other than JavaScipt. Ruby, or Python. The scripting layer is supposed to be swappable (that was the design of the DOM). So if people lock data into the requirement of JavaScript, they are shooting themselves in the feet.

append delete #4. Kroc

"to make HTML that doesn’t work with*out* JavaScript" I meant to say, obviously.

append delete #5. JJ

"The scripting layer is supposed to be swappable (that was the design of the DOM)."

That's a really good point to make. Not many people understand that javascript isn't necessarily related to DOM, it's only used to manage and manipulate DOM. The same thing could even be said of HTML - that HTML isn't necessarily related to DOM in the strictest sense. HTML is used to markup content, and provide content with meaning. It doesn't *have* to be rendered into a DOM context. All of this illustrates that HTML and JavaScript are not necessarily related to DOM, and that they're not necessary to create or manipulate a DOM structure. You could use an XML language and any other scripting language to dynamically access the DOM as opposed to HTML and JS. However, HTML seems like it will be the only markup language suitable for the web for ages to come whereas javascript is extremely dispensable.

Not many people realize this. I didn't realize this was what you were trying to get at with your quote at first, but now I realize it's very well put.

append delete #6. indieinvader

The problem *I* have with this idea that JavaScript is "disposable" has a lot to do with the quality of the language and it's market share.

JavaScript is a very good language and we a just now beginning to realize how powerful its constructs are. (Due, in part, to the resurgence of Functional programming languages such as, Erlang, F#, Haskell, and Scala, allowing developers to realize that JavaScript is an FP language) In fact, there is a lot of work being done on Server-Side JavaScript (things like Ringo and Node.js) to allow developers to use a top-to-bottom unified stack.

The language has a lot going for it and people that understand it are not going to push for a new programming language for the web any sooner than they're going to ask for a LaTEX-based web.

Additionally, JavaScript has very close to 100% market share: every browser with a scripting engine has a JS scripting engine and nothing else. The web takes a long time to change and dramatic changes never work. (remember XHTML?)

I would say, "HTML was designed to last, JavaScript was designed to bring Functional Programming with closures to the masses," or something like that. :p

append delete #7. JJ

The quality of javascript as a language is an irrelevance. It could be the most amazing language in the world, but it is still dispensable compared to HTML in the context of the web. That's the bottom line.

LaTeX becoming the new markup language for the web is *completely* different from swapping out a scripting language in favor of a new language to dynamically manipulate DOM.

Not only would it require current browsers to be updated to parse latex markup, but it would also require ALL user agents including search engines and bots to be updated to understand the semantics of this new markup language. It's the same reason XHTML was used as an attempt to move toward XML, rather than using just generic XML as the web language. Generic XML does not have the universal semantics that HTML established for the web and it would be absolutely devastating to try to establish a new set of universal semantics. Neither generic XML, nor LaTeX, nor any other markup language as far as I'm convinced, could handle this burden.

Using LaTeX would also redefine essentially every specification there is. It would replace the HTML spec obviously, and create further dissonance between XML-based languages and the main web markup language. What happens when XBL2 comes out? How would that even work with LaTeX? What about inline SVG? How would it work? It wouldn't.

Swapping out javascript on the other hand wouldn't entail altering ANY specifications at all, anywhere.

append delete #8. Kroc

@indieinvader, you have to understand that I don’t disagree with you at all. I know what JS is capable of, I do code in it, very well if I say so myself. But tying hard data to the use of JavaScript is a bad practice.

JavaScript was designed to serve a different purpose than HTML. It has evolved and outgrown its parameters far more rapidly than HTML. Tying JS to HTML in a document (through poor coding practices) is a maintenance contract from hell because the JS will bit rot 1000x faster than the HTML will.

append delete #9. indieinvader

@Kroc: Gotcha. I was mostly disagreeing with JJ in the last post because JavaScript really isn't dispensable (nobody likes being forced to change languages, large investments in its future, inertia, &c.) despite not being strictly "necessary" for a functional web.

append delete #10. theraje

JavaScript [is not] strictly "necessary" for a functional web.

Tell that to all the corporate Web developers. Can't even download hardware drivers anymore without JavaScript enabled on most of their sites!

append delete #11. me


append delete #12. monty

Speaking of a LaTeX-based web, which is clearly neither desirable nor possible; I have wondered often whether a browser could come along and use the TeX engine to render website text. It would have to be optional as would be much more intensive on the machine's resources, but it would certainly be typographically superior.


(Leave this as-is, it’s a trap!)

There is no need to “register”, just enter the same name + password of your choice every time.

Pro tip: Use markup to add links, quotes and more.

Your friendly neighbourhood moderators: Kroc, Impressed, Martijn