Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
OskarS
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
10 ms
·
91.
▲
by
OskarS
1y ago
Yes, that one was the first I thought of as well.
92.
▲
by
OskarS
1y ago
The thing that makes it work (aside from Melvyn's excellent hosting) is that they have an unspoken but fundamental assumption about the audience, which is that the listeners are intelligent. Like, it's ok to have nuance, to dig de
93.
▲
by
OskarS
1y ago
If you want to add to that list, check out Only Connect on the BBC. Best quiz show for smart people in the world.
94.
▲
by
OskarS
1y ago
I don’t remember exactly where I read this, but I think it was some internet forum of some kind. It makes sense that whoever wrote it got it from there. Never read it myself.
95.
▲
by
OskarS
1y ago
You're correct in principle, but I'm saying that "in practice", boolean arguments are usually feature flag that changes the behavior of the function in some way instead of being some pure value. And that can be really pr
96.
▲
by
OskarS
1y ago
Lua doesn't directly support keyword arguments, but you can simulate it using tables: serialize(someObject, { prettyPrint = true }) And indeed that is a big improvement (and commonly done), but it doesn't solve all proble
97.
▲
by
OskarS
1y ago
A piece of advice I read somewhere early in my career was "a boolean should almost never be an argument to a function". I didn't understand what the problem was at the time, but then years later I started at a company with
98.
▲
by
OskarS
1y ago
I agree, that is very true, Therac-25 was incompetence, Post Office was incompetence with a heavy dose of malice. This aspect just steuck me as similar, the unquestioning belief in the infallibility of software.
99.
▲
by
OskarS
1y ago
It's interesting to compare this with the Post Office Scandal in the UK. Very different incidents, but reading this, there is arguably a root assumption in both cases that people made, which is that "the software can't be wro
100.
▲
by
OskarS
1y ago
As a single developer, you have very little weight against Google. The same is true of a single developer in the US. What does have weight is the European Union, which Croatia is a member of. If the EU parliament makes a law that Google is
101.
▲
by
OskarS
1y ago
Several! You're correct that Lisps is the most famous, and there's also languages like Erlang that have this as a core functionality. But it's also used in things like game engines for C/C++. You do have your "updat
102.
▲
by
OskarS
1y ago
I don't know about "shouldn't", I think it's fine if they do. But I basically agree, at some fundamental level, you have to have some trust in your coworkers. If someone says "This fixes X", and they haven
103.
▲
by
OskarS
1y ago
> For example the reason why 2s complement took so long is because of some machine that ran C that still existed that was 1s complement. You're misunderstanding me: as of C++20, there is no other representation in C++ for signed int
104.
▲
by
OskarS
1y ago
You do need some way to overflow properly, because sometimes that is what you want. A common example would be PRNGs, which frequently rely on overflow (the classic LCG, for instance). You could argue that should just be a library function o
105.
▲
by
OskarS
1y ago
No, it's absolutely because of optimization. For instance, C++20 defined signed integer representation as having two's complement, but signed integer overflow is still undefined behaviour. The reason is that if you compile with fl
106.
▲
by
OskarS
1y ago
C and C++ are languages that brought us UNIX, the Linux kernel, macOS and Windows, the interpreters of virtually every other language in the world, powering virtually all software in the world as well as the vast majority of embedded device
107.
▲
by
OskarS
1y ago
They have their place. Certainly B-tree data-structures are tremendously useful and usually reasonably cache friendly. And if std::deque weren't busted on MSVC, there are times where it would be very useful. Linked lists have their pla
108.
▲
by
OskarS
1y ago
This is not an obscure theory, it's called the "Endurance running hypothesis" [1], and it does seem that humans are one of very few species exceptionally well-adapted to very long-distance running (though dogs and wolves are
109.
▲
by
OskarS
1y ago
It's also not the same thing as Dropbox was offering: that's a description of a network drive, but the key thing about Dropbox is that it's a syncing engine. It's a much harder thing to do, but with very big benefits: mu
110.
▲
by
OskarS
1y ago
I think the idea is that you're using some external library (e.g. database drivers) which do not use asio but returns a std::future. You can't just "not use std::future" if that's what your library uses without full
111.
▲
by
OskarS
1y ago
First off all, these fonts are not "free" as in "free software", they are owned by Microsoft and to use them you have to agree to a Microsoft EULA (technically, though this isn't enforced). They're "free a
112.
▲
by
OskarS
1y ago
Verdana isn’t terrible, it’s just that it’s so much worse than fonts like Frutiger and Gill Sans that inspired it (similarly to Arial/Helvetica). It’s screams ”free font that kinda rips off really good ones”, and for a giant company li
113.
▲
by
OskarS
1y ago
I bet number 3 on your list there is super-appealing to many people. It sounds lovely to be the kind of person in a smaller community that everyone knows and says hi to, that helps you out with paying your bills or whatever it is. I’m guess
114.
▲
by
OskarS
1y ago
I would actually say it’s the opposite in this case: it’s extremely common in scripting languages for strings to be immutable, mutable strings are usually only available in lower level languages. I’m very surprised Ruby had this feature at
115.
▲
by
OskarS
1y ago
The "invariants" thing is fantastic, I haven't seen anything like that before and it's great. The C++26 contract stuff is fine, but this seems like a really great way of ensuring type invariants, I think I'd use thi
116.
▲
by
OskarS
1y ago
Yes, but what I suspect the commenter was saying is that you can build the expression usung operator overloading as well, so you can type ”a + b”, not ”a.Add(b)”. I love it when libraries like this do that. z3 in python is similar, you just
117.
▲
by
OskarS
1y ago
I really like this model of ”GPL3, but commercial licenses available”. Means you can have a sustainable business without sacrificing open source. I wish it was more widespread, the prevalence of extremely permissive licenses has led to so m
118.
▲
by
OskarS
1y ago
Fair point, but generally speaking, callbacks tend to escape the scopes they are in (if you have a callback for ”user clicked mouse”, it’s likely not going to be triggered in your current scope), so stack-allocation isn’t really an option.
119.
▲
by
OskarS
1y ago
> But I do know the code I write and you're wrong about performance of Func0 and Func1. Those are 2 machine words and all it takes to construct them or copy them is to set those 2 fields. You also have to heap allocate your userData
120.
▲
by
OskarS
1y ago
Indeed, that is exactly the case, lambdas are essentially syntax sugar for doing this. The one thing the author's solution does which this solution (and lambdas) does not is type erasure: if you want to pass that closure around, you ha
More ›