Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
mercurial
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
13 ms
·
91.
▲
by
mercurial
10y ago
My take it on it is that it can remove most of the boring bugs you would get in a less strongly-typed language and leaves you open to the interesting bugs (eg, logic bugs). As for dependent types, I'm not sure that even then you would
92.
▲
by
mercurial
10y ago
Since when does Reason have JSX?
93.
▲
by
mercurial
10y ago
It will absolutely save you, because it will complain loudly about every broken call site and prevent the broken code from making it to production (assuming you didn't use any tricks with any ). Tests may or may not help (I have yet t
94.
▲
by
mercurial
10y ago
Precisely.
95.
▲
by
mercurial
10y ago
> Unless you're working with a strict sound type system, you only have a little more information: you know the properties and methods of what is returned, but you don't know what state its in. So you won't typo a method na
96.
▲
by
mercurial
10y ago
Well, considering the number of dependencies a typical web project has, I can tell that I'm far from understanding the internals of every library used in our codebase. I mean, of course you'll want to do that in some cases where p
97.
▲
by
mercurial
10y ago
> But yeah, shoving a flag onto an object where there was no such flag can come in handy at times, if you're treating your objects as dicts or whatever (in JS). Ugh, no. I really don't want to be looking at code where propertie
98.
▲
by
mercurial
10y ago
Documentation will not save you the day you decide to rename a function or change its signature. Static typing will.
99.
▲
by
mercurial
10y ago
You can totally simulate duck typing with Typescript, since it (only) supports structural typing. If your method only expects an object with an asString() method, you can do something like: function useAsString(foo: {asString: () =>
100.
▲
by
mercurial
10y ago
Probably v5 at that point.
101.
▲
by
mercurial
10y ago
Actually, I think most of the OCaml GUI libraries (lambda-term, for instance) do use objects and classes, because it makes sense in that context.
102.
▲
by
mercurial
10y ago
> The preferred solution to having multiple types of nodes in the same tree is to use an enum That's not really a great option for a widget library, because it means no custom widgets.
103.
▲
by
mercurial
10y ago
Why? It would be fair if he was trying to push a product, but here it's just a technical discussion.
104.
▲
by
mercurial
10y ago
What is "socialism"?
105.
▲
by
mercurial
10y ago
I seriously doubt that consumer protection laws in the US are better than consumer protection laws in the EU.
106.
▲
by
mercurial
10y ago
I did hear there were quite a few bike thefts in Copenhagen. Neighbouring Norway has a national registry of bikes, which seems to be quite effective at lowering theft.
107.
▲
by
mercurial
10y ago
From a practical standpoint, what's the difference between js_of_ocaml?
108.
▲
by
mercurial
10y ago
I'll point out that slavery was abolished by the French government following the Revolution (though the slaveholders obviously fought tooth and nail to prevent the law from being applied), before being re-instated by Napoleon (under pr
109.
▲
by
mercurial
10y ago
That's the same thing we're doing at my company (with the aim of eventually replacing the old platform entirely), and it's working out very well.
110.
▲
by
mercurial
10y ago
This being the Internet, I'm tempted to say it's a parody.
111.
▲
by
mercurial
10y ago
> I just can't fathom doing anything large scale without access to real tools, real abstractions. I mean, in JS, abstraction means using separate JS files that people actually believe represent real modules or something! Yeah, separ
112.
▲
by
mercurial
10y ago
I'm actually working on an isomorphic app. My approach is to simply create a PersistenceService interface, with methods returning promises, and to make two classes implementing it, SqlPersistenceService and AjaxPersistenceService. You
113.
▲
by
mercurial
10y ago
Except that it doesn't handle source maps in JS stack traces, which is a major pain...
114.
▲
by
mercurial
10y ago
> a world where JavaScript's shenanigans are the accepted norm. Hey, we have Typescript nowadays, which does help a lot.
115.
▲
by
mercurial
10y ago
> Chaining a monadic sequence can feel magical at times. The issue is when this monad is actually a monad transformer tower, in which case there is actually a bunch of "magic" happening at each line.
116.
▲
by
mercurial
10y ago
> This is an oft-repeated criticism of Haskell which I frankly find has no basis. Firstly, symbols are preferred for these kinds of functions precisely because of their ubiquity. Once you're familiar with them (which you almost cert
117.
▲
by
mercurial
10y ago
I agree with the spotty documentation. That said, it is nonetheless such a titanic improvement over standard JS, both in terms of safety and of readability (documentation via type signatures), that I firmly intend to not write "standar
118.
▲
by
mercurial
10y ago
> You'll find yourself modded up and down over this. In a purely intellectual sense, it is definitely a shame that the coup failed. The turkish miliatry has a history of stepping in when a government no longer adheres to the pricipa
119.
▲
by
mercurial
10y ago
I don't see how recursive queries are going to help you serialize a new Foo with a new field of type Bar with a new field of type FooBar, each going in a different table. That's what I mean by serializing an object graph. As for b
120.
▲
by
mercurial
10y ago
> The one huge advantage of an ORM is the ability to support multiple databases, but that only really works if you can do everything using the ORM. It has several advantages: support for multiple databases (which is useful, sometimes), t
More ›