4 ms·
How is it that D and Objective-C++ came up with modules that work and can be used many years ago, yet C++ with much greater stakes fumbled it on almost every le
by Conscat 2y ago
How is it that D and Objective-C++ came up with modules that work and can be used many years ago, yet C++ with much greater stakes fumbled it on almost every level?
- marcosdumay 2y agoBecause the C family is guided by a committee. Even worse, an important and respected committee.
- wudangmonk 2y agoThe issue seems to be the C++ committee, never heard anyone complain about C's committee.
- nicoburns 2y agoThe C committee's big problem is being too conservative. But you don't hear too many complaints because people just use C++.
- flohofwoe 2y agoI think the reason is more that the goals of the C committee align better with the goals of C programmers (which is a language that's a tool and not a playground for language designers). Unlike C++, C also remained a simple language (which is definitely a side effect of the "conservatism" of the C committee).
- edflsafoiewq 2y agoThat's what he means; like the puddle which marvelously fits its own hole, anyone for whom C in all of its aspects is not very close to optimal has long ago moved to another language.
- rightbyte 2y agoWait what? C's greatest strength IMO is that it hardly change at all. The mental overload of some small things added every 10th year and in use 20 years later is how I like it.
- shrimp_emoji 2y agoAmen. If you crave excitement, there's Rust and Go. (And I say that in the vein of "may you live in exciting times". ;D) Oh, and there's D if you want to immersively roleplay like you're in an alternate timeline, like Infinite Jest or something.
- pjmlp 2y agoGo check the complaints on anything past C11, or how after 50 years WG14 keeps ignoring security issues.
- flohofwoe 2y agoThe "C family" has two committees, one that works fairly well (https://www.open-std.org/jtc1/sc22/wg14/ https://www.open-std.org/jtc1/sc22/wg14/) and one that doesn't (https://www.open-std.org/jtc1/sc22/wg21/ https://www.open-std.org/jtc1/sc22/wg21/).
- murderfs 2y agoWG14 has only "worked" fairly well insofar as it did absolutely nothing but file the serial numbers off of things standardized in C++ and release them. The biggest C-original features (type generic macros, annex K) are all gigantic boondoggles. Even many of the features that were lifted from C++ were poorly thought out (e.g. compatibility between <stdatomic.h> and <atomic>).
- flohofwoe 2y agoThe biggest C-original feature since C89 is easily designated-initialization in C99, and WG21 couldn't even get that simple thing right when they tried to copy it into C++20 two decades later (even though Clang had a working implementation in C++ mode since forever which just had to be copied by the standard).
- shrimp_emoji 2y agoYour struct should just have a constructor. :) Hey, pass me more OOKoolaid. No, it's fine; all the bottles say "Expires 2005", but it's still good.
- flohofwoe 2y agoTBH, all the gazillion ways that C++ has invented over time for initialising data are a poor substitute for simple C99 designated init.
- imachine1980_ 2y agoIs easy, you don't have the same amount of courdination problem, most of what's wrong in software today have in big part problems whit two things legacy and coordination problems, need back compatibility means that useful solution aren't posible, soy then you need to compromise and then compromise again because some users cant use you solution, so now you have solution who don't satisfied anyone, sum that whit natural misalignment of any organization and is obviously that focus sitmrs whit few stakeholders and willingness and capacity to break change can do a better job, this ins't particular problem of programming.
- nine_k 2y agoExactly because of much greater stakes. A lot of heavyweights involved, and nobody agrees to yield. The result is a compromise, aka a solution which is unsatisfactory to all parties to an equal degree, as they say. Best designs are produced by small, tightly-knot, often one-person design teams. Examples: Unix, Clojure, SQLite, Boeing-747, Westminster Palace in London. Sometimes a small team with a cohesive vision keeps on attracting like-minded people or matching ideas, and the project grows with contributions from a large number of people. The key part of every such success is the vetting process. Examples: Python, Ruby, FreeBSD and OpenBSD. Worst designs with most glaring, painful, expensive, even tragic shortcomings are produced by large committees of very important people from huge, very (self-)important companies, agencies, departments, etc. Each of them has an axe to grind or, worse, a pet peeve. Examples: PL/I, Algol-68, the Space Shuttle (killed two crews because the escape system was removed from the quite sane initial design); to a lesser degree, it's also HTML, CSS, and, well, C++ to a large degree :( The disease has a name [1]. Sometimes a relatively small and cohesive team in a large honking corporation produces a nice, cohesive design, like this happened to Typescript, certain better parts of CSS, and some of the better parts of C++. This may sometimes make a false impression that "design by committee" sometimes works. [1]: https://en.wikipedia.org/wiki/Design_by_committee https://en.wikipedia.org/wiki/Design_by_committee
- intelVISA 2y agoModern C++ would easily be The Perfect Language... if only it wasn't designed by committee and thus sabotaged by all those Very Important People.
- astrange 2y agoSQLite is three people, which is probably better than one because you do want to bounce ideas off people. Not sure about Unix… it's gone through a lot at this point and obviously it's a committee now.
- nine_k 2y agoThe original Unix is also about 5 people, with Ken Thompson being largely credited with the general design. Of course, later the decoherence increased; I'd say that the adoption of Berkeley Sockets is one of the inflection points where severely different architectural principles came into play.
- jokoon 2y agoBackward compatibility with existing compilers. And more importantly, not breaking old, old codebases, which is a very critical problem. Obj-C++ and D don't have critical codebases, because there is just so much less code. Apple does what they want. Like Stroustrup says, when a language is not used, it won't generate problem: I gues his quote is often quite overlooked, but it's very very true. Compilers are a difficult topic.
- shdnx 2y agoThere is no backwards compatibility here to speak of: C++ modules are a new feature introduced by the C++20 standard. There was absolutely no reason to make a mess out of them.
- jokoon 2y agoMaybe we need to interview a C++ compiler engineer, for microsoft, GCC, clang, etc, because C++ is a large language that carries its compilation model from C, and I don't think making modules happen, or implementing them, is a trivial task. I don't think they intended to make a mess, I think that C++ compilers are just massive things with massive codebases, and several different companies who have to agree on one language. There are many non-trivial obstacles.
- plorkyeran 2y agoAfter a decade of using obj-c modules I'm still unclear on what the benefit of them is other than the Swift bridging aspects of it. There isn't really any observable difference in either compile-time performance or behavior from turning them on and off other than that a lot of the rules around inclusions are much stricter with modules enabled. The documentation claims that they should improve build performance, but AFAICT that isn't actually true or the difference is so small as to be irrelevant.
- astrange 2y agoIt's somewhat true and it should also improve debugger performance, but it takes a very long time to get to the point where that can be turned on and anyone sees it. (keyword is "explicit modules")