5 ms·
“What’s the secret of success? Right decisions. How do you make right decisions? Experience. How do you get experience? Wrong decisions.” – John Wayne
by kQq9oHeAz6wLLS 3y ago
“What’s the secret of success? Right decisions. How do you make right decisions? Experience. How do you get experience? Wrong decisions.”
– John Wayne
- otikik 3y agoThat sounds smart, but in reality it is quite possible to become very good at identifying wrong decisions without developing the capacity to identify good ones. This happens to ... a friend of mine.
- maayank 3y agoSounds like story time :)
- fer 3y agoAs a parent, I like put it in a different way: "The good thing about making mistakes, is that you get to know which mistakes are worth making."
- thesnide 3y agoParenting is all about letting your children experience enough mistakes while avoiding all the fatal ones.
- tialaramex 3y agoIt turns out you can learn from other people's experiences. This is a valuable shortcut, because it turns out some of those wrong decisions are fatal which makes obtaining experience in those decisions the hard way a bad idea. Now, granted, too many people / organisations / whole fucking countries aren't even learning from their own experiences, but you should really strive to learn from others too.
- jstimpfle 3y agoJust came here to have you check out this -- https://news.ycombinator.com/item?id=36706893 https://news.ycombinator.com/item?id=36706893
- tialaramex 3y agoFWIW I'm not difficult to find - tialaramex everywhere is just me again - so it's probably not appropriate to reply to unrelated comments on HN to ask me to look at stuff. However, responding here since you did, I think you missed the whole point of that sub-thread. People aren't telling you that Bjarne's terrible I/O streams functionality is great so you should use that. They're praising the much more normal looking std::format and related features which have been adopted from fmt. As a result assessing Bjarne's I/O streams and discovering that they're terrible is not a meaningful reaction to that praise. We know Bjarne's feature is bad, we're talking about a different, much better, feature.
- jstimpfle 3y ago> People aren't telling you that Bjarne's terrible I/O streams functionality is great so you should use that. Well, std::format is what you actually told me I was a fool and a noob for refusing to use under the pretense of being pragmatic. ("you are deliberately choosing to use poor tools and calling this "pragmatism" because it sounds better than admitting you're bad at this and you don't even want to improve") So I've finally put in the work and made std::format run on MSVC because that's the only compiler where std::format is available for me (gcc-12 and clang-14 don't include it on my Debian VM). And guess what, simple file with main() and std::format("Hello {}\n", 42) + fwrite() takes 1.4 seconds to compile there (no linking, no optimizations) compared to 0.16s for compiling a cpp file with the equivalent snprintf/fwrite call. 0.16s is still much but MSVC takes 0.12s for compiling "return 0". Subtracting that, it's a somewhat reasonable overhead of 0.04s for including + using stdio.h / snprintf. And 1.28s, so literally 32x that amount, and realistically a nerve wrecking time to wait for a single file to compile, for the std::format version. I'm not sure how to take you seriously anymore. It's hard to imagine you've actually used this yourself, because paying more than a second to compile a single print statement is not OK. I wish people like you would just be a little less loud and more considerate when judging people that are trying to actually get something done. The code under test: #include <format> #include <string> #include <stdio.h> int main() { std::string x = std::format("Hello {}\n", 42); fwrite(x.data(), 1, x.size(), stdout); return 0; } $ cl /version Microsoft (R) C/C++ Optimizing Compiler Version 19.35.32216.1 for x64 Here is a godbolt where gcc-13 with fmtlib setup (as a library) is tested against stdio.h printf(). It's 600-1200ms for std::print(...) vs 60-120ms for printf(...) and just a few ms less for "return 0". (timings are highly variable on godbolt). Again, an overhead of probably some 20x-100x compared to stdio.h printf when we subtract the time for compiling "return 0". https://godbolt.org/z/Pa4jh8qbz https://godbolt.org/z/Pa4jh8qbz
- kQq9oHeAz6wLLS 3y agoHe didn't say (though obviously implied) the wrong decisions were yours. I take a broader meaning, basically you can learn from wrong decisions no matter who makes them. But I take your point.
- btschaegg 3y ago> Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. -- Douglas Adams, Last Chance to See :-)