Hacker News new | past | comments | ask | show | jobs | submit login

Bjarne is right, the guy is wrong, full stop. If you don't care about performance, then don't worry about performance. Use std::list if you like, and don't complain about it.

Ultimately, we write programs to make machines do things. What we write exactly determines what the machine does. It is our responsibility to understand what we write makes the machine do; otherwise it won't do what we wanted. Often (maybe almost always nowadays) the performance details don't matter much. When they do matter, there is no substitute for understanding.

The Standard data structures are constructed simply, with understandable performance characteristics, imposing minimal overhead both in time and code space. This is an extremely important quality not to sacrifice idly. No one is obliged to use only the Standard containers; if you need something different, you can write something different yourself, or even find it online somewhere. You are encouraged to write something yourself, and maybe publish it. People do.

In a very real sense, the Standard containers are just examples. Making them unnecessarily complicated would make them worse examples, and would make them worse for almost all places they are used.




I think you may have missed the point of my raising that fwiw. I genuinely don't care who is right [1]. Bjarne's attitude and manner is very wrong and very normal amongst c++ people. That's a shame. He could have explained his point of view forcefully, without being a jerk. Bjarne made his choice.

Maybe it's why there have been so many terrible decisions in C++ over the years because being an asshole and right might scare off discussion but it doesn't make even Bjarne infallible.

[1] If you care about performance you take full responsibility for all code used including all libraries like the stl, which might well mean you don't use the stl and vector and write something optimised for your specific purpose, and not for every possible purpose. But I don't want to be an ass about saying it.


He is not a jerk. He explained his point clearly, concisely and respectfully, without wasting the time of the next person with a question. Making people into jerks because you don't like their answers, you find yourself surrounded by jerks. Then who's really the jerk?

He explains, "People have not figured out how to automate picking data structures optimally relative to their use in a program". In other words, the guy asked for something impossible. Bjarne was as diplomatic as was possible while still answering the question accurately.


"I think I understand what you are trying to say and I think that you are wrong."

The giveaway is the hoots and razzes from the crowd. No word above needed saying. It clarified nothing. It is pure assholery. (And he may not have even intended it. Clearly lots of c++ people have no issue with just how unpleasant community interaction is compsred other communities. It's also pretty obvious that many do see it plainly).


For someone for whom English is a second language, what was wrong with his statement ? For a non-native English speaker it seems expressing disagreement is becoming more and more difficult and complex.


Indeed, the usual we need to talk like radio censorship on US.


Nothing Bjarne says would be censored on NPR. Being a jerk is totally allowed and should be. As is pointing it out.


I can explain why I disagree with you. Or I can put you down for not already understanding and agreeing with my point before I do that.


Here is Microsoft's implementation of map in the standard library. I think of myself as a competent programmer / computer scientist. I couldn't write this: https://github.com/microsoft/STL/blob/f392449fb72d1a387ac502...


I think you mean to say that you couldn't afford to devote the time to making a map that Microsoft did. Generally, in C++ we get to use data structures that have had far more attention to every detail than we could apply personally because they are used by many more than just us. Microsoft's gets used by everybody who uses their compiler, and so commands attention. It probably deserves more than Microsoft actually spends, but that is a management problem.


So definitely don't use it if you care about performance? (You can't write it, but anywhere you'd use it you can probably beat it). But we're getting into discussion of sensible benchmarking of actual deployable applications so let's leave that for another time.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: