HPP stands for C++ and has better syntax highlight support in geany You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/999
-- Commit Summary --
* .h -> .hpp
-- File Changes --
M plugins/classbuilder.c (2)
-- Patch Links --
https://github.com/geany/geany/pull/999.patch https://github.com/geany/geany/pull/999.diff
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/999
Seems kind of arbitrary to use `.hpp` over the number of other extensions people use for C++ headers. Likely `.h` was chosen because it's the most common extension for C++ headers, at least historically.
If you remove [the `*.h` from the `C` key in `filetype_extensions.conf`](https://github.com/geany/geany/blob/master/data/filetype_extensions.conf#L13) it will treat them as C++ files and you'll get proper highlighting and symbols for `.h` files. I do this here and it works great for both C and C++ headers, except that it wrongly highlights `namespace` and `class` and such in C headers, but I never use those in plain C headers anyway.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/999#issuecomment-210880521
I agree with the OP that we should use a real C++-specific header extension. C++ using `.h` for its header was a really bad idea IMO, because it's *not* the same, although it's similar, creating mass confusion and a lot of subtle bugs everywhere.
Sure, we probably should do everything we can to support C++ headers using a `.h` extension out of the box, but we probably shouldn't spread its usage even more. I'd love for the next C++ standard to deprecate the .h extension or even better, remove it :) It wouldn't mean much, but still.
So, LGBI for me.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/999#issuecomment-210883318
@b4n I agree it's sub-optimal, but `.h` still is the most widely used extension for C++ headers, the same as if we had an Objective-C class generator, it would auto-type `.h` for the header filename, since that's what people tend to use most often.
Besides, the user can easily type `pp` after the `.h` in the GUI before creating the class, and the file will be named like that, it's only an auto-filled default.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/999#issuecomment-210883688
Another alternative, which I actually don't like, but is valid, would be to have the default use no extension at all, which is probably the 2nd most common for C++ headers files. The class generator could insert a `// -*- C++ -*-` or whatever comment so Geany would recognize it.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/999#issuecomment-210886182
DO NOT USE `.h` FOR C++ WORST IDEA BJARNE EVER HAD :)
Agree with OP `.hpp` is reasonably common, and well, we have to pick something, unless "somebody" is going to add a setting to classbuilder, I would say use `.hpp` until then.
LGBI
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/999#issuecomment-210921204
we have to pick something
The sort of default would be `.h`, no? I agree it's stupid that C++ and Obj-C re-use this extension for the same purpose, but it's a reasonable default. It's not like anyone who cares can't just type 2 characters in the GUI textbox to use their preference.
In a perfect world there would be a real filetype for C++ header files and class builder could use the default extension, but at present, the current `.h` extension is completely reasonable..
That being said, I don't really care, I just think it's arbitrary to use `.hpp` over any of the other common extensions (or lack thereof) for C++ headers.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/999#issuecomment-210927662
I just think it's arbitrary to use `.hpp` over any of the other common extensions (or lack thereof) for C++ headers.
Yes, its arbitary, so lets pick the arbitary one that gives *US* least problems, and which matches the `.cpp` body default.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/999#issuecomment-210937518
so lets pick the arbitary one that gives US least problems
Technically `.h` gives _US_ least problems as it requires nothing to be done :)
In any case, whatever you guys think is best, it's as trivial to delete two characters from the filename as it is to add them, and I don't personally use the C++ class generator anyway.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/999#issuecomment-210967899
Closed #999 via a5a47da9f29dcc329eac45176073c5c47c88df44.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/999#event-646282202
Cheery-picked and reworded as a5a47da9f29dcc329eac45176073c5c47c88df44, thanks!
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/999#issuecomment-215896573
github-comments@lists.geany.org