Header files (Re: A little review of kdecore & kdeui)
hausmann at kde.org
Sat Apr 8 14:13:41 BST 2006
On Saturday 08 April 2006 14:54, R.F. Pels wrote:
> On Saturday 8 April 2006 14.26, Cornelius Schumacher wrote:
> > > From my own real-world experience: every piece of software I ported
> > > from Windows to Linux did have incorrect includes, the developers just
> > > don't care about the case. Having one *simple* rule helps in this
> > > regard.
> > I can't imagine a more simple rule than "The include is exactly the same
> > as the class name".
> Or source name == header name == class name all lowercase.
> > If under Windoes a wrong case is not an error, there always will be wrong
> > includes when porting to Linux regardless of the convention. But as
> > Thiago pointed out this is trivial to fix.
> I'll throw in another argument. Yes, it's simple to apply that rule as long
> as you're dealing with the source. That is, if you have a more or less
> direct hint for correctly casing the name. It gets difficult as soon as
> this is going to mean that:
> - the .cpp source is NOT following the same rule, and
> - if one needs to hand-edit for example build files referencing
> the names from memory.
> The point here is that it is easier to remember a classname than
> remembering a classname including the currect casing.
When was the last time you typed
qlabel *l = new qlabel("hi");
and wondered why it doesn't compile? :)
Developing software with KDE and Qt means remembering the correct casing. All
the documentation lists the class names accordingly. There's no way around
it, not even lowercase header files can prevent the compiler from complaining
that qlineedit is not a known class name ;-)
More information about the kde-core-devel