HNHacker News
TopNewBestAskShowJobs

xionon

268 karma · joined October 13, 2008

submissionscomments
xionon··on EA CEO John Riccitiello Steps Down
http://en.wikipedia.org/wiki/List_of_best-selling_PC_video_g...

1 million is very good, but not record-breaking. 1 million is very, very good if you consider SimCity and city-building games somewhat niche compared to games like Battlefield.

xionon··on Emblem.js: concise, indented alternative templating language for Handlebars.js
I get the feeling you've never really used HAML, because this is a load of FUD. I'm going to respond primarily with HAML, because that's the whitespace-significant template language I have the most experience with.

> Writing plain old HTML is fucking simple. Abstracting it out into another 'language' just means you have to deal with a whole load of quirks and workarounds you'd never see with HTML, and while it looks all purdy and shit to some, it's an absolute nightmare to maintain.

I've maintained a lot of older projects, and the closer the templates are to HTML, the worse they seem to be. I can't count the number of times a DIV is left unclosed, or a TR is closed by a function call, or a P is nested 20 levels deep in a one-line monster tag. HAML and other whitespace-significant template languages prevent all that. You can't leave a tag unclosed in HAML, it closes them for you; because it closes them for you, you can't close them in weird and separate places; finally, because it forces you to have a newline before each tag, it looks really obvious when you've created a huge nested mess of HTML.

> Want to nest elements? Either you can't,

Wrong. Nesting elements is dead simple in HAML:

  %ul
    %li
yields

  <ul>
    <li></li>
  </ul>
> some syntax has been introduced to discourage it (the end of line pipe),

The end of line pipe is for when you have very code that goes with a single element. From the docs:

  %p= @this.is(way.too.much). |
      code("and I should").   |
      really_move.it.into(    |
        :a => @helper)        |
Usually, though, this should go into a helper, because your templates shouldn't have that much logic in them.

> or you're told to just... use plain HTML.

This makes me think you don't know what you're talking about. Again, it's easy to nest elements in HAML. You wouldn't drop to HTML just because you want to nest elements.

> Want to interpolate variables? That's probably built in, which is great until you try changing it back to plain HTML, and then have to scan for all the interpolation, which is now plain text.

Of course it's "probably built in," interpolation is core to any templating engine. Interpolation is dead simple, as well.

  %ul= some_variable
I'm not sure what you mean by "turn it back to plain HTML." At what point can you turn any template language back to plain HTML without having the interpolation be a problem?

> There's likely so much focus placed on "one-lining" everything that you have to do silly things just to actually make the template readable, when it wouldn't be a problem in HTML.

Do you have any examples of this? In my experience, whitespace-significant template languages do more to discourage one-line operations. Instead of doing this:

  <ul><li></li></ul>
you're forced to break it up into multiple lines:

  %ul
    %li
> Never mind the total lack of portability and, especially these days, requiring a copy of Node just to run the damn things. Which is fine until you realise you shouldn't need to add a full on javascript VM to your development dependencies.

I've never used a template language that didn't require some programming language to evaluate. Usually they require the language that the entire project is being built with; e.g., HAML assumes you are writing a Ruby project.

There are a lot of framework tools that require some sort of precompilation, too. If you're building anything reasonably complex, you're probably going to want to be able to split your files out into smaller chunks, which means using something like Less/SASS for CSS and require.js for dependency management. All of those have external dependencies. Or do you really not care to compile your disparate JS and CSS files into a single download?

> That so many of these attempts at 'HTML templating languages' exist is probably testament to the fact that no one agrees on what one should look like.

Isn't that a great thing, though? Diversity in this means the technology hasn't stagnated.

> They've actually been staring it in the face all along: plain old HTML.

I have no idea what you are suggesting with this point. What does HTML actually offer as a templating language? There's no built-in variable interpolation, no built-in template segmenting (e.g., rendering a partial), and no built-in control structures (loops, conditionals, functions, etc.). Once you've added all that in, you either have another template engine that requires something like node.js to precompile for performance reasons, or you have a mess of spaghetti that only the creator knows how to maintain.

xionon··on [dead]

  Server:WEBrick/1.3.1 (Ruby/1.9.2/2011-07-09)
(via chrome's network tab)

They're also including a link to the security announcement, so at least it's not mindless.

xionon··on John Carmack Argues Against Native Linux Games
He doesn't argue that porting the game is too difficult - in fact he implies that porting games to linux is pretty straightforward. He's really arguing that supporting the game after release is too expensive.

You have patches, and compatibility issues, and a thousand video cards with potential incompatibilities; customer service questions, system updates, and that one dude in Kansas running a custom version of linux that cant quite get your game to work, so he keeps calling and bugging you and taking up support time.

Edit: Found a relevant quote:

  This may sound ridiculous – “Who would turn away $20,000?”
  but the reality is that many of the same legal, financial, 
  executive, and support resources need to be brought to 
  bear on every single deal, regardless of size, and taking
  time away from something that is in the tens of millions of
  dollars range is often not justifiable.
xionon··on Microsoft opens its own social network
Potential NSFW warning: When I visited http://beta.so.cl/, I got a big eyeful of the image from the old goatse.cx

(in case anyone doesn't know what that is, here's a sfw explanation: http://en.wikipedia.org/wiki/Goatse.cx)

xionon··on On sexism in the tech industry - rebuttal
How about some real criticism instead of just fear and anger at a woman expressing an opinion contrary to your own?
xionon··on Chrome 22 breaks things
I thought that had more to do with the billions of dollars invested in IE-only web applications and the astronomical cost of upgrading, retraining and supporting thousands of people, not the fear that one version of Chrome will someday break CSS behavior.
xionon··on Websockets 101
I'm not sure I see the use-case there as being more useful than JS based WebSockets. Writing a general JS library to do what you suggest would be pretty straightforward, and the server-side work wouldn't be any different (serving partial HTML based on request type).

If your users are worried about security / performance enough to turn off JavaScript, they probably wouldn't want "HTMLSockets" enabled, either.

If your users are browsing with a browser so old it doesn't have a reasonable JavaScript engine, then it wouldn't support "HTMLSockets," either.

Basically, there's nothing you could do with "HTMLSockets" that you can't do with WebSockets, and with only a small layer to make it so. However, there's a whole host of utility that you get from WebSockets that you could never get from HTMLSockets, or would require a huge amount of hacking in order to get it to work.

And all this is beside the "pureness" argument, where one might say that HTML is for data, CSS is for design, JavaScript is for behavior; WebSockets are behavior, not data.

xionon··on Organic Food Isn't More Nutritious, but That Isn't the Point
Based on context, I think it's clear that stinkytaco was talking about things like high-fructose corn syrup and corn chips and corn-based cereals, as "corn byproducts," opposed to unprocessed vegetables and fruits.

If we're being pedantic, though, corn is a grain, not a vegetable (probably).[1] But that's clearly not what you meant, so it's not really worth digging into.

[1]http://empirezone.blogs.nytimes.com/2007/06/11/corn-vegetabl...

xionon··on 12 (Really) Controversial Programming Opinions
But sometimes it's not just the programmer that gets bitten, it's all the other people at the zoo, too. Exceptions help protect everyone.
xionon··on RESTful Web Service in Go Powered by the Google App Engine
It looks like the GitHub repo is broken... https://github.com/begoon/usvisa-api/ Maybe it's just not published, yet?
xionon··on Vanilla JS, fast, lightweight, cross-platform framework
"Useless" is subjective, but the jQuery object does a lot of extra work above the vanilla example.

$ isn't just a syntax layer on top of querySelectorAll. When you do $('p'), it first queries the DOM for everything that matches that selector, then it creates new jQuery objects to wrap each of the returned nodes as well as creating a jQuery object to contain them.

If all you're doing is setting the innerHTML of these objects, it's a non-trivial overhead.

← PreviousPage 3 of 3