29-Sep-2014 03:48, Walter Bright пишет:
On 9/28/2014 2:00 PM, Dmitry Olshansky wrote:
I've already stated my perception of the "no stinking exceptions", and
"no
destructors 'cause i want it fast" elsewhere.

Code must be correct and fast, with correct being a precondition for any
performance tuning and speed hacks.

Sure. I'm not arguing for preferring incorrect code.


Correct usually entails exceptions and automatic cleanup. I also do
not believe
the "exceptions have to be slow" motto, they are costly but proportion
of such
costs was largely exaggerated.

I think it was you that suggested that instead of throwing on invalid
UTF, that the replacement character be used instead? Or maybe not, I'm
not quite sure.

Aye that was me. I'd much prefer nothrow decoding. There should be an option to throw on bad input though (and we have it already), for programs that do not expect to work with even partially broken input.


Regardless, the replacement character method is widely used and accepted
practice. There's no reason to throw.



--
Dmitry Olshansky

Reply via email to