4 ms·
Honest question, why do you consider implicit << and >> for cin,cout to be too much magic?
by drenvuk 8y ago
Honest question, why do you consider implicit << and >> for cin,cout to be too much magic?
- saagarjha 8y agoIt's a misappropriation of an operator. C had a "definition" for them, and this completely disregards that definition. It's one of the biggest things people cry about when custom operators are brought up in other languages, because C++ really dropped the ball here in using operators in a sane way.
- kevin_thibedeau 8y agoAnd yet we had a few decades of magic 0 literals that transmute into pointers until we finally got a proper nullptr. There's some grade A impurity built directly into the core language and hard to avoid unlike the std lib.
- cjalmeida 8y agoIMO, the usefulness of things like CPY is being easy to read, without too much noise or boilerplate. (cout "hello") confuses the hell out of those with some C++ experience. It changes semantics if a known object for little gain (cout is callable, a statement)? Like someone else said, a "printout" new statement or function would be better. It's the kind of things that makes me question the design of the whole language.