POV-Ray : Newsgroups : povray.off-topic : Lots of statistics : Re: C# WTF list Server Time
29 Jul 2024 16:26:52 EDT (-0400)
  Re: C# WTF list  
From: Warp
Date: 14 Aug 2012 13:38:46
Message: <502a8d26@news.povray.org>
Invisible <voi### [at] devnull> wrote:
> - Unsigned integers have names prefixed with "u", and signed integers 
> have no prefix. Except byte, which is the other way around: "byte" and 
> "sbyte". WTF?

Why would you expect bytes to be signed by default?

> - The "char" type works with Unicode. Well done. Oh, but wait... It only 
> stores 16 bits, and yet Unicode actually requires 24 bits to represent a 
> single code-point. So this "Unicode character" only actually covers the 
> Basic Multilingual Plane. FAIL!

I'm assuming it uses UTF-16.

> - "x + y" performs addition. Unless either argument is a string, in 
> which case the other is converted to a string as well (if not a string 
> already) and the strings are concatenated. Unless both arguments are 
> delegates, in which case they are concatenated. (I guess there's a 
> /reason/ the Java guys claim that operator overloading is evil!)

Using operator+ for string concatenation is pretty common. I have never
had any kind of confusion with it. (You would have to come up with a
really artificial example to deliberately make it confusing.)

Automatically converting the right hand side to a string sounds more
dubious to me. Sounds like it may easily be done inadvertently, causing
all kinds of bugs.

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.