5 ms·
> Mozilla (including Firefox) had XUL, but nobody cared. Have you seen XUL? Here's an example, from https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/
by wtbob 10y ago
> Mozilla (including Firefox) had XUL, but nobody cared.
Have you seen XUL? Here's an example, from https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Tutorial/Adding_Buttons https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Tu...
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="findfile-window"
title="Find Files"
orient="horizontal"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<button id="find-button" label="Find"/>
<button id="cancel-button" label="Cancel"/>
</window>
All that does is display a window with two buttons. You can imagine how hideous it could get when it got more complex. Now, imagine this alternative (I'm assuming that id & title are mandatory arguments, and that orient is optional, default to horizontal):
(sul
(stylesheet "chrome://global/skin" "text/css")
(window "findfile-window" "Find Files"
(button "find-button" "Find")
(button "cancel-button" "Cancel")))
Which would you rather write in?
Now, imagine that JavaScript were Scheme or Lisp instead, so that your browser interaction code were also written in an s-expression language. And imagine that CSS were s-expression-based, so that you were using the same tools to manipulate the same data everywhere.
It makes me weep.
- talmand 10y agoI must be insane because I don't really see that much of a difference between the two examples you provided. I can read one just as well as the other.
- wtbob 10y agoThe former has 46 words/348 characters; the latter 20 words/176 characters. That's more than twice the tokens, twice the disk space, twice the cognitive load.
- icebraining 10y agoFrankly, it's silly to think that cognitive load is directly proportional to number of words/characters. For example, the latter relies on more implicit information (the order of the arguments), which can be harder to keep in mind than the keywords use by the former, particularly as you add more than two attributes. I'd say this version actually reduces the cognitive load, but it doesn't save as many words: (sul (stylesheet :href "chrome://global/skin" :type "text/css") (window :id "findfile-window" :title "Find Files" (button :id "find-button" :label "Find") (button :id "cancel-button" :label "Cancel")))
- talmand 10y agoTwice the tokens, don't care. Twice the disk space, who cares? Twice the cognitive load, I guess I have a high tolerance. Still don't see a compelling reason one is better than the other.