Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
BenFrantzDale
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
10 ms
·
31.
▲
by
BenFrantzDale
4y ago
Right. It seems like they set out to replace some misunderstood or outdated view of C++. They’ve clearly had success, but it’s no C++ successor.
32.
▲
by
BenFrantzDale
4y ago
I had one experience with Go. It was slow because the GC kept kicking in. So we won’t use Go again in favor of time-tested C++. GC is a major reason we are using C++ over Go. In my mind it’s a half-speed language. I’m also very put off by R
33.
▲
by
BenFrantzDale
4y ago
Do tell.
34.
▲
by
BenFrantzDale
4y ago
It was a WBCN noon tradition back when WBCN was alive.
35.
▲
by
BenFrantzDale
4y ago
I keep considering writing a `unique_span` and `shared_span`. Really `span` or (a type it’s based on) should have been templated on the pointer type, so a `span<shared_ptr<const T[]>>` for example.
36.
▲
by
BenFrantzDale
4y ago
True. I love C++ but think “don’t pay for what you don’t use” should err on the side of safety over speed when it comes to what “pay” means. I’d rather `operator[]` be bounds-checked and occasionally have to call `v.data()[i]` or `v.uncheck
37.
▲
by
BenFrantzDale
4y ago
If it’s my branch, I often have a build of every commit in my cache. Even if not, each jump back and forth makes a bunch of new cache entries, many of which will be reused in subsequent bisect steps.
38.
▲
by
BenFrantzDale
4y ago
I basically never `make clean` but ccache is a boon for `git bisect`. In theory bisect takes log time; in practice, without ccache, it’s slower because handwave build time goes by something like the log of the number of commits you jump a
39.
▲
by
BenFrantzDale
4y ago
I use ccache and love it, but I keep wondering: wouldn’t it make more sense for compilers to do caching themselves? That would allow them to cache the results of much finer-grained operations than whole translation units. If two (or 500!) t
40.
▲
by
BenFrantzDale
4y ago
This is also C++20’s calling card. It has `std::span`.
41.
▲
by
BenFrantzDale
4y ago
A reinterpret_cast is something that shows up very rarely, so it’s fine that it’s not concise. And when it is used, it usually can do with a function naming it. I try to have a “no raw reinterpret_cast” view unless it’s chars to unsigned ch
42.
▲
by
BenFrantzDale
4y ago
The weird thing about CoPilot to me is that all the examples seem like bad examples: I don’t want my team writing new functions to count the bits in an int; I want them to call the function to count the bits. The real potential of CoPilot w
43.
▲
by
BenFrantzDale
4y ago
After being bitten by the overhead of Go’s GC, we stopped using it and went back to time-tested C++.
44.
▲
by
BenFrantzDale
4y ago
Yeah, I lost lots of time to switching to a debug build and having to rebuild the whole project since my Debug-build ccache wasn’t warm. The `#pragma` version lets me get my work done quickly and easily.
45.
▲
by
BenFrantzDale
4y ago
It’s always nice to understand more about why game developers do the weird things they do. I always buried and run in “RelWithDebInfo”, then if I really need it, I’ll throw `#pragma clang optimize off` around the code that the debugger can’
46.
▲
by
BenFrantzDale
4y ago
For me, I see “C/C++” as a sign they see C++ (which I’m looking for experience in) as interchangeable with C. I want people who grok C++’s ability to build powerful abstractions, not people messing around with it as C with polymorphic
47.
▲
by
BenFrantzDale
4y ago
You can always create your own “algorithms”. Our codebase has one that creates a new QObject that is a child of an existing one, returning a (raw) pointer to the new child object. That’s a case of not “no raw `new`”, but the next-best thing
48.
▲
by
BenFrantzDale
4y ago
When he says they are bad APIs, I think he means they aren’t a proper basis API for interacting with a memory resource. You can implement malloc and free and realloc and callow in terms of his API with no overhead but not the other way aro
49.
▲
by
BenFrantzDale
4y ago
Also: chainmail scrubbers are amazing. I can’t recommend them enough.
50.
▲
by
BenFrantzDale
4y ago
Using void* means the compiler (almost certainly?) can’t see through it to optimize. More importantly, it looses you type safety and the self-documentation that flat_hash_map<K, V> gives you.
51.
▲
by
BenFrantzDale
4y ago
I do almost the same thing, but I turn it to scalding hot once I’m done using my fingers so the lenses get hot so they dry faster. So far that hasn’t seemed to damage anything.
52.
▲
by
BenFrantzDale
4y ago
Right. But why doesn’t it Just Work by default?
53.
▲
by
BenFrantzDale
4y ago
The big guest Jon for me is, in 2022, why write UI code in C? (I say this as one who contributed to GNOME a little (all icons) back in like ’98–’02 and who writes high-performance C++ professionally.)
54.
▲
by
BenFrantzDale
4y ago
IIRc, 23-bit ints are a subset of float32, and up to 50-something-bit ints are a subset of float64s, so on most architectures, int (32) is a subset of double (64).
55.
▲
by
BenFrantzDale
4y ago
Wow, Go is worse than I thought! Sum types aren’t particularly ergonomic in C++ but at least it has them. And it has operator overloading, and generics, and `const`, and deterministic lifetime. To me complex code can be made way more un
56.
▲
by
BenFrantzDale
4y ago
I got a little way in and assumed by the dumb gopher and code examples that the author was pushing Go.
57.
▲
by
BenFrantzDale
4y ago
I’ve been very pleased with Sean Parent’s `stlab::copy_on_write<T>` as a value-semantic mutable alternative to `std::shared_ptr<T>`. It has an explicit `write() -> T&` that makes it less magical than some CoW alternatives
58.
▲
by
BenFrantzDale
4y ago
As a C++ fan, I’d say manual memory control isn’t going anywhere but manually calling malloc and free is ridiculous in 2022 and beyond when `std::unique_ptr` Provides a better abstraction.
59.
▲
by
BenFrantzDale
4y ago
I don’t know Go, but I think less in that concepts are syntax guarantees, not semantic guarantees. I suspect interfaces (assuming they are opt-in) are semantic guarantees. That said, I’ve never run into this distinction being a problem, and
60.
▲
by
BenFrantzDale
4y ago
We are on the same timeline.
More ›