3 ms·
I find it unreasonable that every language would have all of its features always compatible. Why can't we just say "don't use X and Y together" ? It might solve
by 0xbadcafebee 4y ago
I find it unreasonable that every language would have all of its features always compatible. Why can't we just say "don't use X and Y together" ? It might solve a ton of problems. All you have to do is have a big red warning in the manual that says DON'T COMBINE X AND Y, and a language feature that lets you turn on X and turn off Y.
- selfmodruntime 4y ago> Why can't we just say "don't use X and Y together"? Because that goes against the most fundamental idea of programming languages that you can build larger abstractions by combining basic building blocks.
- travisgriggs 4y agoAbstractly speaking, what if we consider a "big ball of spaghetti" and "working program" to both be abstractions of just "a program". Now it fits under the larger abstraction umbrella still. :D All other things aside, C++ seems to be the language "to big to fail" and so it just keeps getting more and more features added to keep it competitive.
- deleted 4y ago[deleted]
- 0xbadcafebee 4y agoA half dozen languages already do this and abstractions still work
- lionkor 4y agoIts okay to say "but you cant combine those two". Its also okay to point out that not every feature should be combinable with every other feature, and that needing to do so is likely an indicator of terrible (user-side) software design
- eru 4y agoThen at least the compiler should complain, when you try to combine incompatible features.
- extropy 4y agoSure, here is your Lego set. But do not put while bricks next to red ones or it will explode!
- CJefferson 4y agoWho reads the "manual of C++" -- what even is that, the standard document (certainly no-one should read that for learning). It would be just about OK for the compiler to refuse to compile X and Y together. If you "switched off" X, then in C++ (where code is in headers which are just concatenated with your code), this would effectively split the language, as you also couldn't use libraries which use X in their headers.
- jejones3141 4y agoOrthogonality has been recognized as desirable at least since the days of Algol 68. Once you couldn't pass a struct as a parameter in C. Now you can.
- deleted 4y ago[deleted]