Live data from Hacker News

HTML is object code

rondam.blogspot.com

11–20 of 68 posts

Re: HTML is object code

#11
He seems to argue that alternative renderings - eg. for blind users - could be generated on the server rather than the client. This glosses over the important point that nobody is actually going to do that.

The beauty of correct use of html and css is that the burden of choosing an appropriate rendering is pushed to the client, which in turn means that the developer does not have to know in advance what kind of devices or assistive technologies will be used to render the content.

Re: HTML is object code

#12
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.

I'm not sure, are you talking about changing the render method to output clean html which the user can style themselves?

Don't bother answering, I'm really confused. Why doesn't the world use XML and XSLT? I give up. I'm gonna just code using tables from now on.. o_O

Re: HTML is object code

#13
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.

'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.'

its much much harder to switch rendering engines than to switch css files

try changing this websites rendering engine, first you need to hack the server, then you need to understand the source code(and learn the language if you dont know it already), then learn how the renders are perfomed, how the data is modelled.

then try switching its stylesheet, that can be a click away if you want it.

Re: HTML is object code

#14
Ah yes. The old "x is hard. Writing x sometimes gets messy. I don't want to deal with all the intricacies and details of x. I know, I'll create an abstraction layer!"

Of course, in the best of all possible worlds, you'll end up with a perfect abstraction layer which is powerful enough to allow you to do everything you need, while hiding all of the the gory details. In the worst case, you end up with a leaky abstraction. Suddenly you need to know not only the underlying language, but also how the compiler works.

That's not to say that all abstraction layers are evil. C vs. machine code is an example of an abstraction that works well. You rarely need to dive down into the machine code and you can, to a large extent, be ignorant of how the compiler works and still be able to be a decent C programmer.

There's no doubt that developing for the web can be quite hairy and sometimes you wish you didn't have to deal with all of the compatibility issues etc. It's possible that the solution is something like Vaadin, which lets you develop web applications as if they were Java desktop applications. But I'm not convinced just yet.

I guess the real question is, what exactly is the problem with HTML? If the problem is that HTML isn't abstract enough, then yes, an abstraction layer would be the answer. But if the problem is something else then slapping an extra layer of complexity on top of HTML won't magically solve those problems.

Re: HTML is object code

#16
post #3

I think this makes good points about how we should be working with html these days, except those few of us who do static tables by hand. One thing I am concerned about in the concept of doing all the work on the server is that CSS has the ability to let the client override some of the presentation issues, such as is the case for accessibility. I wonder if that can be done as effectively on the server.

The server is still producing HTML and CSS which can modified by the client.

Re: HTML is object code

#17
post #11

He seems to argue that alternative renderings - eg. for blind users - could be generated on the server rather than the client. This glosses over the important point that nobody is actually going to do that. The beauty of correct use of html and css is that the burden of choosing an appropriate rendering is pushed to the client, which in turn means that the developer does not have to know in advance what kind of devic…

If I may monkeypatch the original argument, I'd point out that there isn't any particular reason that you can't output perfectly accessible HTML with this approach. In some ways its likely to be easier than some other approaches, since when you think this way, you're starting out with more actual, factual semantics in your data representation.

Moreover, if you're going to argue the "nobody's actually going to do it" argument, I'd say that "nobody's actually using CSS to generate one HTML page that works in a screen reader, cell phone, rich browser, and REST API" either. For the same value of "nobody", which is to say, not literally nobody, you can find a handful of people, but the idea that there's some mass of developers "correctly" using CSS is pretty silly too.

Re: HTML is object code

#18
post #14

Ah yes. The old "x is hard. Writing x sometimes gets messy. I don't want to deal with all the intricacies and details of x. I know, I'll create an abstraction layer!" Of course, in the best of all possible worlds, you'll end up with a perfect abstraction layer which is powerful enough to allow you to do everything you need, while hiding all of the the gory details. In the worst case, you end up with a leaky abstracti…

I guess the real question is, what exactly is the problem with HTML?

HTML is ok, it's CSS that's got the problem. It's the difference between Microsoft Word and Publisher; CSS doesn't provide enough layout primitives to do common web layouts easily. Instead, you have to specifically structure your HTML for it and layer on the tags and copious amounts of CSS code.

Re: HTML is object code

#19
His entire intro is dumb. If you simply define object code as stuff a compiler emits and source code as stuff a compiler processes, than obviously every piece of data is both source and object code. That's the essence of the von Neumann architecture (and, incidentally, that's also why stack buffer overflows are possible). Repeat after me: data is code.

Re: HTML is object code

#20
post #8

Earlier quoted context omitted.

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.

'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.' its much much harder to switch rendering engines than to switch css files try changing this websites rendering engine, first you need to hack the server, then you need to understand the source code(and learn the language if you dont know it already), then learn how the renders are perf…

What you say is true, but only because the software most people use on their servers makes it true. The conclusion is not that we should continue to use the current broken infrastructure, but that we should build different infrastructure. Your argument is kind of like someone in 1904 arguing that air travel will never be commercially viable because there aren't any airports.

I find it a bit distressing that I would have to explain this here on HN of all places.

Post reply on HN