HNHacker News
TopNewBestAskShowJobs

ahoge

1,026 karma · joined December 11, 2011

submissionscomments
ahoge··on The genius and folly of MongoDB
RethinkDB still doesn't support Windows. [1]

Most developers who use Windows will just go with something which doesn't require a virtual machine. For example, MongoDB, CouchDB, OrientDB, Cassandra, and ArrangoDB work fine everywhere.

[1] https://github.com/rethinkdb/rethinkdb/issues/1100

ahoge··on IE11 on Windows 8.1 - Google Search loads in legacy mode
Compatibility view doesn't just change the UA string. It actually switches to a different (IE8-like?) engine.
ahoge··on Why we revert to original titles
Just add a note [1] right below the title field.

There is very little stuff on that submit page. If there are 1-2 sentences, people will read them.

[1] E.g.: "The title must be the bare title of the linked article. Do not editorialize the title unless it's too long or lacking context."

ahoge··on TypeScript and the Road to 1.0
> heavy IDEs

If your machine has 6+ GB of RAM, it doesn't really matter if some IDE uses like half a gig of that. I mean, that's why you bought all that RAM in the first place, isn't it? The point was to use it, right?

Same deal with all those beefy cores. Giving one of them a little bit of work won't hurt one bit.

The only actual downside is that start up takes quite a bit longer than 100msec. However, if you're using it all day, it doesn't really matter if it took 15s to start, does it?

I believe that one should automate as much as possible. Offloading as much brain-dead repetitive work as possible to machines is always a good idea.

So, check if I use the right kind of arguments. Check if that thing has that field or method. Tell me if there are any methods which start with "foo" and if so, tell me their exact names, arguments, and return values. Tell me if the change I just did broke something.

That's the nice thing about machines. They will happily do this stuff over and over again, a thousand times a second. They'll never get tried of it. They'll never complain.

One thing I really dislike about JS is having to check documentation. If you want to use some library/plugin/whatever, you always have to go to its website, navigate to the docs, and then navigate to the specific section. Just to look up the arguments or the names/types of that config object you have to pass to that function.

It's so much nicer and also way faster to do that kind of thing directly in the IDE.

> enjoy TS

I use Dart. And yes, I do enjoy it. It's very pleasant to use.

ahoge··on TypeScript and the Road to 1.0
> File headers?

No.

> Interfaces?

Implicit interfaces. It's kinda handy.

> Java-style OOP in my JS?

I'm not sure what qualifies as "Java-style" OOP. Is the stuff from ES7 also "Java-style"? How about the stuff from CS?

Well, you don't have to use classes. You can do everything with functions if you want.

> I think we're both just stating subjective opinions [...]

The difference is that I actually tried it.

ahoge··on TypeScript and the Road to 1.0
> that's about a certain IDE not the language itself

This stuff is only possible if you can analyze the code statically.

With JS, which is running in a browser, you don't know anything. You don't know what other kinds of scripts are running on that page. You don't know which globals these introduce or which built-ins they modify.

E.g.:

    Math.round(5).length
You don't know if Number has a length property. You don't know if "round" takes a Number as argument. You don't know what this "round" function returns. You don't know if the "round" function exists. You don't know if a "Math" global exists.

For tools, this is a big problem.

In Dart, the analyzer knows about all these things. If the function is annotated, I'll get all the tooling and checks.

> Care to back that up?

No. You can't even imagine what good tooling is like. Naturally, you're blind to the friction which is caused by a lack of good tooling.

ahoge··on TypeScript and the Road to 1.0
> AMDs like Require.js or CommonJS

That stuff is terrible to use. There is quite a bit of boiler plate involved and there is lots of overhead in general.

Secondly, there are about 10 somewhat popular module formats and they aren't compatible which each other.

I rather do this stuff declaratively. If it's baked into the language, your tools will understand what's going on and there also won't be any compatibility issues. Naturally, it's also way more convenient to use. You just import something. Done.

> doesn't need static typing or other features from TS/Dart

You also don't need a seat belt or airbags. If you don't make any mistakes, you'll be fine.

However, from a pragmatic point of view, these static checks are very handy. If you rewrite some parts of your code, the analyzer will tell you if you screwed something obviously up. It catches all the stupid mistakes, which means you can fully focus on the logical ones.

With JavaScript/Python/etc you have to run the code and actually hit that particular branch to trigger some sort of error/exception which will eventually help you to identify the actual issue.

You should just give it a try. Try any language/IDE combination which offers good tooling. Tooling can remove a lot of friction. There really is a point to all of this.

ahoge··on TypeScript and the Road to 1.0
> By "autocomplete" you mean [...]

All the fields and methods are known. If I write "someObject.", then I'll get a calltip which lists all fields/methods from this particular class and I can auto complete them. You can conveniently browse around like this to find the right method.

If I write "foo.bar" and "foo" as no "bar" field, I'll get a squiggly line (and of course I also wouldn't have been able to auto-complete "bar").

It's similar to writing C#, AS3, or Java with a good IDE. If you have never experience any of that, maybe you should give it a try.

> It's possible to build scalable systems in JS/CS without what TS/Dart offers.

Sure. It just requires more time and money.

You can, for example, also chop down a tree by using an axe instead of a chainsaw. There is always a more difficult more time consuming way to do something.

ahoge··on TypeScript and the Road to 1.0
> [JS generated from CS] runs faster [than JS generated from Dart]

There are cases where output from dart2js outperforms handwritten JS. Nowadays, the performance of the generated JS is generally pretty good.

> it runs faster thus has its strength in scaling

"Scaling" as in: more developers, more files, more lines of code. Bigger projects.

CS doesn't help with that one bit. It's just as difficult to handle as JS. This is why Google came up with stuff like the Closure Compiler, GWT, and now Dart.

> Syntax is the only thing we can compare.

There are also semantics and the whole environment. Syntax is a small fairly unimportant detail.

ahoge··on TypeScript and the Road to 1.0
> That sounds like an IDE/editor feature, not a language feature.

Being toolable is a language feature. You can't do these things with JS or CS, because your tools don't have a clue what's going on. You can only do some guessing.

ahoge··on TypeScript and the Road to 1.0
Yes, but that's just some syntactic sugar. That stuff doesn't help with tooling/scaling.

By the way, Dart also has optional named/positioned arguments, sane for-in loops, and string interpolation. It also offers proper lexical scoping (oh, yeah!) and even operator overloading.

ahoge··on TypeScript and the Road to 1.0
>[TS and CS] both basically solve the same problems

TS (or Dart) makes JS more toolable and thus more scalable. CS, on the other hand, just offers a keystroke reduction by dropping the "function" keyword, semicolons, and other punctuation.

TS and Dart also reduce the number of keystrokes though. They allow you to auto-complete pretty much everything.

ahoge··on TypeScript and the Road to 1.0
>Does optional typing really work?

From my experience with Dart, I'd say it can work really well. Basically, if you just put type annotations at the API boundaries, you already get most of the type related benefits you would get with something like Java or C#.

Inside your functions, you can generally omit types. For the tools, there is enough type information floating around to make sense of everything.

If you use a literal, the type is known. If you use some annotated function, the type of the return value will be known. If you assign any of these things to "var", the actual type will be remembered. This means you get sanity checks, call-tips, and auto-complete without having to annotate the types there.

Putting types at the API boundaries also acts as documentation. It's so much better than writing JSDoc comments. Plus, you get all the benefits right away. It's a very sweet deal.

ahoge··on Poll: What are your liked and disliked programming languages?
It's a quirky dialect of JavaScript, which has very little to offer. There is less typing, but that certainly wasn't JavaScript's biggest issue.

With languages like TypeScript, or Dart, you also reduce the amount of typing work, but that's just a side-effect of the good tooling these languages have to offer. You can auto-complete everything.

It makes a lot more sense to boost productivity via structure and tooling, because that's what really helps with scaling.

ahoge··on Firefox fixes save gigabytes of memory on image-heavy pages
I don't really use bookmarks myself. Well, you could always just use Alt -> Bookmarks, right?
ahoge··on Firefox fixes save gigabytes of memory on image-heavy pages
If you close your tabs via mmb or Ctrl+W, you can remove all those close buttons, too.

browser.tabs.closeButtons;2

ahoge··on Firefox fixes save gigabytes of memory on image-heavy pages
> Bad use of screen-space

Slightly customized Firefox 24: 54 [1]

Chrome 31: 61

IE10: 55 [2]

Opera 12: 61

[1] http://i.imgur.com/eBiIZHc.png (Also, no close button on tabs and they shrink down to the size of pinned tabs. All other browsers do that shrinking stuff by default. There used to be a property for that, but one developer decided to remove it. Now you need a custom userChrome.css and other voodoo.)

[2] Sounds close, but 50% of that space are actually unused. There is a lot less room for tabs.

ahoge··on Why have SVG images not yet replaced PNG on the web?
It's from recommendation to recommendation.
ahoge··on Why have SVG images not yet replaced PNG on the web?
> we won't see another full release until SVG 2 which is expected in 2014, over a decade later!

HTML4: 1998

HTML5: 2014

ahoge··on Solved By Flexbox – Cleaner, hack-free CSS
On the web, Vista's share is smaller than XP's.

StatCounter[1]: XP 20.58%, Vista 5.21%

Among gamers, XP and Vista are about equally unpopular.

Steam[2]: XP32 6.83%, XP64 0.35%, Vista32 5.18, Vista64 2.32%

[1] http://gs.statcounter.com/#os-ww-monthly-201208-201308

[2] http://store.steampowered.com/hwsurvey

ahoge··on If PyPy is 6.3 times faster than CPython, why not just use it?
I recommend to use a set of toy programs like those from the Benchmarks Game. Some nested loops with a little bit of string concatenation won't really tell you anything useful.
ahoge··on Louis C.K.: I won't let my kids have cell phones
>Phones can probably be related to board games or cards of the years past.

Except that phones are pretty much the opposite of that. Thanks to the magic of today's phones you won't have to deal with those boring people who happen to be in the same room as you.

ahoge··on I Am An Object Of Internet Ridicule, Ask Me Anything
Opinions on the internet are always extremely distorted. It's not like a survey where you make a bunch of random people answer some questions. It's several cycles of selection bias and network effects. It's kinda bizarre, actually.

In general, most people are indifferent. They won't feel compelled to comment on it. Naturally, you only get comments by people who have a sufficiently strong opinion on that particular topic. If you now add voting to the mix, you emphasize this distortion even more.

Now, the reason why it works this way is because it makes it interesting to those who participate in these discussions. That's the primary goal: encouraging user interaction.

It does not paint an objective picture of the community's opinion.

--

When I first saw that image about a year ago, I just thought he tried to create a distraction-free environment on a low budget.

I had no reason to comment on it.

If I had commented on it, my comment wouldn't have received many upvotes, because it wouldn't be aligned with this particular audience. That is, those who'd feel compelled to comment on this kind of picture.

ahoge··on RedScript – like CoffeeScript, in Ruby
Had the same argument about a year ago. No, once you override it, it's gone. The value of the font-family property is a single list, not a list of lists.

Example: http://i.imgur.com/8TLBd.png

It doesn't work with inheritance and it also won't work if the very same selector is used. E.g. if you add:

    .comment{font-family:foo}
to the current stylesheet, you'll get Times New Roman (or whatever your browser's default font is.)

Hence this line:

http://www.w3.org/TR/CSS2/fonts.html#font-family-prop

"Style sheet designers are encouraged to offer a generic font family as a last alternative."

ahoge··on RedScript – like CoffeeScript, in Ruby
It's only monospaced if your machine has one or more of these fonts installed:

    Monaco,"Bitstream Vera Sans Mono","Lucida Console",Terminal
Font stacks should always end with a generic font family keyword. In this case: "monospace".
ahoge··on Web development in C: Crazy?
JavaScript is a C-like language though. It looks like C. It borrowed its syntax and even many of its keywords.

Also, in some of his earlier talks he said that it looks familiar to C or Java developers (because it's a C-like language) and that this perceived familiarity is the reason why most people don't bother learning the language.

ahoge··on Apple’s Fingerprint ID May Mean You Can’t ‘Take the Fifth’
Well, the usual smear across the screen gesture can be "cracked" by looking at the screen at an angle. Secondly, there aren't many patterns you can conveniently enter with the thumb of your dominant hand.
ahoge··on It's not the $7, but the principle
Well, "tricked"... sounds more like a silly bug to me. Stuff like this is easy to miss during testing, because you test these things in isolation.
ahoge··on Introducing Brick: Minimal-markup Web Components for Faster App Development
>why are we making brand new HTML elements for things[?]

    <div class="Foo">...</div>
vs

    <x-foo>...</x-foo>
Semantically, as far as machines are concerned, there is no difference between these two. For humans, however, the latter is way easier to read if there are some lines between the opening and the closing tag.

Custom elements also allow you to create your own shadow DOM, you can have your own "native" functions, and there is also some scoping for CSS.

ahoge··on WebM for Internet Explorer
>it will get discontinued like every other google project

Yes, of course it will get discontinued at some point. Just like any other software project by any other company.

This particular project is similar to Chrome Frame. It's a stopgap solution. It adds/polyfills functionality which should be there out of the box. It's supposed to lose its raison d'être. That's what we're all wishing and waiting for.

← PreviousPage 11 of 16Next →