Le 23 avr. 07 à 18:23, Vadim Lebedev a écrit :

- You wrote a tolowercase method, which exists in the String class of owutil. You should use this method instead of using yours
You're right,
meanwhile i've spent week-end browsing through boost docs, and i've found in <strings/algorithm.hpp> with wonderful collection of string related functions. for example there is a to_lower function which perfomance-wise is much better than
String::tolowercase. I suppose you're will not object if i'll use it.
or un-cased find function which is better proposition than double call to tolowercase and search

Ok so should better change code in String::toLowerCase to use this method instead so it will benefit all code.

- There is a struct definition/declaration in sendSmsMessage method. To keep WengoPhone coding standards, you should declare/ define it outside the method (you can keep it in the .cpp file), and declare it as a "class" with public methods.

I disagree here. I believe it is a mistake to have ALL of classes to be in global namespace it simply
augments chances of name conflict.
In this specific case the 'struct builder' is a functional object which is not intended to be used anywhere else but only inside sendSmsMessage function. There is no reason whatsoever to put it into global name space. As to usage of 'struct' instead of 'class' it is simple issue of NOISE/SIGNAL ratio. If i wrote 'class' i'll have to add 'public:' in the class body. Which would confer no additional information nor functionality. As I told before the 'struct builder' is for local consumption only, so if we can achieve the same result with
less text it  is better.

If you intend to use it only in this method, I agree this could stay in the method. However, still because I care about keeping a coding style in WengoPhone, you should use the class keyword to define it.

--
Philippe BERNERY <[EMAIL PROTECTED]>
http://dev.openwengo.org



_______________________________________________
Wengophone-devel mailing list
[email protected]
http://dev.openwengo.com/mailman/listinfo/wengophone-devel

Reply via email to