7 ms·
I was once made fun of (in a kind of humiliating way, now that I recall) by a bunch of HPC scientists in a room at KAUST for saying that C++ had support for GC.
by moralestapia 3y ago
I was once made fun of (in a kind of humiliating way, now that I recall) by a bunch of HPC scientists in a room at KAUST for saying that C++ had support for GC.
They were like "if you knew the least bit a about C++, you'd knew it doesn't have a GC".
I was like, "yeah cool, but C++ does have some GC functionality", but they just shut me down. My background is Biology so there were a few remarks about how "a biologist just doesn't know these things, lol".
This was around 2019, btw. And sure, I'm a biologist, but I also happen to have spent 8-10 hours/week for the past 20 years coding because I just really like it; so, there's my 10k hours, ¯\_(ツ)_/¯.
- ezoe 3y agoWell, "by support" it means a few functions that allow user to query some information about GC if implementation had it. No implementation has ever implemented GC.
- foota 3y agoThis is why I always carry around a hardcopy of the C++ spec so I can pull it out Phoenix Wright: Ace Attorney style /s
- MR4D 3y agoThat must be heavy! LOL!! For CHF 208, you can buy the reference directly from ISO...all 1,853 pages! [0] [0] - https://www.iso.org/standard/79358.html https://www.iso.org/standard/79358.html
- foota 3y agoIf anyone tells you C++ isn't a safe language, watch them try to stop a bullet with the C# language spec!
- rzzzt 3y agoECMA-334 (the C# language portions): https://www.ecma-international.org/publications-and-standards/standards/ecma-334/ https://www.ecma-international.org/publications-and-standard..., 639 pages ECMA-335 (the Common Language Infrastructure portions): https://www.ecma-international.org/publications-and-standards/standards/ecma-335/ https://www.ecma-international.org/publications-and-standard..., 574 pages
- CoastalCoder 3y agoOk, but if I need to be saved from an anti-material round, I'm sticking with C++. Just sayin'
- foota 3y agoI admit I had to shop around for a smaller language spec and chose C# :)
- pjmlp 3y agoNote that those 639 pages are only for C# 6, for further pages the Word documents provided with the SDK are required.
- rzzzt 3y agoLet's equip the addenda. It should enable us to withstand short bursts from a phased plasma rifle in the 40 watt range as well.
- Tomte 3y agoAt some point you could get it for 18 USD from ANSI, and later for about 30 Euros from the Estonian standardization office. Both offers had their prices, erm, fixed.
- josefx 3y agoYou joke about that, but people who blindly "know things" will refuse to even look at the standard. After all they already know what it says on the topic. So even carrying the standard around with you wouldn't help.
- CoastalCoder 3y agoProbably safe to say that everyone has issues.
- gumby 3y agoI've never successfully submitted a PR for someone's issues. Someday...
- tialaramex 3y agoYou'd have to print out your own, you can't actually buy a hard copy of any recent ISO C++. Some national standards bodies, entitled to do so, might claim they can sell you one when actually they've got a deal with a relatively local print-on-demand company, but because this standard is huge that company will reject the order so you in fact can't buy the product you'll get an apology, or a PDF or both despite specifically buying paper. Although their processes are hopelessly antiquated (fly to Hawaii to fix a typo? I don't think so), the result is, as you might expect in 2023 - just a bunch of document layout source, from which "draft" versions of the document are publicly available. Not as useful if you're getting burgled, or to raise a display off the desk, but more practical for real work.
- aidenn0 3y agoI find Stroustrup's book to be more accessible; the C++ spec can get rather math-y for some people.
- ComputerGuru 3y agoSo far as I can see, this was in the C++ spec but not implemented by any major compiler, though. So I guess the technical answer to “who’s right?” would depend on the verbiage of the discussion. :shrug: (But regardless, that sounds like a toxic environment and I’m glad you’re out of there. To think that because someone has a degree in biology, that automatically precludes them from knowing anything about computers or programming that you don’t is just the epitome of arrogance and hubris.)
- slaymaker1907 3y agoI'm kind of surprised they didn't try to get rid of/adapt the standard for C++/CLI on Windows since it actually uses GC for a lot of things. However, I guess the standard wasn't all that useful, especially since it mandated a lot of overhead for pointer arithmetic. My theory is that it is very difficult to come up with a general API for interacting with GC'd memory in C++ because making the API efficient depends heavily on how it is implemented.
- pjmlp 3y agoYeah that is the thing, Unreal C++, C++/CLI, and COM/WinRT frameworks, are the main users of automatic memory management in C++ dialects, and none of them was taken into consideration.
- bjourne 3y agoIf it came to that it's time to whip out the technically right big dick and remind them that C++ has had smart pointers since forever and that TRACING garbage collection is far from the only automatic garbage collection technique known to man. ;)
- astrange 3y agoC++ has had conservative tracing garbage collection since forever; GCC is garbage collected and you can use Boehm gc.
- influx 3y ago
- vore 3y agoI would probably agree with those scientists, this seems like a “well actually” kind of gotcha claim with no practical significance when there is no usable implementation of this.
- CoastalCoder 3y agoI think the main issue with those folks wasn't if/how they're right, but rather how they treated the commenter.
- moralestapia 3y agoThis. The thing was so obscure that even seasoned people who have worked with this for many years didn't know about it. I guess the takeaway is to stay humble because you never know what you don't know.
- pavlov 3y agoAnd more specifically, never get into arguments about what C++ can do because it’s guaranteed that someone has used it the way you assume it should never be used.
- angiosperm 3y agoThey probably totally forgot the conversation only seconds later, and did not intend humiliation or perceive any humiliation. He said something not usefully correct for the circumstances under discussion, and was corrected without fuss. Then he carried a grudge.
- deleted 3y ago[deleted]
- astrange 3y agoThere is one. https://hboehm.info/gc/ https://hboehm.info/gc/
- 3y ago
- slingnow 3y agoWhat does this have to do with the article? This sounds like you're here gloating about some pedantic argument you made 4 years ago. And of course we are only hearing your side, so of course you're the hero. And judging by the fact that this is currently the top comment, I guess this is what other people come to HN (now) to read in the comments. Color me confused.
- quietbritishjim 3y agoNewer comments tend to float near the top for a while to give them a chance to get some upvotes.
- moralestapia 3y ago>What does this have to do with the article? Did you read it? It's about GC in C++ being a relative obscure feature that is now going to be removed. >some pedantic argument you made 4 years ago I just shared an anecdote related to it and I thought it'd be appropriate bc. this is/was quite likely the only chance I'd have in life to talk about this very very very specific situation with people that would understand it. And yes, it's getting a few upvotes, weird thing to be mad at that but to each its own.
- skitter 3y agoIt was in the spec but never implemented, so it's obly a feature of C++ if you take the stance that there are no real implementations of C++.
- moralestapia 3y agoIIRC it was present in Clang back at the time (which was relevant to us as we were using it); not sure about gcc or others.
- TeMPOraL 3y agoIf you want to go this way, then take a look at compiler support matrix for last few language versions - if having an implementation is necessary for something in spec to "be a feature of C++", then C++20 and C++23 are still missing some features they're supposed to have.
- jpcfl 3y agoClassic gatekeeping.
- sidewndr46 3y agoIt's not just you and not just biologists. I've had engineers with 20+ years of experience tell me that fixed width types don't exist in C++
- clnq 3y agoPresumably 20+ years of experience somewhere far away from C++.
- bfrog 3y agoDoubtful, C++ tends to bring exactly this sort of persona to the forefront
- sidewndr46 3y agono the majority of the career experience was with C++
- Kranar 3y agoDepends what they meant. An expert in C++ likely meant that C++ does not guarantee any fixed width types. Whether they are provided depends on the implementation.
- kazinator 3y agoYou have to arm yourself with facts. - know exactly what you mean by "C++ has support for garbage collection" - have the chapter-and-verse citations from ISO C++ ready if someone disagrees - understand the limitations of what is required in the document, and be the first to point that out - and have a good idea of some of the landscape in terms of what of those requirements is implemented in the wild
- EmilyHughes 3y agoHow about you stop caring that much about proving others right.
- SillyUsername 3y agoHe cares about proving others wrong...
- timacles 3y agoThats just a good approach to being well versed on a topic, it doesn't have to be for adversarial situations only
- bfrog 3y agoThat goes against the entire premise of C++ developers mindset.
- kazinator 3y agoYou mean proving others wrong? In this situation, those others were not exactly wrong. It was about OP proving also not being wrong. If people in your organization think you said something stupid, that could be bad for your opportunities there. If you say something which is correct, but the correctness depends on some unusual conditions that are not well known, or special interpretations of common concepts, or some context that is not shared with whoever you're talking to, you have to either not mention that, or spell out those details. If you posit that pigs do fly, don't forget the detail that it's when they are shot out of a cannon.
- coolsunglasses 3y ago
- SillyUsername 3y agoIt's like when you say Java has a GOTO. It's in bytecode, in the language as a reserved word, and has a rarely used partial implementation vis-a-vis label: https://www.geeksforgeeks.org/g-fact-64/ https://www.geeksforgeeks.org/g-fact-64/ Ultimately, thankfully, it never got made into a real keyword.
- tester756 3y ago>Ultimately, thankfully, it never got made into a real keyword. Why "thankfully"?
- ska 3y agocanonically: https://homepages.cwi.nl/~storm/teaching/reader/Dijkstra68.pdf https://homepages.cwi.nl/~storm/teaching/reader/Dijkstra68.p... but see also 50+ years of back and forth on that subject, other opinions available.
- tester756 3y agoThis paper was written in the times where goto was way more powerful than current goto, wasn't it?
- SillyUsername 3y agoI'm guessing you never had to debug spaghetti non OO code that used GOTO or you'd not be asking that question :D
- gugagore 3y agoOO is a lot of things to a lot of people, but it's not "structured control flow".
- tester756 3y agoWhat's difference between debugging spaghetti non OO code from debuggin spaghetti abused OO code? both are terrible mess to debug, yet we aren't calling out ppl using (or even abusing) OOP
- deleted 3y ago[deleted]
- _ea1k 3y agoIt is shocking how groups can create an environment of being proudly wrong. Once you see the pattern, you see it everywhere. Hahaha, how can that guy be so stupid as to think the world isn't flat? Easy to see in hindsight, but it happens with everything (programming language a vs b, OS A vs B, etc). Groupthink is strong and even the people who agree with you might find themselves not pointing it out.
- harry8 3y agoThat kind of blatant ass-holery is really common in C++ circles and you even see Bjarne doing it. "I understand what you are trying to say and I think you are wrong" at a conf to delighted razzes and jeers from the room. Bjarne had seemingly just discovered that link lists thrash cache and was presenting about swapping in a vector instead. Note it's got nothing to do with whether this guy is onto something or not. It is possible to disagree without being an asshole. Bjarne missed the opportunity. C++ culture follows. https://youtu.be/SfkMiGFVhZo?si=pd36kbm9FFoKFuKm&t=4111 https://youtu.be/SfkMiGFVhZo?si=pd36kbm9FFoKFuKm&t=4111 IMHO it is unsurprising there's a lot of groupthink involved in such a culture and it has really damaged the language and certainly makes it unpleasant in the way you describe.
- angiosperm 3y agoBjarne 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.
- harry8 3y agoI 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.
- est31 3y agoYeah it's like saying that Linux has support for case insensitive paths or that Windows supports forwards slashes in paths. People with some limited amount of knowledge will quickly tell you that you are wrong, but it is them who are wrong. Many don't even give you the little benefit of the doubt to do a small internet search, and yeah the problem is worse when you are an "outsider" in some sense.
- thujone 3y agoBah, the only thing worse than a buncha arrogant C++ programmers is someone who complains about them
- hcnews 3y agoMaybe you were technically right for some small scope of the problem, no proper industry definition of GC was supported by C++ by any of the major compiler. So, the HPC scientists were right imo. Being technically right for an aspect that doesn't matter is a common trope that a lot of software engineers fall for.