blah blah blah is here! blah blah » Close

up0down
link

Just wanted to express my appreciation to both Vulpes and Madhatter.
You guys have made my C# experience that much better (and smoother!).
I'm sure allot of other members acknowledge your help on csharpfriends.
bool helping = true;
while(helping)
Console.Writeline(@"T H A N K Y O U !!!!!!!!!!!");

last answered 2 years ago

1 answers

up0down
link

Thanks DotNetProfessor, nice of you to say so, particularly in console application form ;)

up0down
link

lol.
I haven't been able to spend as much time here this past year, but its always good to hear that people appreciate the time others spend helping out.
I cut my C# teeth on these forums too (I can still remember when .NET was this big unknown thing that I thought was a ms branded version of java that only worked in windows). I've seen it over and over in my life: what goes around comes around. It came around for me so I just try to give it back as much as I can, when I can.

up0down
link

Here's a little miracle which I don't think our Java friends can perform ;)
using System;
class Miracle
{
unsafe static void Main()
{
string liquid = "water";
Console.WriteLine("It was {0}",liquid);
byte[] ia = new byte[]{119, 105, 110, 101, 33};
fixed(char* pc = liquid)
{
char* pc2 = pc;
for(int i = 0; i < ia.Length; i++)
{
*pc2++ = (char)ia[i];
}
}
Console.WriteLine("It's now {0}",liquid);
Console.ReadLine();
}
}

up0down
link

Ok Vulpes, you've stumped on that code! You don't expect us to be able to read that w/o running it now do you? haha

up0down
link

Yeah, unless you've memorized the ASCII table, you need to run it to see what it does :)
It's only intended as a bit of fun because code like this really is unsafe. If you're not careful you can corrupt the string intern table!

up0down
link

the only time I've ever done unsafe code in C# was blitting 3-4 partial images into one (done once per render call). there were several alternatives, but they were all too inefficient for what we were trying to do.
the two things that I really liked about C# over Java was operator overloads and unsafe contexts (and I guess value types can be lumped in there w/ that).

up0down
link

Those three things appealed to me too and also (back then) enums which for some unknown reason had been left out of the Java language.
Since then, of course, enums have been added to Java and are arguably better than C#'s implementation as they can include custom methods.

up0down
link

yea I forgot about enums. Java's implementation ended up being pretty nice. I actually have had some times where extensible enums would have been a life saver, and I had to resort to <a target="_new" href="http://sanity-free.org/140/creating_fake_enums.html">rolling my own</a> (thanks in part to code generation and partial classes), but with the advent of method extensions I guess it at least resolves being able to associate sort of "methods" with an enum, though being able to place them in the enum proper is arguably much better on so many levels.

This post was imported from csharpfriends, if you have a similiar question please ask it again.

All previous members have been migrated, hope you enjoy the new platform!

Feedback