Live data from Hacker News

HTML is object code

rondam.blogspot.com

51–60 of 68 posts

Re: HTML is object code

#51
post #36

Funny, I thought HTML was a markup language. The article says HTML is (or can be) both source code and object code. I say it's neither. HTML isn't the source code for some application or piece of software, and it's not the application or software itself. It doesn't tell a cpu what to do, it tells a browser what to show.

I think one of the problems with seeing "HTML as object-code" is that it leads to lousy markup. Headers implemented with font elements and explicit line breaks. horizontal margins with blockquote elements. That approach makes sense when HTML is seen as plain object code that drives a browser to lay thing out a certain way.

It does not make sense when one of the most important readers of your site is effectively blind: Googlebot.

I've used both approaches, good semantic markup and sloppy made-for-IE. Choosing good semantic markup has never come back to bite me in the ass. Sloppy markup has gone two ways, more often been a time saver and soon thrown away, but sometimes come back as a horrible thing to maintain and extend.

Re: HTML is object code

#52
post #2

This a a major leap. Once you understand that HTML is object code, a whole new world of architectural possibilities opens up to you. Not exactly a new idea either. pg talked about this years ago... http://news.ycombinator.com/item?id=50159

The linked comment seem to state that if you consider HTML object code, then you don't have to worry about accessibility. This is obviously wrong - HTML does not become more or less accessible whatever you call it.

However, used in the right way, an abstraction on top of HTML can improve accessibility. For example IE versions before version 8 does not support display:table, which lead many developers to chose table markup rater than CSS (because the share of IE users on a given site typically is greater than the share of disabled users). But with a higher-level language you can write:

  (flexible-grid
    (row
      (cell (width fixed 200px) "This is a sidebar")
      (cell (width spring) "This is the main content")))
And for IE-user you render this as table-markup, and for everyone else (Firefox-users, small devices, Google etc.) you render as accessible non-table HTML+CSS.

Some developers claim to find table-markup much more intuitive than equivalent CSS. In that case you can choose a language like:

  (table
    (tr
      (td (width: 200px) "This is a sidebar")
      (td "This is the main content")))
...and still render it into clean, accessible HTML for everyone except IE<8 users. Win-win!

Re: HTML is object code

#53
post #8
post #7

Earlier quoted context omitted.

What are the blind spots to his argument? I read your comment but didn't see anything particularly in contrast with the post. Edit: Oh actually I presume you're implying the ability to easily swap stylesheets, and that would be a valid point.

Huh? Why would that be a valid point? It's no harder to swap out different kinds of render methods than it is to swap style sheets. BTW: > Programs written in compiled or runtime-based languages either run or they fail. This is simply not true. No matter what you're writing code in, you can write it in a way that exhibits graceful degradation. It's just that some languages make it easier than others.

> It's no harder to swap out different kinds of render methods than it is to swap style sheets

The point is that with css the client can change the rendering in ways not foreseen by the developers. If I happen to have a rare form of color-blindness that means I cannot perceive the color purple, I can create a Firefox extension that changes purple to blue, and immediately all websites in the world becomes accessible to me.

If we consider HTML a kind of object-code where presentation is hardcoded into the on-the-wire output (like eg. PostScript), I would have to call around to all web-masters in the world and beg them to change their render-methods to accommodate my unique disability.

Re: HTML is object code

#55
post #46
post #36

Funny, I thought HTML was a markup language. The article says HTML is (or can be) both source code and object code. I say it's neither. HTML isn't the source code for some application or piece of software, and it's not the application or software itself. It doesn't tell a cpu what to do, it tells a browser what to show.

Yes, of course. But it was clearly meant as an analogy. The elements of good coding style that apply when writing a program in C don't necessarily apply to a compiler when it compiles a higher level language down to C. Similarly, the best practices for writing HTML by hand don't necessarily apply to a program that generates HTML from a higher level abstraction.

By then end of the article, I was convinced the "source code vs. object code" wasn't an analogy, but a sincere claim.

Re: HTML is object code

#56
post #33
post #15

A huge part of the problem is that HTML is a really bad object code for UIs.

HTML should not be used for UI, it's for inserting content and from elements into a presentation. CSS, with the help of graphics and javascript for interactivity should do the UI. Doing something like: with-html :ul :id "site-menu" dolist (menu-item (list "home" "news" "blog" "aboutus")) :li (:a :href concat(*server-root* menu-item) menu-item) Should generate this: home news blog aboutus Then in a CSS page referenced…

In what universe are content, forms and menus not part of the UI?

Re: HTML is object code

#57

The "tables vs. CSS" argument has a clear answer and I can't believe we are still arguing about it. CSS people who argue against tables are obeying their instinct that content and presentation should be separate. They are mostly right about this (I say mostly because the more graphical a webpage is, the more the content and the presentation are inextricably linked). What the CSS people refuse to acknowledge is that C…

"The table-based paradigm is a very natural way to describe layouts -- that's why everyone used tables for this prior to CSS!" Wrong and wrong. Tables for layout didn't really take off until the late 90's, and mostly were popularized by the work of one person (Dave Siegel, who wrote a book where he referred to table-based techniques as part of "third-generation" web design, implying just how much had come before). An…

The first point is absolutely correct. Nearly every other visual layout system uses grids or stacks. Novices love using Excel for layout. Nevermind computers, look around and you'll find plenty of examples of space organized with grids.

Say what you will about semantic purity yada yada but grids (aka tables) are damn intuitive.

Re: HTML is object code

#58

Earlier quoted context omitted.

"The table-based paradigm is a very natural way to describe layouts -- that's why everyone used tables for this prior to CSS!" Wrong and wrong. Tables for layout didn't really take off until the late 90's, and mostly were popularized by the work of one person (Dave Siegel, who wrote a book where he referred to table-based techniques as part of "third-generation" web design, implying just how much had come before). An…

> Tables for layout didn't really take off until the late 90's Which was coincidentally when websites started having sidebars. Are you arguing in favor of pre-1995 web design? Are you arguing that there is a more natural way than tables to express site layouts with sidebars? When I say "prior to CSS" I mean "prior to wide CSS adoption and browser support". Yes, CSS1 was released in 1996, but it didn't really catch on…

> until web authors can use "display: table"

IE8 supports it, so any day now.

Re: HTML is object code

#59
post #42
post #38

Earlier quoted context omitted.

First, I agree wholeheartedly that the language we use is never powerful enough for us to express ourselves. I'd say that even goes for print... but whatever. I spent a few hours reading old RFC's because of this whole thread. It looks to me like rfc 1942 got popular, and the CSS folks never came to grips with that. CSS1 is pretty given the constraints of the day. I think about CSS in two terms (I don't think there's…

CSS1 was mostly about typography, but CSS2 supports layout equivalent to (or rather a superset of) what is possible with HTML tables.

Here's a simple task you can't do in CSS2: Create a multi-line form where the labels are right-aligned to the fields, the fields all line up, and everything expands to fill the contents.

Re: HTML is object code

#60
post #41

Earlier quoted context omitted.

It's a lovely story, but it isn't true. Designers have been trying to create grid-based layouts since the beginning of the graphical web. CSS was created after that, and its creators did not see fit to bestow on us the basic tools (flexible boxes) that could be used to create these layouts elegantly. As a result HTML and CSS have always been coupled. Only by using both together, can engineers create the layouts desig…

CSS does support flexible grids (with power equivalent to HTML tables), it is just that IE has not supported it until IE8, which means it hasn't been used widely. I fint it strange that people keep blaming the shortcomings of IE6+7 on the CSS standard.

Reference? Are you referring to http://www.w3.org/TR/css3-grid/? Which is at the working draft status?
Post reply on HN