Hi Branden, On Tue Nov 19, 2024 at 12:37 AM CET, G. Branden Robinson wrote: > At 2024-11-18T21:43:24+0100, onf wrote: > > [...] > > Just a small nitpick, but you should probably do s/(warning) /\1/. > > Yes, that was a code style goof. Thanks! Fixed.
Hopefully the way I suggested... GNU's code style guides tend to be awful. > [...] > The `string` class is what it says, and does something > Stroustrup encouraged everyone to do in the pre-ISO days of C++ when > groff was first written. "Roll your own!" he enthused. "C++ makes > memory management and automatically growing vectors easy! Just use the > free store!" (He never calls dynamic storage a "heap", to this day.) > "You can tune your custom string class to do only what you need! C++ > imposes no overhead on you! Zero-cost abstractions! You give up no > speed! It's as fast as C!" Sales pitch, sales pitch, sales pitch. > > James Clark listened and followed recommended best practice. > > So anyway, both classes have `contents()` member functions. > > And why not? Isomorphism for the win, right? Operations that do the > same thing should have the same names, right? '<<' means "left shift", > right? Also "write stuff to a stream" or "generic output operator"... > What? Also look at Java and its debacle with a multiplicity of > different ways for getting the lengths of things.[1] But I digress. I like the nickname sometimes given to C++, swiss army chainsaw. Be careful or it will cost you an arm and a leg... :) > [...] C-like OOP languages [...] Sounds like an oxymoron to me. Although some OOP constructs are possible in C, they don't come very naturally to the language. Perhaps you meant C++-like? [1] ~ onf [1] Contrary to what many people think, there is no such thing as C/C++, because C++ is not a complete superset of C.