Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
BenFrantzDale
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
8 ms
·
61.
▲
by
BenFrantzDale
5y ago
We have annual flu shots. Naively I’d expect COVID shots to be the same if not more frequent for the first few years while global immunity is low and so variants keep evolving quickly.
62.
▲
by
BenFrantzDale
5y ago
Agreed. And a huge strength of C++ is that you can write low-level classes like these and have them be fully performant and have reasonable native-feeling syntax. Almost no other languages provide that.
63.
▲
by
BenFrantzDale
5y ago
So built-in std::span? https://en.cppreference.com/w/cpp/container/span
64.
▲
by
BenFrantzDale
5y ago
3M 8110S is quite small FWIW.
65.
▲
by
BenFrantzDale
5y ago
Do you trust Amazon’s supply chain?
66.
▲
by
BenFrantzDale
5y ago
Yeah, explaining “what” in comments is rarely helpful. For professionals, a certain degree of language-literacy should be assumed: `#include <string>` doesn’t need a comment about its semantics; it only wants a comment if it’s surpris
67.
▲
by
BenFrantzDale
5y ago
You may not need to sort, but std::rotate? std::partition? std::all_of? The list goes on. Without templates, these wouldn’t provide the value they do. (Thanks Stepanov!)
68.
▲
by
BenFrantzDale
5y ago
I like that Python let’s you name `’’.join`. I’ve done the same thing creating a linear form: `f = x.dot`.
69.
▲
by
BenFrantzDale
5y ago
Agreed. With its static typing, namespaces, and stability over decades, I can think of few languages other than C++ appropriate for enormous projects.
70.
▲
by
BenFrantzDale
5y ago
The biggest leak I’ve seen was in the JavaScript (qml) side of a C++/qml app. You can still leak in GC languages by inadvertently holding on to things you are done with. The GC encourages you to not think about it, which is a problem.
71.
▲
by
BenFrantzDale
5y ago
But dimensioned quantities are meaningless without units. are you saying c has a value of 1.803e+12? Or that it has a value of 1? There’s a big difference between using furlongs per fortnight and speed of light as your units for speed. By s
72.
▲
by
BenFrantzDale
5y ago
His technical errors include the “correct” multiple-choice answer being that the time to turn on is “1/c s”. That evaluates to 3.3e-9 s^2/m. It’s not even a time. Failing basic dimensional analysis is grossly sloppy.
73.
▲
by
BenFrantzDale
5y ago
It’s a compiled optimized language. Along with C++, it’s one of the few languages to have essentially no runtime overhead.
74.
▲
by
BenFrantzDale
5y ago
Why in almost 2022 do people put up with a language lacking generics?
75.
▲
by
BenFrantzDale
5y ago
It’s easy to pick on C++, but you can’t have backward compatibility and foreword progress and also not have features that are considered out-of-date.
76.
▲
by
BenFrantzDale
5y ago
To paraphrase the classic Prolog joke: No.
77.
▲
by
BenFrantzDale
5y ago
I believe C++ is getting this (in C++23? I think it was approved…) in the form of if you have `void f(auto&& x)` (taking a universal reference) and call `f(x)` it’s by reference but `f(auto(x))` the `auto(x)` will make a copy so `f`
78.
▲
by
BenFrantzDale
5y ago
As someone coming from C++ I don’t comprehend this complaint. How do you even do anything in a language without deterministic destructors? All my experiences with garbage collection have been painful. RAII is so much easier to use.
79.
▲
by
BenFrantzDale
5y ago
I’m a big fan of `enum class IsFoo : bool { no, yes };`. I find it to be a great balance between type safety and conciseness. If you want your own unique Boolean-like type, that one line is all you need (unless you want operators, etc.)
80.
▲
by
BenFrantzDale
5y ago
Agreed. My favorite example of C++ vs C performance is C++’s `std::sort` which is intrinsically faster than anything similar in C because C lacks the language features (templates) to support performant code reuse like that.
81.
▲
by
BenFrantzDale
5y ago
In C++ I’ve gotten in the habit of `enum class is_gain : bool { no, yes };` so the call site is `v = calc_formula(ia, ib, is_gain::yes);`. An advantage is that such stron Boolean-like types can be passed repeatedly and maintain their type s
82.
▲
by
BenFrantzDale
5y ago
I don’t know about that, but I am using stlab::copy_on_write in production and it’s amazing. It’s like a cross among a T, a unique_ptr<T>, and a shared_ptr<const T>. https://github.com/stlab/libraries/b
83.
▲
by
BenFrantzDale
5y ago
Typically unique_ptr is represented as a pointer (check sizeof). For shared_ptr, there’s an atomic refcount but no locks. Operations on the shared_ptr object itself aren’t threadsafe (you can’t have the same shared_ptr assigned by two threa
84.
▲
by
BenFrantzDale
5y ago
I don’t know exactly what the troll you are responding to was getting at, but modern C++ generally agrees with them that OO isn’t the best way to do most things. For better and/or for worse, C++ can’t remove features, so classes aren’t
85.
▲
by
BenFrantzDale
5y ago
So… forever microplastics?
86.
▲
by
BenFrantzDale
5y ago
Contemporary C++ encourages this too. There’s a place for member functions—even convenience ones—but algorithms operate on data structures; they needn’t be part of the data structures.
87.
▲
by
BenFrantzDale
5y ago
Can you explain “Javascript/Node”? I thought Node.js was a JS interpreter but not the interpreter used in the major web browsers. Rather, that Node is an interpreter that’s used to run Js in (typically) headless (server) environments,
88.
▲
by
BenFrantzDale
5y ago
Stuff Made Here.
89.
▲
by
BenFrantzDale
5y ago
Take a class. It can be fun and an instructor can show you what you could do better.
90.
▲
by
BenFrantzDale
5y ago
NYT crosswords have a theme. I would imagine “poison penne” is one of the theme answers along with other pasta-based alliterations. Once you know that’s the game, then it’s not a weirdly meaningless pun but wordplay that builds as you first
More ›