For Programmers: Free Programming Magazines  


Home > Archive > Cobol > February 2007 > Re: My First C# (warning - long post)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: My First C# (warning - long post)
andrewmcdonagh

2007-02-04, 6:55 pm

On Feb 3, 12:20 am, "Pete Dashwood"
<dashw...@removethis.enternet.co.nz> wrote:
> "andrewmcdonagh" <andrewmcdon...@gmail.com> wrote in message
>
> news:1170416819.673830.134600@k78g2000cwa.googlegroups.com...> On Feb 2, 1:42 am, LX-i <lxi0...@netscape.net> wrote:
>
> <snip>
>
>
> Er...not necessarily... :-)
>
> Although C# supports the Hashtable function (so Java folks can remain
> comfortable...:-)), it is much better to use the C# Dictionary Class
> because it doesn't require boxing and unboxing of objects.
>
> Furthermore, the Dictionary Class DOES support a collection of Keys and
> Values as separate entities, if you want this.
>
> I have no issue with the approach (it's very good), but would strongly
> recommend Dictionary, rather than Hashtable.
>
> (Check out the VS 2005 Help index for "Dictionary"...)
>


Yeah I saw Dictionary, though I thought that autoboxing would not
happen with String objects... this is my Java expo making me assume
things not necessary correct in c#.

nice one though!

snipped...

>
> Really good sample code above, Andrew. Good stuff!
>
> Pete.


Cheers, though it wasn't mine, I copied it from MSDN and edited to fit
with our topic of keywords...

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com