← Back to team overview

kicad-developers team mailing list archive

Re: Locale fix in KiCAD is not working (breaks my build)

 

On 03/15/2013 11:39 AM, Miguel Angel Ajo Pelayo wrote:
> Ok, committed in 4008, cleanups included. 
>
> Finally I used the LOCALE_IO implementation, because converting in
> some situations didn't work, and my time was exhausting for today…
>
> I think there are some locale manipulators in std:: c++ that would
> let us do those conversions without switching system locale, but we will have to try.


We don't have to try.  We could wait until there is a problem.


If or when there is a problem, I would fight to protect the interfaces
we have become dependent on, one of which is OUTPUTFORMATTER::Print().
You shouldn't try to re-implement this without my help.


Writing good C++ software is really about placing and using carefully
crafted interfaces.   After that you can ad lib in between the
interfaces, so long as you honour them.


A C++ thread can be like the quirky guy who walks up the stairs of a
skyscraper, travelling across each floor and then back into the
stairwell to continue ascending.

When he travels across each floor, he is wearing the proper attire and
acting properly.  This is the interface. 

But in the stairwell he very well may be acting quite differently,
nobody knows, nobody cares.   Could be naked in there, could be
walking on his hands, screaming, yelling.   This is the implementation.

It pays to know which part of the C++ thread you are dealing with.  
Saves some embarrassment, and makes for better and more easily
maintained code.  Because you can always smoke bomb the implementation.






Follow ups

References