Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ahoge
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
12 ms
·
61.
▲
by
ahoge
11y ago
> does JS have enums? No, but TypeScript and Dart do. Enums don't really work without types. But using Symbols for fake enums is probably a good idea. class Enum { constructor(...props) { props.forEach(p =>
62.
▲
by
ahoge
11y ago
N, E, S, W? I think you want an enum for that.
63.
▲
by
ahoge
11y ago
`Symbol.for` uses a global registry and the whole thing is "stringly typed". Looks like an anti-pattern to me. If you want one particular symbol from some library, you could import it.
64.
▲
by
ahoge
11y ago
> Statcounter is unreliable. StatCounter's stats are very similar to Wikimedia's though. Net Applications is the outlier. I've only seen IE in the #1 position in the stats of corporate extranet applications. For all the
65.
▲
by
ahoge
11y ago
> Microsoft IE has 55% market share. Only according to Net Applications. http://en.wikipedia.org/wiki/Usage_share_of_web_browsers#Sum... Chrome is the #1 everywhere else.
66.
▲
by
ahoge
11y ago
By the looks of it, the physical button is just more annoying to press because it's at the very bottom of the device. You can't easily reach it with your thumb.
67.
▲
by
ahoge
11y ago
> Wet wipes work quite well. Wet wipes are terrible for the sewage system: http://www.nytimes.com/2015/03/15/nyregion/the-wet-wipes-box... > [Wet wipes] are about $2.50 a pack, or $20 for a metr
68.
▲
by
ahoge
11y ago
There are, however, many Americans who started to use wet wipes because they want to feel cleaner. Bidet attachments and bidet seats ("washlets") are much cheaper in the long run and they also aren't a problem for the sewage
69.
▲
by
ahoge
11y ago
One would think that 20 additional characters per function don't really matter if you can save 100 keystrokes. Compared to JavaScript, I have to press fewer keys when I write Dart. (This would be also true without shorthands like metho
70.
▲
by
ahoge
11y ago
> but it's not a programming language you're selling me, it's a whole environment Well, yes, because programming languages don't exist in a vacuum. The currently available libraries, tools, and documentation are ver
71.
▲
by
ahoge
11y ago
With optionally typed languages like Dart and TypeScript, you only have to add types to things like fields and functions/methods to get all the tooling benefits. Type inference takes care of the rest. Secondly, you should be able to au
72.
▲
by
ahoge
11y ago
> The behavior of Number, Boolean, String, and Array is well-defined, it's safe to call them without new. ES6 is packed with weird but well-defined things. The problem is that calling a constructor function (a PascalCase'd fu
73.
▲
by
ahoge
11y ago
That's from IEEE 754 (a standard for floating-point arithmetic). `NaN` and -0 exist for the same reason.
74.
▲
by
ahoge
11y ago
Since calling constructor functions without `new` is generally an error, I'd rather use `parseFloat`.
75.
▲
by
ahoge
11y ago
Intel's (Cordova-compatible) Crosswalk project supports SIMD: https://crosswalk-project.org/
76.
▲
by
ahoge
11y ago
I don't think any of the languages which were introduced 20-25 years ago would make it. All modern languages and all current iterations of the older languages are vastly superior by every imaginable metric. All those 1.0s from the past
77.
▲
by
ahoge
11y ago
GWT is a set of tools which allows you to write JS front-end applications in Java. Polymer is a library for creating Web Components.
78.
▲
by
ahoge
12y ago
There was an article in the past. Well, that's just how Wikipedia is. The Node.js article, for example, has only been undeleted by an admin because someone mentioned it in some "Wikipedia is lame" thread on Reddit.
79.
▲
by
ahoge
12y ago
Not a problem with named arguments. Too bad that they really screwed that up with ES6: function foo({a = 1, b = 2} = {}) {...} Dart's syntax is a lot easier to remember: foo({a: 1, b: 2}) {...} Another very important
80.
▲
by
ahoge
12y ago
It's a shame that there was never a good PC version. If I remember correctly, Wipeout 1 had proper timing, but it only offered software rendering. There was one version with hardware acceleration, but it used some crappy proprietary 3D
81.
▲
by
ahoge
12y ago
Many of the bigger "JavaScript" projects aren't written in JavaScript. Browsers support any language. As long as they compile to JavaScript, that is. Also, Dart just works fine. Inside browsers as JavaScript and outside brows
82.
▲
by
ahoge
12y ago
Dart also works outside of browsers. The standalone VM can be used to write command line tools and web servers. You can interact with native libraries and you can also embed it in other applications. It offers excellent tooling and good per
83.
▲
by
ahoge
12y ago
The port number is supposed to be a 16-bit number though. So, anything above 65535 is malformed. http://en.wikipedia.org/wiki/Port_%28computer_networking%29
84.
▲
by
ahoge
12y ago
> Dart now always compiles to JavaScript Client-side Dart code, yes. But that's something you had to do for compatibility reasons anyways. Also, don't forget that Dart also exists outside of browsers. It's a fast scripti
85.
▲
by
ahoge
12y ago
> Angular 2.0 [...] doesn't fix any of today's problems Directly followed by: > Views and data-binding are a mess, and seriously degrade performance Want to have your cake and eat it, too? Angular 2.x does simplify thing
86.
▲
by
ahoge
12y ago
> Don't use that in prod A linter will catch this.
87.
▲
by
ahoge
12y ago
IE11 actually does some of the JPEG decoding on the GPU: http://blogs.msdn.com/b/ie/archive/2013/09/12/using-hardware... So, this really doesn't work as a joke.
88.
▲
by
ahoge
12y ago
As a web developer or user, you can't really see the similarities anymore. The basic stuff like CSS 2.1 works the same everywhere. It's the new features where the browsers differ. http://caniuse.com/#compare=ie+TP,
89.
▲
by
ahoge
12y ago
They should be over 100k commits apart by now. A lot happened in those 2 years.
90.
▲
by
ahoge
12y ago
This is the biggest release since 1.0. Async/await and generators are a welcome addition. Shareable server sockets and better isolates are also nice to have. Enums are currently rather disappointing though. They went with the simplest
More ›