Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
jgwil2
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
105 ms
·
691.
▲
by
jgwil2
6y ago
Trump accelerated the abandonment of the GOP by suburban and educated voters. These trends line right up with Virginia's demographic changes over the last 20-30 years. So it's not all attributable to Trump, but he certainly accele
692.
▲
by
jgwil2
6y ago
Gah! So mad I just bought the first edition!
693.
▲
by
jgwil2
6y ago
If he's been out in that weather long enough to fall asleep, he needs medical intervention.
694.
▲
by
jgwil2
6y ago
Recently came across a related article in a series on design pattern equivalents in FP, "Visitor as a sum type".[0] [0] https://blog.ploeh.dk/2018/06/25/visitor-as-a-sum-type/
695.
▲
Climate Warning Lurking in the Earth’s Ancient Rock Record
(theatlantic.com)
1 points
by
jgwil2
6y ago
|
0 comments
696.
▲
by
jgwil2
6y ago
In the fixed version of #3, the function return type is `Product[]` instead of `any`. The example is further refined in #4. What type guards are good for is marrying the compile time checks with runtime safety. They allow TSC to infer that
697.
▲
by
jgwil2
6y ago
I've definitely used them in the way the article describes. Think about an API that gives a list view and then a detail of an object that has more properties than are sent in the list view (maybe because they are expensive to compute o
698.
▲
by
jgwil2
6y ago
Yeah, the example just shows the "even better" option: it gives a default value for the date parameter.
699.
▲
by
jgwil2
6y ago
I think I agree with you (though I would favor T, U, V as the sequence). What would the alternative look like in what you wrote? In and Out? Range and Domain? Generic type variables are often too abstract to give a sensible name to. This is
700.
▲
Bad TypeScript Habits
(startup-cto.net)
246 points
by
jgwil2
6y ago
|
240 comments
701.
▲
by
jgwil2
6y ago
This is not an apt analogy at all. You don't recompile your editor to get type errors. The question is type checking vs unit tests. If your text editor can type check as you type, the feedback loop is much tighter than recompiling and
702.
▲
by
jgwil2
6y ago
> I have never had a static type checker (regardless of how sophisticated it is) help me prevent anything more than an obvious error (which should be caught in testing anyway). This is the static vs dynamic type debate in a nutshell. Per
703.
▲
by
jgwil2
6y ago
> This feature, called tail call optimization (or TCO), has been around for a few decades and it is a sad commentary on the state of our programming languages that none of the modern languages support it. TCO is part of ECMAScript specif
704.
▲
by
jgwil2
6y ago
I have to admit whoever at DeBeers managed to make "three months' salary" the common price guideline was a marketing genius.
705.
▲
by
jgwil2
6y ago
Actual title: "Experimenting with remote debugging: Node.js runtime code injection"
706.
▲
Don’t Permanently Fence the Capitol
(nytimes.com)
1 points
by
jgwil2
6y ago
|
2 comments
707.
▲
Joe Biden, the Irishman
(nytimes.com)
1 points
by
jgwil2
6y ago
|
0 comments
708.
▲
by
jgwil2
6y ago
A full crash is ensured by the fact that the stock is massively, massively overvalued. If they are taking steps to prevent it from becoming even more overvalued, the upshot should be less money getting lost overall.
709.
▲
by
jgwil2
6y ago
Current version of Python is 3. It doesn't sound like there are any plans for Python 4[0], so I assume this is just a joke. [0] https://twitter.com/gvanrossum/status/1306082472443084801
710.
▲
by
jgwil2
6y ago
To me OOP is about separation of concerns, abstract data types, information hiding. Modules/namespaces support decomposition the same way that objects do, and historically they became popular because of and in tandem with object-orient
711.
▲
by
jgwil2
6y ago
In case others are wondering: https://en.wikipedia.org/wiki/Entity_component_system
712.
▲
by
jgwil2
6y ago
This may be a bit pedantic, but OOP != inheritance. Inheritance is the worst part of OOP. OOP is also modules and namespaces and encapsulation, all of which are great.
713.
▲
by
jgwil2
6y ago
> A large portion of our society As evidenced by three anecdotes?
714.
▲
by
jgwil2
6y ago
Okay, so it's union types plus pattern matching that are missing (among other things I'm sure). Thanks, that's helpful. > You cannot safely "match" on the command in the same way you can in other languages, becau
715.
▲
by
jgwil2
6y ago
So the problem is that the type system does not give you the type of the caller of a method? Does e.g. Haskell support this? (As an aside, I think one solution in Java would be to use the command pattern and pass an object (ModeratorCommand
716.
▲
by
jgwil2
6y ago
What is so bad about Java/C++?
717.
▲
by
jgwil2
6y ago
> more effort needed to create error messages that are helpful to the user. Well, sure, but that's a tradeoff for the developers of the language to consider. As a user, there are already plenty of statically typed languages to choos
718.
▲
by
jgwil2
6y ago
Right, the problem is that the semantics of statically typed languages are far more complex (since the program text conveys more information).
719.
▲
by
jgwil2
6y ago
Doesn't include calculus either - I think perhaps it's not meant to be exhaustive. EDIT: it has been pointed out elsewhere that calculus falls under analysis, which does appear in the map.
720.
▲
Americans Wagering on Russian Table Tennis
(nytimes.com)
2 points
by
jgwil2
6y ago
|
0 comments
More ›