3 ms·
"efficient" DRY: as a programmer you know that having to maintain two identical copies of something to keep them in sync is bad. You should refactor. Now take
by ldar15 15y ago
"efficient"
DRY: as a programmer you know that having to maintain two identical copies of something to keep them in sync is bad. You should refactor. Now take that idea and make it part of the language: header files. You have to declare every method in the source file, and then again, in the header file.
That at least made some sense for C, because header files were small, compared to source files. Only a few key methods needed to be in the header files. Now take C++: the entire class declaration has to be in the header file, including all the private methods. Now every source file has to parse a much greater amount of header files.
For bonus points, don't change the rule that a header file can be included multiple times, with multiple different active #defines. So you cant optimize that.
Then, even if you do start using microsoft specific #pragma's, of compiler-recognizable #ifdef MYFILE_H #define MYFILE_H, these files can still render different syntax trees between different source files, so you can't parse them one per project.
Then, introduce templates. Basically, remove the need for a source file at all, and declare that huge reams of code will actually be in header files. Bonus: dont declare a new form of source file, just keep using header files for this, again with the rules that the same header file (of templates) can mean multiple different things in any given source file, despite the fact that this is guaranteed to Not Do You What You Expect even if you were foolish enough to do it.
The only template "improvement" in C++0x is "extern templates", which is basically a huge goddam hack that says to the compiler "look I know you've had to parse+comprehend this template code for every single source file but please dont actually generate the machine code in my object file".
Finally, get together and decide that of all the things fucked up about C++, its the lack of threading support that is the big problem for us all. Seriously?
There isn't any way to make Visual C++ "efficient" because it compiles C++. Likewise, "modern". If you mean "efficient" for typing / editing, then I'd recommend you have a look at Visual SlickEdit (if you are the IDE type) and even then you will be light years behind what a modern IDE can do with a modern language.
- alok-g 15y agoLove it man! Thanks >> even then you will be light years behind what a modern IDE can do with a modern language Could you point me to one? Especially interested in high-performance ones.