Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
alangpierce
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
18 ms
·
91.
▲
by
alangpierce
8y ago
There's probably existing code out there that relies on `arr[-1]` returning `undefined`, e.g. looping backward through an array until it gets a falsy value. You can also assign to `arr[-1]` and it'll work (it assigns to a new -1 k
92.
▲
by
alangpierce
8y ago
> Unfortunately, to get the last element we still have to do the clunky javaScriptArray[ javaScriptArray.length - 1 ] technique. This ... has always seemed like a major oversight in the ECMAScript standard. Sort of an aside, but there&#x
93.
▲
by
alangpierce
8y ago
One fun use case is that you can use proxies to detect accesses to nonexistent properties of JS objects, and you can then throw or log a warning rather than having them just return undefined. Unclear if you'd want to do that everywhere
94.
▲
by
alangpierce
8y ago
Certainly, taking a nontrivial percentage of global revenue will force Google's attention, but I'm not convinced that's the best way to think about it. One thought: if Google had just served non-personalized ads (or personali
95.
▲
by
alangpierce
8y ago
Yeah, it's the syntax when calling a generic function, e.g. `Array.of<number | null>(1, 2, null);` has return type `Array<number | null>`. You usually don't need to specify the type since TypeScript can figure it out,
96.
▲
by
alangpierce
8y ago
TypeScript code can be transpiled and executed even if there are type errors (just like how a linter doesn't stop you from running your code), so in that sense, it's also valid TypeScript.
97.
▲
by
alangpierce
8y ago
Browsers certainly collect runtime types of variables in hot code paths, but that's pretty different from the whole-program static verification that TypeScript does. TypeScript is designed to have an expressive and flexible type system
98.
▲
by
alangpierce
8y ago
CoffeeScript and TypeScript are different enough that I don't think TypeScript could possibly have the same fate. CoffeeScript was all about syntax sugar, but 95% of the value of TypeScript is the typechecker that runs in your dev envi
99.
▲
by
alangpierce
8y ago
In addition to the "more approachable to contributors" answer, Flow and TypeScript are easy to port between, since they're both light extensions to JS and have almost the same syntax. I've done a Flow to TS port a few ti
100.
▲
by
alangpierce
8y ago
Funny, I read through the article and didn't even notice that it barely addresses "Why It Is Important". I wonder if the author took it for granted and overlooked the real justification part. I did find it a useful little art
101.
▲
by
alangpierce
8y ago
Seems like maybe there's a balance here. On one hand, JS was designed with a particular vision (prototypal inheritance, etc.) and it's good for programmers to understand and follow that vision. On the other hand, even JS experts a
102.
▲
by
alangpierce
8y ago
I'd say it's a fundamental language design question of how to properly mix classes and first-class functions, and there's no clear answer. More specifically, if you access `myInstance.myMethod` without invoking it, what shoul
103.
▲
by
alangpierce
8y ago
My take is that `this` is fine and straightforward as long as you follow a few rules: 1.) `this` should only be used inside a class method. 2.) Never use `someClassInstance.someMethod` as a value (invoking it is ok, but accessing it witho
104.
▲
by
alangpierce
8y ago
It depends a lot on the person. I know vegetarians who are disgusted by anything like meat and hate the Impossible Burger because it's too close to meat. For me, though, I've been vegetarian for a few years and I have fond memorie
105.
▲
by
alangpierce
8y ago
Plant-based foods are almost always significantly more efficient to produce than meat since you no longer need to grow all of the food to feed an animal for its entire life. From another article ( https://www.cnet.com/news&#
106.
▲
Meat-free 'Impossible Burger 2.0' tastes even closer to the real deal
(engadget.com)
390 points
by
alangpierce
8y ago
|
525 comments
107.
▲
by
alangpierce
8y ago
You can argue that "it's not so bad, just learn it", but the confusion from domain-specific jargon can really add up, from my experience, and I think more understandable terminology is almost always better. I think that if we
108.
▲
by
alangpierce
8y ago
My reading was "machine learning".
109.
▲
by
alangpierce
8y ago
Looks like here's the original announcement, which has more background on motivations and has a comparison with regular Courier: http://johnaugust.com/2013/introducing-courier-prime
110.
▲
by
alangpierce
8y ago
Two that come to mind are trouble sleeping and lack of concentration, plus maybe social withdrawal (at least from most friendships). But still, seems like a stretch; most depression symptoms are pretty unambiguously negative.
111.
▲
by
alangpierce
8y ago
My understanding is that this Facebook program only focuses on cases where involuntary intervention feels justified, e.g. someone publicly saying that they're going to kill themselves. But I agree that it would be great if there were m
112.
▲
by
alangpierce
8y ago
Agreed that privacy is a real concern with a system like this, though my comment was specifically focusing on the "worry of false positives" concern. I certainly don't claim that Facebook is in the clear from a privacy standp
113.
▲
by
alangpierce
8y ago
That's fair, I guess in my ideal world, law enforcement would just act on the factual information rather than being biased by the fact that a Facebook person reported it as a concern. But as evidenced by things like swatting, police ar
114.
▲
by
alangpierce
8y ago
> Mason Marks ... argues that Facebook’s suicide risk scoring software, along with its calls to the police that may lead to mandatory psychiatric evaluations, constitutes the practice of medicine. He says government agencies should regul
115.
▲
by
alangpierce
8y ago
Interesting, the "stitch together a bunch of substrings of a large string" task also comes up in DNA sequencing: the physical process basically randomly samples a bunch of snippets that are each a few hundred bases long, and you n
116.
▲
by
alangpierce
8y ago
I understand that neither a purchase nor an investment will get any return if the company goes bankrupt like in this situation, but I think they're very different when deciding who to blame. In an investment, the investor is intentiona
117.
▲
by
alangpierce
8y ago
My impression is it was framed as a regular purchase, not an investment. Xcor owes them a full refund, and the only reason it won't happen is due to bankruptcy protections.
118.
▲
by
alangpierce
8y ago
My reading of it was that product50 was providing additional relevant information and context, which I personally found interesting and useful. I didn't at all get the impression that product50 was trying to make an argument like "
119.
▲
by
alangpierce
8y ago
Not to derail the core message, but one learning approach I've enjoyed in the past is to come up with a list like this and then try to learn a little bit about all of them. Doesn't need to be deep knowledge, just a basic "hel
120.
▲
by
alangpierce
8y ago
> It is much better to be underestimated than to be overestimated Being constantly underestimated probably doesn't feel so great when it's hard to find employment or when people don't respect your technical opinions.
More ›