[haiku-development] Re: BWeakReferenceable

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Fri, 23 Sep 2011 09:51:05 +0200 (MEST)

Clemens<clemens.zeidler@xxxxxxxxxxxxxx> wrote:
> void Method(LongClassNameNumber1Ref class1, Class2Ref class2);
> this solution has the drawback that you have to do it for each class.

You don't, as this problem will only happen very rarely, and introducing a 
typedef for those cases seems to be fine.

> Another solution would be to shorten the name a bit e.g.:
> template<class T>
> typedef BReference<T> sp;     // sp strong pointer or sr strong reference
[...]
> although sp is not very meaningful combined with the template argument I  
> thing its pretty obvious what it means.

But only if you know already beforehand. If you didn't notice it, Haiku's API 
is not only trying to be consistent, but also readable (like the recent TR() -> 
B_TRANSLATE() macro name change) :-)
If typing speed is what slows you down during programming you must either be 
*pretty* smart or a pretty slow typist ;-)

Of course, too long names hurt readability as well, but I don't think this is a 
problem with the names involved here, especially since they are used only 
rarely.

Bye,
   Axel.


Other related posts: