Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ahoge
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
16 ms
·
91.
▲
by
ahoge
12y ago
For me, it is. Well, its semi-useless enums suck, but other than that I'm quite happy with it.
92.
▲
by
ahoge
12y ago
Dart is natively supported outside browsers. There is the standalone VM, which you can use just like Node.js, and the VM library, which you can embed in native applications. The VM is crossplatform and it even supports ARM and MIPS. They
93.
▲
by
ahoge
12y ago
> JS is getting nearly every Dart feature with ES6 and ES7 With ES8 or ES9, maybe. By the way, optional named arguments with default values look atrocious in ES6. ES6: function foo({a = 1, b = 2} = {}) {…} Dart: foo({a: 1, b: 2}) {…} D
94.
▲
by
ahoge
12y ago
Maybe it would be a good idea to add a note in the meantime. I was quite confused when the module stuff was gone. I assumed it was moved to ES7, but it didn't show up there either. I finally learned the truth after googling a bit and f
95.
▲
by
ahoge
12y ago
> Is option number 1 "Use JavaScript Carefully" really that hard? Writing larger applications in a team isn't impossible with JavaScript. It's just needlessly difficult. Well, even if it's just me, after a few
96.
▲
by
ahoge
12y ago
> That's still only $72 a year, man. You didn't include the regular TP. With a bidet or washlet, you'll need a lot less of that, too. > $500 on toilet seats? There are much cheaper options available. As another comm
97.
▲
by
ahoge
12y ago
Bidets and washlets are the more economical option anyways. Wet wipes aren't cheap. Even if you spend $250+ on a somewhat fancier "warm water cleaning toilet seat", you'll break-even in no time. That's even true if
98.
▲
by
ahoge
12y ago
What does "turning into Java" even mean? What exactly are you afraid of? Having actual integers? Threads? Better tooling? The `class` keyword? It makes the code less verbose. Optional types? Would you rather write JSDoc comments
99.
▲
by
ahoge
12y ago
Define "get to work". I mean something like this: https://atom.io/packages/ide-flow Tool-tips, call-tips, auto-complete, type checking, and so forth. The kind of stuff you get with TypeScript or Dart.
100.
▲
by
ahoge
12y ago
Angular 2 is heavily inspired by AngularDart. Angular 2 has a single codebase for JS and Dart.
101.
▲
by
ahoge
12y ago
Flow doesn't work on Windows yet. Atom seems to be the only editor which supports it. That plugin had its 2nd release just 3 days ago.
102.
▲
by
ahoge
12y ago
If you add gzip compression, it's still smaller than doing the same thing with jQuery. "dart:html" provides an idiomatic DOM API where all list-like things are actually Lists, events are streams, Futures instead of callbacks,
103.
▲
by
ahoge
12y ago
> And the size of helloworld.dart.app.js is 102k No, it's not. dart2js --minify hello.dart -o hello.dart.js Results in a 5 KB JS file. This game is 35 KB (procedural graphics included): http://mbtic.com/game
104.
▲
by
ahoge
12y ago
Because Dart isn't a viable option for writing libraries or frameworks which are meant to be used from JavaScript. You can interact with JS libraries, but exposing some API to JS-land is a completely different matter. There are some va
105.
▲
by
ahoge
12y ago
You didn't answer my questions. I have no doubt that untooled unitypedness can be improved upon.
106.
▲
by
ahoge
12y ago
> Why? Just get the machine to do it. I meant the writing stage, not the checking stage. Imagine you don't know which type to pass. So, you'd have to pass something (null or whatever) in order to generate an error which gives
107.
▲
by
ahoge
12y ago
The inference example is actually a good illustration for why you want to add types to a function's signature. As the author mentioned, a machine can look at how the arguments are used and make some educated guesses. The big problem is
108.
▲
by
ahoge
12y ago
> Was it really necessary to add "class" syntactic sugar? Yes. Now your editor/IDE knows that that thing is supposed to be a class. The doc generator also knows that it's a class. Furthermore, this makes things mo
109.
▲
by
ahoge
12y ago
The behavior of strict mode would have broken existing code. That's why you have to opt-in. New syntax, on the other hand, can be added without breaking existing code. These new constructs would have been syntax errors beforehand.
110.
▲
by
ahoge
12y ago
You can't use these control characters in CSV either. The grammar from RFC 4180 excludes the 0x00 to 0x1F range.
111.
▲
by
ahoge
12y ago
From "3. MIME Type Registration of text/csv": Common usage of CSV is US-ASCII, but other character sets defined by IANA for the "text" tree may be used in conjunction with the "charset" parameter.
112.
▲
by
ahoge
12y ago
RFC 4180 does not specify the character encoding. This isn't a problem with JSON, XML, ASN.1, Protobufs, or Thrift. Anything other than CSV, really.
113.
▲
by
ahoge
12y ago
> what's wrong with [CSV]? The encoding, line endings, and the used separators are random. Encoding/decoding behavior may be locale-dependent. E.g. if you use Excel with a de-DE locale to create a CSV file, Excel with a en-US
114.
▲
by
ahoge
12y ago
http://en.wikipedia.org/wiki/Type_safety Aggressive type coercion is not type safety. It does not prevent type errors. It just sweeps them under the rug. 5 - 'foo' That's a type error. It's
115.
▲
by
ahoge
12y ago
> I got into programming before the web and was mostly self-taught,[...]. My biggest challenge was finding enough information. I had the same problem. I had one tiny pocket book with less than 150 pages and Turbo C's built-in help
116.
▲
by
ahoge
12y ago
In case anyone wonders about that reverse-for loop in updateCircles(): Iterating over an array in reverse allows you to remove items in the same iteration (at the very end of the loop). If you delete an item, the items which follow are down
117.
▲
by
ahoge
12y ago
> intercooler doesn't have an entry point. It does. There is an IIFE which is run when the script is loaded. Right before the object is returned to the global "Intercooler" variable, a callback is registered via a jQuery
118.
▲
by
ahoge
12y ago
> Well, it's a library, not a framework: you can use it for as much or as little of your app as you like with as little as a single attribute declaration doing something useful for you. If it has an entry point, it's not a li
119.
▲
by
ahoge
12y ago
"No framework"... so here is a framework. Uh hu. Anyhow, move that "use strict;" line into the IIFE. If it's global, you can't merge that file with other files. Some of the code out there breaks in strict mode.
120.
▲
by
ahoge
12y ago
The caps lock key is very useful, if you rebind it to something else. I use it for Enso, which lets you start programs, open files, spellcheck, count words, do math, and things like that. Using it to swtich between input methods is another
More ›