Journey into C#
Being a moderatly to quite skilled programmer since 15 years, the past four years PHP exclusive, I have for various reasons decided to take up C#. This blog is for sharing my ups and downs with fellow C# coders, beginners and pros alike.
onsdag, augusti 18, 2004
 
Dictionaries
I've just finished reading about dictionaries, something that might be unique to C#. Then again, I haven't coded in any modern OOP language before this so what do I know?

At first I was unimpressed with dictionaries, all it seemed to be was a way to use strings to index an array. Big deal, I can do that in PHP without breaking a sweat. I changed my mind after reading the chapter though.

Now they seem like something taken out of The Matrix; not only resizing themselves as needed but also using magic prime number based algorithms coded by Microsoft to grab the key, which can be any object of your liking, and search through the load for the actual object stored god knows where. If you screw up your own GetHashCode() and Equals() methods, your data can get lost forever in the vast darkness of cyberspace, never to be found again.

I'm sure they're quite clever and very versatile but right now I have a hard time seeing why they are more powerful than PHP's arrays. Or perhaps PHP is using dictionaries as well?

Still, it's knowing about these kind of things that makes me more confident that I one day will actually be able to write proper C# code.

Comments: Skicka en kommentar

<< Home

Powered by Blogger