Hacker News new | ask | show | jobs
by Kranar 1901 days ago
>Have you looked at the source for (say) your Standard Library implementation?

All the time, why would this be unusual? I actually find myself often looking over MSVC's implementation straight in VS and comparing it to libstdc++:

https://github.com/gcc-mirror/gcc/tree/master/libstdc%2B%2B-...

One recent thing I caught from going over the implementation was how MSVC's implementation of std::tuple is semantically different from GCC's, where GCC constructs left to right, but MSVC constructs from right to left.

I also debug through boost and have reported bugs, or just found bugs in it that had already been reported.

Qt is another library that I am constantly reading over, heck if anything just for the sake of learning interesting UI implementation techniques.

Anecdotally, I find it unfortunate that people who talk about how they've been programming in C++ for 30+ years are almost always the ones who have very backwards and archaic practices and talk about those practices like they are common place.

"I've been programming in C++ for 500 years and never once have I had to do this, therefore it follows that no other C++ developer will ever have to do it either!"

There are entire generations of developers who've learned C++ and use it in ways very different from you, in technical domains you may not even realize exist. Don't presume that just because you personally have never done something, that it can't possibly be relevant or useful to an entire community of developers using the same technologies as you but in different ways.

1 comments

I'm saying that on principle I do not debug other people's libraries (I do, of course, debug my own). I also do use many modern C++ features, (C++11 and later) particularly from the Standard Library, and I think that more developers should do so.
Fair enough, that's a principle you can have for yourself and depending on your role and responsibilities that may suit you. But at least be aware that others may have a different principle and set of responsibilities. I have a professional responsibility to take all measures I can to deliver the most reliable software to my customers and if that means debugging third party libraries, so be it. Heck if that means debugging the toolchain, the operating system, whatever the case, then it's my job to do it.

I don't have the luxury of having the software I deliver to end users fail and then saying "Oh well, it's because there's a bug in a third party library and as a matter of principle I don't bother debugging it, reporting it, or taking basic measures to deal with it so you poor customers will just have to deal with it."

Project manager asks me:

"What did you do this week?"

I say:

a) "I spent the week chasing down an apparent bug on one of the Standard Libraries we use."

or:

b) "I implemented connectivity with the Hong Kong stock exchange, improved our MT performance to get a 20% improvement on submitting trades, and identified a bug we were having with currency conversions as possibly being in one of the libraries we use, wrote a work-around for it, wrote the fix and tests up on our developer wikki, and submitted a report to the library vendor."

Now, I would say that(b) is of far more value for the company I work for and is at least as "professional" as (a).

Several times in my life I've been in situations where a) was more important because the bug was causing real issues now. In your industry a bug that miscalculates risk can cost billions of dollars. In my industry a bug can cause a safety system to fail and kill people.
It looks like we're in similar industries then based on your comment and if that's more or less the level you've been operating at on a weekly basis for decades then without a doubt you are a significantly more productive individual than I am and really kudos to you for it.

My point is mostly that not everyone is you though, similarly I don't presume everyone works like I do. Hence arguing that because you've done something for 30 years that it reasonably follows that everyone else should also do it is a really poor argument.

Now, I would say that(b) is of far more value for the company I work for and is at least as "professional" as (a).

That's fine, but it does assume that a workaround exists and can be implemented within a reasonable amount of time. If you're talking about a bug in a library of convenient text processing utilities, that might well be the case. If you're talking about a bug in a security-related library that you rely on to authenticate instructions to make high-value trades, maybe not so much.

Fair enough, that's a principle you can have for yourself and depending on your role and responsibilities that may suit you. But at least be aware that others may have a different principle and set of responsibilities.

I can't upvote this sentiment enough. C++ has been used by millions of programmers working in numerous fields over a period of decades. Any attempt to generalise from a single person's own experience of using C++ to that entire community is surely unwise. I note (for no particular reason, honest) that this applies even if you are a long-standing member of the standards committee.