Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
OskarS
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
21 ms
·
151.
▲
by
OskarS
2y ago
The point is to let them choose for themselves. If they want to contact us, that's perfectly fine. But it should be their choice to make, not ours.
152.
▲
by
OskarS
2y ago
The argument here is that this is exactly how (mostly) European societies hell-bent on colonization have been justifying their actions for five hundred years, with different variations of "amazing stuff" (salvation, weapons, trade
153.
▲
by
OskarS
2y ago
I liked VI better than V (the districts were fun!) but never touched any mods. I think some of the ideas that were maybe a bit half-baked in VI comes together really nicely in VII.
154.
▲
by
OskarS
2y ago
I'm sorry you feel offended, but you did write an article online with a deliberately provocative title. If you do that, you need to be able to deal with criticism. And not considering concurrency when mutating globals in C/C++ is
155.
▲
by
OskarS
2y ago
I've put around 20 hours into this game at this point, and I think the criticisms are way overblown. The UI is a bit clunky in spots, but the game is very solid, and very fun. I've played every Civ since IV, and mechanics-wise, th
156.
▲
by
OskarS
2y ago
I'm sorry, but no. This is one of the primary reasons why global variables is bad, because of concurrency issues. If you add this to a code base, are you guaranteeing that at no point in the next decade, NOBODY is going to add a seco
157.
▲
by
OskarS
2y ago
No, this is absolutely not true at all. Calling this function from multiple threads is undefined behaviour in C++ (unless synchronized using some other mechanism), you get NO guarantees what so ever on program behaviour. Best case scenario
158.
▲
by
OskarS
2y ago
There are many reasons why global variables are bad, but extremely high on the list (if not first) is concurrency issues. The fact that the author think it's acceptable in any C or C++ code base to put in code like: static int pr
159.
▲
by
OskarS
2y ago
I think he sets quite a high bar here. Like, just going through the basics of Noether’s Theorem is so far beyond what normally passes for popular science (which usually boils down to “the universe is really big you guys” and “quantum stuff
160.
▲
by
OskarS
2y ago
Implementing an algorithm like Dancing Links is a hugely rewarding experience as a programmer. You learn by doing.
161.
▲
by
OskarS
2y ago
I cannot recommend checking out Volume 4B enough, then. He goes much deeper, improves the algorithm, adapts it to different constraint problems, and provides hundreds of really cool exercises (including word problems like crosswords, I thin
162.
▲
by
OskarS
2y ago
It does improve memory usage! In the version in the paper, each item has four links, in the book version they only have two. So memory usage is roughly cut in half.
163.
▲
by
OskarS
2y ago
You know in the sparse matrix, every item has four links (left, right, up and down)? In the version in the book, each item only has two links, up and down. The left/right links become implicit, because he stores the items contiguously
164.
▲
by
OskarS
2y ago
On my off hours, I’ve been working through volumes 4A and 4B. They are really wonderful, I highly recommend them. They’re not practical for the vast majority of programmers, but the way he designs and writes about algorithms is remarkable,
165.
▲
by
OskarS
2y ago
I realize it’s hard to face, but it’s ok to admit that (cool as the tech is) some things just have a net negative on the world. It’s just engineers and data scientists using their enormous talents to make world a worse place, instead of a b
166.
▲
by
OskarS
2y ago
A huge benefit to companies with subscription services is that people forget they have them and keep paying for Ancestry.com or whatever for months (what? no, of course that never happened to me...) after they've stopped using it. Kagi
167.
▲
by
OskarS
2y ago
I kinda like it on occasion. Works like pythons defaultdict. Like, if you wanna count something: for (const auto &thing: collection) { counts[thing]++; } Works nicely, you don't have to check if it's alrea
168.
▲
by
OskarS
2y ago
Exactly right. There's a huge benefit to encode the ability for compile-time evaluation in the signature of the function itself. Much better than doing it "ad-hoc", like how template instantiation does it. Sometimes it will w
169.
▲
by
OskarS
2y ago
They absolutely are not. Look at this range for-loop: for (const auto item: vec) { ... } `item` is not a compile-time constant. It's different every run of the loop.
170.
▲
by
OskarS
2y ago
I agree that I would have preferred destructive moves, but move semantics makes C++ a much richer and better language. I kinda think pre-move semantics, C++ didn't quite make "sense" as a systems programming language. Move se
171.
▲
by
OskarS
2y ago
> It tries to implement discriminated union in C++ but that feature is lame without true pattern matching. And you can’t implement pattern matching without thorough syntax level support. So in my books it’s in this academic “let’s preten
172.
▲
by
OskarS
2y ago
> I'm not arguing for spaced repetition, but the whole point is you do some amount every day (or as needed) for the rest of your life (within reason). So it's not equivalent to get fit/slim quick at all, it's more abo
173.
▲
by
OskarS
2y ago
I don't want to rain on anyone's parade, but: of all the really brilliant people I've ever met, interacted with or learned from, I haven't heard of anyone that used techniques like this. Like, the way they learn things a
174.
▲
by
OskarS
2y ago
> it should also offer a new API that simply returns a copy every time Returning a copy isn't great (memory allocation!), the API should probably be something like: int getenv(const char *varName, char *buf, size_t bufSize, si
175.
▲
by
OskarS
2y ago
One of my favorite features of std::chrono (which can be a pain to use, but this part is pretty sweet) is that you don't have to specify the exact time unit, just a generic duration. So, combined with chrono literals, both of these wor
176.
▲
by
OskarS
2y ago
I would say: skip the early ones. Tintin in the Land of the Soviets and especially Tintin in the Congo are outrageously bad (Tintin in the Congo is horrendously racist). Tintin didn't really become the Tintin we know and love until Blu
177.
▲
by
OskarS
2y ago
I would imagine so. Hergé died in 1983, and the last finished story (Tintin and the Picaros) was published in 1973. I can't imagine its out of copyright. The first story (Tintin in the Land of the Soviets, a real stinker, this is befor
178.
▲
by
OskarS
2y ago
Yeah, me too. Nobody is born being a great manager. The only way to learn is to actually become a manager and actually do the job. And you can tell if someone has potential. Like, a good manager needs to be a good communicator, well-organiz
179.
▲
by
OskarS
2y ago
The ”staging” concept in git is something that I know really bugs a lot of people, especially beginners with git. Like ”I just want to commit, why is there this extra step?”, but I totally agree with you. Maybe it’s Stockholm Syndrome, but
180.
▲
by
OskarS
2y ago
Very well put. There's always been this Silicon Valley instinct that all technological advance is always good for humanity, and it's just not that simple.
More ›