(no title) (original) (raw)
This is something I've never noticed since working with .NET basically since it was in beta until today, but I find it incredibly lame and odd and I was wondering if anyone here understood the motivation for this awfully VB-like behavior:
int thisInt = 42; string thisString = "This is a string which as far as I know is a primitive in C#.NET!";
string thisShouldNotWork = thisString + thisInt;
thisShouldNotWork == "This is a string which as far as I know is a primitive in C#.NET!42"
WTF? Granted I haven't written in C++ in some time, but I was fairly certain that doing something like this in a real language would result in A) a typecasting exception or B) The string becoming absolute gibberish since the bits of memory being appended to it do not represent the data contained in a string object.
Am I on crack or is this something suspiciously VB-like in C#'s behavior (not to suggest that there aren't many other VB-like behaviors or that C# is some kind of low-level language, but still).