HNHacker News
TopNewBestAskShowJobs

nxn

238 karma · joined June 30, 2010

submissionscomments
nxn··on Button Basics
Which is not what I'm talking about either. I'm just saying it's a bit ironic to need to zoom in on a button to even distinguish any quality differences and then giving the quality award to the method that isn't suitable for scaling.
nxn··on Button Basics
So to get this straight, the author created a button image in photoshop, then created the same style using css3, took a picture of both, zoomed in, and compared the pixelated blockyness? ... While completely disregarding the fact that actually zooming in on the css3 version in the browser would avoid any pixelation and blockyness in the first place?
nxn··on TV broadcast monitoring in Canada must be Doom-like resolution (320x240) x 15f/s
Wasn't Doom's resolution 320x200? And I'd be a bit surprised if it was capped to 15fps.
nxn··on Ask HN: Is JavaScript Java.next()?
Because using javascript is convenient and fits well in an environment of "just type in a URL and you're good to go"; your users wont have to install anything, you'll be able to make updates EVERYONE will get the next type they visit, and you're not limiting yourself to a fraction of the people who have an up to date version of some plugin. To me that's seriously about the most perfect app deployment mechanism I could want. At least on the web it is.

I personally still wouldn't use node.js ever, but I see how it might be used by someone who already knows javascript and doesn't have the time to pick up Haskell or Erlang for some idea they want to execute.

Also, it used to be that without the HTML5 tech a lot of what you listed wasn't even possible and that was a forcing factor to use something else. So it's not just improvements in speed here, that RAGE demo wouldn't exist without WebGL.

nxn··on Avoiding Nested Callbacks in JavaScript
I thought the # shorthand for functions proposal was rejected?
nxn··on Avoiding Nested Callbacks in JavaScript
You mean the nested versions? Just because it's not the most efficient way possible to do something does not automatically mean it's a 'performance issue'. If you're doing it once, or if it's some user based event like a button click, the difference will not be noticeable. If this is happening in a loop, perhaps then you might be in need of re-factoring. But in this example it would probably hardly help since it's reading and writing files, and chances are that's going to slow you down more.

EDIT: took out function hoisting stuff, it doesn't get hoisted after a quick check.

nxn··on JavaScript’s native map reduce and filter are wrong
Missing the fact [].map has been around in some browsers for a while is one thing, being surprised that there was a crap language design decision made in JavaScript is making me laugh though.
nxn··on JavaScript is Dead. Long Live JavaScript
Ahh, I see. The thing is, I can't think of a single way to make {} be treated as false in the boolean context, so 1) I don't think you'd ever need anything more than "option = option || {}", 2) I think the example would have been better off using an integer or string where you actually might have to use the ugly long format.

EDIT: Unless of course you get some non object value passed in and you want to be sure to keep it regardless of whether or not it is falsy. Not sure why you'd want to do that -- I am sure I would NOT like to see someone do that if I had to deal with their code.

nxn··on Opera 11.50's new "featherweight" interface packs a punch
I assume by the lack of a Linux screenshot nothing was worth viewing there. It's quite sad, but I think just about every browser I've used so far on Linux had a much crummier looking UI than it does on other platforms. When on a mac or in windows the browser feels custom tailored to that particular environment, when in linux it feels like a cheap port that was called "finished" as soon as it became functional enough.
nxn··on JavaScript is Dead. Long Live JavaScript
Ok, sorry for using the term "not fair", I should have probably said that it's "unsound" to judge the speeds of current dynamic languages on mono/.net to the speeds of v8, SpiderMonkey, etc. The cause being that the speeds of the latter were fueled by very high browser competition and a lot of resource investment. Dynamic languages on .NET got the benefit of neither of these, so it should not be surprising that they are slower than their native implementations (which also get better funding/bigger communities). It would have made more sense if Microsoft or other companies threw millions of dollars at the Iron* languages and still couldn't make them fast.
nxn··on JavaScript is Dead. Long Live JavaScript
"At Google I/O they mentioned V8 is about as fast as it will get." from: http://news.ycombinator.com/item?id=2669494

Yeah I know, it's not a proper citation, I tried to find where exactly that was said at Google IO but found nothing so far. Either way, I didn't question it at the time I read it because given how dynamic JavaScript is I'd imagine there's only so much you can do to speed it up. Then again, this was coming from Google, and for all anyone knows the cause might just be them focusing more on Native Client instead of V8 for apps that need performance.

nxn··on 20 WebGL sites that will blow your mind
I'm on Archlinux using an old and dusty Nvidia card and I have never had any problems with WebGL so far. In fact, when I often share WebGL links with others they complain about it bringing their computers to a crawl, and they're generally using a non linux OS. Mind you, things are probably drastically different for the poor souls who have to deal with ATI on linux. But in those cases, I'd say the problem is with ATI and not WebGL.
nxn··on JavaScript is Dead. Long Live JavaScript
"In 1997, I collected a list of languages with compilers to JavaScript. There were JavaScript extension languages: the now-defunct ECMAScript 4, Narrative JavaScript, and Objective-J. There were pre-existing languages: Scheme, Common Lisp, Smalltalk, Ruby, Python, Java, C#, Haskell, etc. There were even brand new languages HaXe, Milescript, Links, Flapjax that were designed to address web programming needs."

Am I reading this right? Objective-J (2008), C# (2001), HaXe (2005), etc having compilers to javascript in 1997?

nxn··on Ask HN: Any alternative to JavaScript in sight?
I have no experience with ruby, but python's advantage is in strong typing. Try and add an int and a string and you'll get a type error, JavaScript on the other hand will do it though. While maybe allowing you to write more expressive code, it does mean that errors become harder to locate, and when dealing with larger applications, I prefer being able to locate errors quickly.
nxn··on JavaScript is Dead. Long Live JavaScript
In my opinion it makes no difference that we have several fast engines where some are faster at some things than others. When executing in the browser you don't get to pick and chose how and where your application will be executed. If you run into performance problems on one of the engines you can: A) dismiss a subset of your users and their performance problems, telling them to use a browser with a faster engine (they wont), B) only allow certain functionality based on a user agent string, or C) limit your applications scope to one that runs suitably in the slowest of the engines you're willing to support. In essence, if the application runs great in browser A but chokes in browser B, are you willing to say bye bye to your A users to take advantage of performance gains on B? I've been in this situation, and in my experience I've always had to look away from the faster browser rather than the user.

Outside the browser you probably have a little more freedom, but it's not like you get to pick and chose in the style of "Oh, I'll execute this function in V8 since it does this faster, and that function in SpiderMonkey since it's faster there". For this reason, I don't think the fact Alioth only has measures for one engine would make a significant difference in the overall comparison. You'd be, for the most part, gaining performance in one place by sacrificing in another.

Anyway, in my personal experience, I've ran into performance problems in JS a lot more often than with C#. I also have to go through a lot more tedious practices to ensure my JS code runs as fast as it can, where as in C# Some.lookup.with.lots.of.dots.does.not.scare.me(). That's why your claim sort of surprised me. Then again, the last serious JS performance problem I had was 6 months ago (before FF4), so maybe a lot has happened in those 6 months.

By the way, I'm not too informed on how type inference is done in SpiderMonkey, so I may be completely wrong in mentioning this, but it sounds like they're trying to speed up a dynamic language by mimicking static typing. If that's how far they're going to improve performance, maybe soon enough JavaScript will in fact sit better in the Mono/.NET/JVM?

nxn··on JavaScript is Dead. Long Live JavaScript
"Optional Parameters and Default Values"

Since JavaScript will still invoke a function call even if the number of arguments don't match up, parameter defaults will not completely eliminate all the problems he lists.

  function(a = 1, b = "Smith", option = {}) { .. }
Will still break upon trying to invoke it without parameter 'b' since param 'option' will just take its place while option will become an empty object.

Furthermore he argues against "option = option || {};" only to do the same thing in the function header: "function(a, b, option = {}) { .. }"? What difference does that make?

The whole section in my opinion is negated by passing object literals to functions. Stuff like:

  func({ a: 1, b: "Smith", option: { .. });
That makes it easy to read and easier to handle since names are agreed upon by both the caller and the function handling the invocation:

  var opt = config.option || {};
This is a common practice in JavaScript already, and it beats the solutions he wished were added to the language.
nxn··on JavaScript is Dead. Long Live JavaScript
>> 1. JavaScript's speed is actually not far from Mono's now. And constantly getting closer.

http://shootout.alioth.debian.org/u32/benchmark.php?test=all... <- That still looks sort of far to me.

>> 3. Running dynamic languages on Mono is slow. Look at the speed of all the dynamic languages on Mono (or the JVM for that matter), and compare them to native implementations of dynamic languages, in particular JavaScript and Lua. The native implementations beat dynamic languages on Mono by a large margin, simply because .NET is a bytecode made for static languages.

It's not fair to compare JavaScript, which is already approaching a limit of how fast it can go, with the speed it gets running in Mono. Why? The two implementations have a vast difference of amount of energy and resources thrown at them; had Google, Mozilla, and Microsoft wanted JS to run fast on Mono, it would run fast on Mono.

Also saying that .NET is a bytecode made for static languages is kind of iffy now that the "Dynamic Language Runtime" is a part of .NET

nxn··on We need a programming language for the rest of us
Yeah, I read that Dijkstra paper a while back, I was even considering mentioning it somewhere in my comment, but lost the energy to do so due to the time.

As for formal logic being used in programming languages, while that is true, I am not sure that is what the author was referring to when mentioning "advanced mathematics". Maybe it was because he mentioned calculus early on and that somehow threw me off course, or maybe because I myself wouldn't look at it as something "advanced". Don't know, truthfully, I have no idea what he meant by "advanced mathematics", so I wont deny that it could have been formal logic.

Anyway, I see the point about DSLs and how they could be helpful to the common individual who doesn't want to devote so much of his or her life to mastering an all purpose language. I suppose that's great if you can actually accomplish everything you want that way, but in practice I feel like it would only get a person so far before they were out of options while still needing more. I always looked at DSLs as conveniences and extras to simplify the parts of the problem you don't care to fully concern yourself with. Beyond that scope though, it seems that an all purpose language is still going to be required for the non trivial aspects of coming to a solution, and to also glue all the trivial DSL components together. But hey, we should take any help we can get.

nxn··on Benchmark: C++ vs C#
>> but all you need to know is that Microsoft gave up on using C# everywhere because it's damn too slow.

Got any proof of that?

nxn··on Benchmark: C++ vs C#
I don't know, to me it seems there's a likely chance that Photoshop's implementation of handling large files is just better, and if Paint.NET took a similar approach maybe the performance might be more comparable. By this I mean stuff like not having to go through the whole file to generate a zoomed view of it, etc. Of course this is just an assumption based on the fact Paint.NET isn't in the same class of application as Photoshop, so I wouldn't expect handling massive files to be a priority to the authors. That and Photoshop has been around a lot longer and Adobe probably has more resources to throw at potential problems like this. Either way, these are just guesses to consider before assuming the difference is caused by the language.
nxn··on Benchmark: C++ vs C#
Do you think those programmers would suddenly become "performance conscious" if they switched to c++? What I'm saying is that I don't see the point in referring to them as "c# coders" they could be using any language just as badly.
nxn··on We need a programming language for the rest of us
>> In short, we need a language for those of us who are skilled in fields other than mathematics.

The only language I ever used where I felt my knowledge of mathematics was inadequate was Haskell* . Other than that I don't see the reason why the author feels like programming languages require advanced mathematical concepts. In my opinion it's not the language itself, it's what you're using it for that may require math. And when that is the case, there's absolutely no way you can try and avoid it -- you have to understand how you're solving the problem in order to actually solve it, and this will have to be true regardless of what language you express your solution in.

Anyway, he mentions C a lot, and to me that language was more of an abstraction over how computers work as a machine rather than an abstraction over some mathematical concept of computation. Mind you, my only experience with C is reading K&R and fiddling around with pointers and memory allocation a few times, so by no means can I claim I actually know what I'm talking about. It's just to me it felt like I was concerned with getting some metal to do what I wanted instead of expressing something mathematical, and therefore, I can't follow this person's critique of the language.

* And even in the case of Haskell, a lack of knowing anything about Category Theory did not stop me from getting a basic idea of how and why Monads are so fundamental to the language. It does not stop me from being able to write something in Haskell, etc.

nxn··on Show HN: HN Trends - like Google Trends, but for Hacker News
Hah, I think that's a neat way to visually normalize against the traffic increase trend.
nxn··on A picture I took in Times Square
Hmm, saw the same ad on a billboard somewhere outside of Philly a few weeks ago. Reminded me that I should check the address to see how many pictures they'd have of people wearing headsets on their site. Fun drinking game this.
nxn··on [video] Jeremy Ashkenas And Brendan Eich On JavaScript’s Future
I saw on slide 7 something called "Harmonizr" -- in the context of the video it seems like an ES.next -> JS compiler, but I can't find any info on it online. Does anyone know anything about this? Or is this just some term that was invented for some tool that takes ES.next features and translates them to today's JS? Right now I'm only familiar with the traceur-compiler when it comes to tasks like that.

Makes me wonder if I should start my next JS project in CoffeeScript or ES.next.

nxn··on Ask HN: Any alternative to JavaScript in sight?
I've worked on some larger applications in javascript (though nothing incredibly large), and I can tell you if I had the choice of using any language that offered static and strong typing I'd take it in a heart beat. A small change in one place often means an error in some part of your code you didn't even think would be affected. I've loaded 65k LOC JS files in firebug and webkit's debugger chasing some error down that was happening in some piece of code that I've never seen before. All because that's how far my screw up managed to travel when there is no type checking or strong typing. In that particular case I had set a string value to something that was supposed to have been an array. Something like that would never have happen in, lets say C#, but "crap"[0] or "crap".indexOf("c") or ["c", "r"].indexOf("c") are all valid JS.
nxn··on Ask HN: Any alternative to JavaScript in sight?
Since all of these compile down to javascript, they all suffer from at least some limitations of javascript -- the main one being performance. Yes, all browser manufacturers are trying to make it as fast as they can, but I sincerely doubt I will see the day javascript can run as fast as a statically typed and (jit) compiled language that isn't being executed by the browser. And when I say that, I don't mean little synthetic scenarios where some piece of javascript manages to be faster than something gcc spit out. I've already seen those, and they don't impress me any more so than a hummer being able to look like a ferrari if you get the angle and lights just right.

I'm a fan of P/NaCl for this reason. Their approach goes directly at the problem instead of banging on a square peg for years and years until it barely manages to fit through a round hole. By the way, that is the only way I can describe using html/js/css for application development at this point. If it makes me sound bitter/angry, it's probably because I've been doing it for too long and grown tired of how tedious and limited it is.

nxn··on Microsoft Responds to Horrified Developers on Future of Windows 8
Umm, this video didn't show or say anything that wasn't in the videos that caused the "freak out" to happen in the first place. There was no description of how the new html/js/css development platform is going to work, no mention of how it will integrate with .NET, or if it will integrate at all actually. I'm not one of the people who are freaked out, or even care, about this windows 8 crap, but this honestly answers none of the concerns I've seen people have.

tl;dr: you can't answer a question by saying the same exact thing that prompted the question to be asked in the first place -- this is therefore not a "response".

nxn··on SproutCore 2.0 Beta 1 Released
Oooh, fancy. I wonder why I haven't heard anything about a new UI kit for SC2 until now. Hopefully it will come with a new look, I haven't been digging Ace very much.
nxn··on Why there is no successor of animated Gif format?
Why would anyone even want a Gif replacement? Today they're mostly used for showing short clips of online videos -- when often (almost always) the full video version is a fraction of the size, has sound, shows more of the story, and has audio.

What personally amazes me is that people still use Gifs at all. Back in the day you'd see them as decorations on websites, but that role has been replaced by flash or using javascript for animations. Their only other advantage was transparency, but anyone who doesn't care for IE6 will just use a PNG instead since it offers superior alpha transparency.

Seriously, I don't see any reason to use Gifs these days and so see no reason why a replacement would even be desired.

← PreviousPage 5 of 7Next →