Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
MrJohz
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
71 ms
·
931.
▲
by
MrJohz
4y ago
Have you read the Forde Report? Because that's kind of the issue at stake here. Yes Corbyn was smeared by the press and people on the right wing, that shouldn't be surprising anyone. But a healthy Labour party would be able to dra
932.
▲
by
MrJohz
4y ago
Read the Forde Report and then come back here with this "left" and "right" nonsense. The problem was everywhere, and no-one should be feeling vindicated right now at all. Five more years of Johnson, Truss, Sunak, and wha
933.
▲
by
MrJohz
4y ago
I'm not an economist, but I don't believe that's always true. Let's say I can buy replacement server at my own pace for £100, or in a panic when it's urgent for £200 (obviously made up numbers to make the maths easi
934.
▲
by
MrJohz
4y ago
It's interesting that you mention Python, because obviously the RoR equivalent there is Django which leaves something to be desired when it comes to DSLs and expressive APIs. Symphony and Laravel also come to mind here, and I guess Spr
935.
▲
by
MrJohz
4y ago
And generally, if you are passed an owned parameter or variable x, you can usually declare it as `mut x` right from the very start. So in the examples given, rather than the identity function or anything fancy like that, you can just write:
936.
▲
by
MrJohz
4y ago
Fwiw, the function syntax in Typescript/Javascript is generally expressive enough to use as a basis for DSLs, and not needing to use macros for this also has a lot of benefits. I'm a big fan of Rust, but I find often library autho
937.
▲
by
MrJohz
4y ago
That's pretty common. The "browserslist" tool allows you to specify which features you want to support in terms of the browsers that support them, and the default is "> 0.5%, last 2 versions, Firefox ESR, not dead&quo
938.
▲
by
MrJohz
4y ago
The problem is that they did understand the state of affairs (or at least thought they did). It's very easy for us to look back at this with hindsight and see that they didn't understand the problem, but given the knowledge at the
939.
▲
by
MrJohz
4y ago
This is the spec behaviour - the browser focus should immediately jump to the first focusable item in the page for accessibility reasons. (As I understand it, this is the norm for dialogs outside the browser.) My understanding is that you s
940.
▲
by
MrJohz
4y ago
My understanding is that the relationship is a lot more complex than "types = faster code". Types are often necessary for highly efficient code, yes, because the allow you to avoid lots of indirection and just give the hardware th
941.
▲
by
MrJohz
4y ago
> It's not npm, you specify a specific version and that's the code that's used, no matter how upstream changes things. Note that that _is_ how NPM behaves. (At least, when using a lock file, which is the default behaviour
942.
▲
by
MrJohz
4y ago
I'm also getting the same issue with being redirected to random scam pages whenever I open the link. I see the right page for a couple of seconds then I'm redirected to "you're the 1000th visitor, also this is Google now
943.
▲
by
MrJohz
4y ago
Bear in mind that that's apparently the mean salary, which one would expect to be somewhat higher than the median (as it's more affected by high salary outliers in upper bands). The people in the NHS that I talk to say it's r
944.
▲
by
MrJohz
4y ago
The other commenter related the types to normal binary operations, which I think explains why (T | Null) | Null can't be distinguished from T | (Null | Null). Another way of thinking about it is by asking what "untagged unions&quo
945.
▲
by
MrJohz
4y ago
Yes. Having an explicit `Option<T>` type allows you to write things like `Option<Option<int>>`. This type is not possible in, say, Kotlin or Typescript. (Well, technically it is, but not using the native null types provide
946.
▲
by
MrJohz
4y ago
In fairness, that's also what the article is saying: near black and near white. Do you have any links to the studies by those researchers? My own understanding is that yellow-on-blue is traditionally meant to be the most visible option
947.
▲
by
MrJohz
4y ago
That's true of objects too, as long as they have the same shape (which Typescript naturally helps with!). As long as the optimising compiler can see that your objects all have the same shape, and that you're always using the same
948.
▲
by
MrJohz
4y ago
In that case, why not just create an object? With a constructor function, that could look something like (name: string, age: number) => ({ name, age: age * 2 }) Or even just without the constructor, if the data is so simple:
949.
▲
by
MrJohz
4y ago
The only new runtime feature that Typescript brings to Javascript is enums.* Everything else is just types. Interfaces, for example, are just a way of defining a shape that data will fit to. They are (almost) equivalent to the `type MyType
950.
▲
by
MrJohz
4y ago
You can if the LSP enables it, I believe. In rust-analyzer, it's definitely possible to do this, for example, but I think that was a new feature added somewhere in the last few releases.
951.
▲
by
MrJohz
4y ago
Using some sort of VDOM is still pretty standard in most frameworks, it's definitely not just React doing this. The motivation is generally an attempt to model an application as a function `(state) => DOM`. This is probably similar
952.
▲
by
MrJohz
4y ago
CSS modules work quite differently from scoped CSS. In scoped CSS, every element in a component is given an extra data attribute unique to that component. Then when you write your CSS, each declaration is given an implicit extra selector th
953.
▲
by
MrJohz
4y ago
While it's true that in backgammon, skill largely trumps luck, that's not true for, say, Ludo. Sure, you still have decisions (which piece do I move, do I start a new piece or not), but the ultimate decider of the game will be luc
954.
▲
by
MrJohz
4y ago
There is definitely no built-in support for those things, but I don't think it's fair to call them second class citizens in the React world. AngularJS bundled an entire http client back in the day, but that doesn't make it mo
955.
▲
by
MrJohz
4y ago
The optional typing in Python is pretty mediocre, especially in comparison to something like Typescript that just does everything so much better. The types are pretty limited and not very ergonomic (especially when using generics or functio
956.
▲
by
MrJohz
4y ago
I don't think that's a great explanation of the concept of VDOM. For example, SolidJS looks a lot like the example given, and it also arguably returns an object that represents how the page looks, but it didn't use a virtual
957.
▲
by
MrJohz
4y ago
But isn't that also the point of descriptivism in linguistics? That linguistics is the study of language as it's actually used in the context of different groups and cultures, rather than as an officially described, created thing?
958.
▲
by
MrJohz
4y ago
I don't think I understand that example. If I understand correctly, the issue is the question of exclusive mutability, which is why you can't pass the mutable reference itself around. But for some reason you can pass around a muta
959.
▲
by
MrJohz
4y ago
I mean, sure. I disagree, but I can see what you mean. But that's not an argument for one being better than the other, it's an argument of preference. You happen to like words over symbols. In my experience, when I actually start
960.
▲
by
MrJohz
4y ago
It seems obvious that bad syntax harms readability, in that it's very easy to construct an example of a programming language that is truly unreadable (use commas to indicate generics, everything must be upper case, backslash to call fu
More ›