kicad-developers team mailing list archive
Mailing list archive
Re: Hating wx configuration more than ever...
On 05/08/2012 01:15 AM, Lorenzo Marcantonio wrote:
> On Tue, May 08, 2012 at 01:01:07AM -0500, Dick Hollenbeck wrote:
>> With latest wx, wxString is a container holding a std::string holding characters encoded
>> as UTF8 bytes on linux and OSX. Windows is unknown.
> UTF8? not wide chars? Strange, the C++ approach is usually using
> wchar_t, not MBCS... there *is* a configure option for using UTF8 in
> 2.9, maybe that's active in your build.
> This would actually break every indexed access to the string (unless
> they abstracted it with huge performance penalties,
Its not so huge. I've written this exact UTF8 round tripping code when I wrote my Java
virtual machine. It's a short couple of functions, not a whole lot more involved than a
strcpy() with 3-4 if() statements.
Besides, it gives the computer something to do when it doesn't have anything else to do,
which is most of the time.
Also, remember that you gain in most circumstances since you probably started with
serialized bytes. Storage (.e.g. disk or network) is mostly a matter of working with
bytes. So this gain tends to balance out the cost you mention with respect to indexing.
We are probably burning more cycles converting to 16 or 32 bit characters in KiCad than
the cost of indexing for insertion would cost.
My main points were:
a) there is no longer a reason for wxWidgets project to have their own string class. It
leads to lack of portability, creates an attachment to wx, and makes folks learn another
way of doing something for which there is now a standard in C++.
b) Microsoft is not a good foundation on which to base any software investment, since they
tend not to ask for outside opinions when they design, and change their minds often after
they realize their mistakes. I see now that they are having second thoughts on .NET.
This means that for wx to have a special wxString for Microsoft is more of the same
industry wide catering. C++ standards people do not jump through Microsoft hoops, nor
should we, nor should wx.
> having to start from
> the beginning each time).
> I see 6GB ram *laptops* around.
Go buy some, quit whining about opengl. :)
> I think these days string processing
> (i.e. not only copying strings from a place to another) in core is more
> convenient with wchars...
No, that "convenience" is established by the API. My convenience is not the computer's