Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
spion
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
66 ms
·
751.
▲
by
spion
7y ago
I can't help but think that shadow-flagging these accounts would be more useful than blocking or deleting them. Blocking/deletion looks like censorship, like someone is deliberately trying to hide something you're not suppose
752.
▲
by
spion
7y ago
what if the overly restrictive character limit causes a decrease in naming clarity?
753.
▲
by
spion
7y ago
So in China, the government owns the corporations, while in the USA, the corporations own the government.
754.
▲
by
spion
7y ago
It will, since the object returned by the tag is not a string.
755.
▲
by
spion
7y ago
Type parameters are more like function arguments, not loop variables. There is often one or two arguments too but they are not as local (contained) as loop variables.
756.
▲
by
spion
7y ago
The one-letter "naming convention" used for generic types by most developers is very unfortunate.
757.
▲
by
spion
7y ago
You can substitute all generically typed items with the type interface {}. That's how much is known about the object - basically nothing. You can substitute generics that conform to a contract by their contract.
758.
▲
by
spion
7y ago
Yeah I've often wondered if many of the heroes we celebrate might be heroes by means of being at least a bit selfish and less of an ideal team player :) Its interesting to read that that might be the case even with J.C. An amazing engi
759.
▲
by
spion
7y ago
The 10x label, especially as described by the tweet that started the tweetstorm is the situation which you may encounter when someone who designed the system understands it yet its not comprehensible to anyone else, because either: * their
760.
▲
by
spion
7y ago
Youtube/Google?
761.
▲
by
spion
7y ago
Hoisting is still lexical, except the scope is function level. But the point is moot, since we have `let` which behaves "normally" now. `this` is not non-lexical scope, its argument passing. Its the most confusing wart in JS but
762.
▲
by
spion
7y ago
I never understood why this is necessary. Using promises means you get to use try-with-resources style construct for handling non-memory resources safely. As such you no longer need to crash on uncaught errors, except errors pertaining to r
763.
▲
by
spion
7y ago
I'd like to see the type signature of that `_` construct. It seems to me like the bind operator would've made the extra complexity unnecessary.
764.
▲
by
spion
7y ago
With partial application the situation is mitigated somewhat but bind offers other benefits by being a decent primitive to help explain how JS `this` works. I wonder if there is a way to revive the proposal...
765.
▲
by
spion
7y ago
Zero-copy message queue would be an unnecessary micro-optimization for most backends I've worked on. I don't think its something you would normally do in typical back-end programming, unless your scale is bonkers-level or you'
766.
▲
by
spion
7y ago
And plenty of people have said otherwise, and have developed entire languages and formal method frameworks to better reason about these problems. (e.g. TLA+) So anyway... what would you use shared memory parallelism for in typical back-end
767.
▲
by
spion
7y ago
"Race conditions of threads with shared memory parallelism" - yes you can avoid those in JS, the "yield" points are obvious in all code (await). Although its there if you need it (SharedArrayBuffer) Regarding whether its
768.
▲
by
spion
7y ago
Have considered you that suck conditions race more with threads and shared memory parallelism? If your counter-suggestion is Rust, have you considered.unwrap() that.unwrap() thinking.unwrap() about.unwrap() managing.unwrap() memory.unwrap()
769.
▲
by
spion
7y ago
That is true, and node's official advice in this regard is bad. It comes from previous bad designs of error handling and leaking resources (file descriptors mostly) caused by domains. However, modern node code typically uses promises a
770.
▲
by
spion
7y ago
Why do you believe that JavaScript isn't lexical? My understanding is that it is. Do you mean the behavior of `this`? Its similar to Lua in that `this` is actually an implicit function argument (passed left of the dot) but thats defini
771.
▲
by
spion
7y ago
Is the design better in some fundamental way, or is it just about equality comparison and other shallow "wtfs"?
772.
▲
by
spion
7y ago
https://nodejs.org/dist/latest-v12.x/docs/api/worker_threads...
773.
▲
by
spion
7y ago
I believe it was due to programs (mainly games) that relied on clock speed to work. If you ran some of them with turbo, they were so fast they were unplayable.
774.
▲
by
spion
7y ago
Since this is the top comment, for anyone that got overly excited like I did - no, there are no HKTs in TypeScript yet unfortunately.
775.
▲
by
spion
7y ago
No, this works on any overlapping types too - even unsound combinations such as `T | Array<T>`
776.
▲
by
spion
7y ago
How about examples of open source code to learn whats really, really good, together with why it was designed that way? Seems like that would be way more useful. Or examples of projects that did things one way, but later refactored, and why
777.
▲
by
spion
7y ago
We used https://github.com/brianc/node-sql but it unfortunately stopped being maintained, so now we maintain our own fork.
778.
▲
by
spion
7y ago
yes
779.
▲
by
spion
7y ago
Would that be a "RRM" (Record-Relational mapper)? If so we're already on board (in a different language). P.S. I bet you would never guess which typed language with great support for records makes it easy (for the most part)
780.
▲
by
spion
7y ago
I've come to the exact opposite conclusion. The query DSL for ORMs is fine, works well in a large majority of the situations. When it gets problematic, you can almost always drop down to pure SQL. The mapping part of the ORM on the oth
More ›