4 ms·
This idea that 'files' are an organizing principle is bankrupt. In an editor I don't even know what file a method is in. Including header files is an annoyance,
by JoeAltmaier 12y ago
This idea that 'files' are an organizing principle is bankrupt. In an editor I don't even know what file a method is in. Including header files is an annoyance, and should be automated.
In fact all code should be in a database, not a file, so changes can be tracked and attributed properly. So a tool can distinguish between 'lines being edited' and 'one function deleted and another added'. And so on.
So what organizing principle is left, since files are largely invisible during the coding process? Well, classes spring to mind.
- throwawayaway 12y agoI think you need a better editor if you don't know what file a method is in. There will be very few classes in your project if you decide to prefer non member non friend functions as suggested here. The question being, whether you go along with that suggestion or not?
- JoeAltmaier 12y agoI guess that wasn't clear. I surf methods, not by opening files, but by going directly to the definition or declaration as needed. Sure its in some file, but I deal with 1000 methods and sure don't make any effort to memorize where they are - since its entirely irrelevant to the correctness of the code. To make it clear: I favor factoring APIs into classes.
- throwawayaway 12y agoI think factoring api's into classes makes a lot of sense too, I think this idea of preferring non member functions undoes a lot of the functionality and team building cohesiveness that C++ offers. It's strange that C++ luminaries like Stepanov, Meyers and Stroustrup favour non member functions.