4 ms·
Any serious editor will read the #! line for syntax highlighting, which has the benefit of being much more likely to be correct than the user visible and modifi
by jfb 13y ago
Any serious editor will read the #! line for syntax highlighting, which has the benefit of being much more likely to be correct than the user visible and modifiable file name.
- raverbashing 13y agoExcept when it doesn't have that line because it's a C/C+header file. And then the editor doesn't know what to do with that header file without extension. Yes, if you see some Google C++ code they do that Really, horrible practice.
- kondro 13y agoWhat are you doing making C header files executable?
- raverbashing 13y agoWhere did I say I was making it executable?
- kondro 13y agoThey were only advocating no extension for executable shell files, not all files.
- raverbashing 13y agoYes, I remembered seeing a C++ google product without the .h extension in header files (or other similar extensions) But apparently they stopped this nonsense
- ithkuil 13y agoIt's not google, it's C++ convention. http://stackoverflow.com/questions/301586/what-is-the-difference-between-using-includefilename-and-includefilename-h http://stackoverflow.com/questions/301586/what-is-the-differ... Btw, many editors understand // -- C++ -- Nevertheless Google's c++ style guide (https://code.google.com/p/google-styleguide/source/browse/trunk/cppguide.xml https://code.google.com/p/google-styleguide/source/browse/tr...) in fact says that headers should have the .h suffix.
- raverbashing 13y agoAh thanks for pointing that out > Btw, many editors understand // -- C++ -- Maybe, but if I vim /usr/include/c++/4.2.1/iostream doesn't work (only if I set it manually)