Thursday, June 24, 2010

Verbatim Identifiers in C#

Not that many people realize that in C#, one can use language keyword names like "void" and "bool" for their identifiers.
The trick is, you need to prefix the name i.e.:

 void @void() {}

declares method named "void".

Of course you would rarely use this feature, if ever but many people start arguing "Why Microsoft did this to begin with?"

I am personally 100% on-board with MS on this one, - not only this is a good practice to be consistent in language design (less limitations) by allowing programmer to use any name
 but this is a must-have feature i.e. you may code an assembly in Delphi Prism( as an example) and call a method "void" -
 then you'd need to consume it in C#. "void" is not a keyword in that language.

I personally think that purposely naming you stuff with "dangerous" names is a bad thing, but having verbatim name capability makes us feel more liberated :)


16 comments:

Anonymous said...

Adeline ROCKS?!

Sharon

Anonymous said...

Hey, I can't view your site properly within Opera, I actually hope you look into fixing this.

Anonymous said...

спасибо друг

Anonymous said...

Keep posting stuff like this i really like it

Anonymous said...

Couldnt agree more with that, very attractive article

Anonymous said...

I just added your blog site to my blogroll, I pray you would give some thought to doing the same.

Anonymous said...

Superb blog post, I have book marked this internet site so ideally I’ll see much more on this subject in the foreseeable future!

Anonymous said...

Finally, an issue that I am passionate about. I have looked for information of this caliber for the last several hours. Your site is greatly appreciated.

Anonymous said...

learned a lot

Anonymous said...

Wow this is a great resource.. I’m enjoying it.. good article

Unknown said...

ravens jerseys
michael kors handbags
hermes belt
fitflops shoes
abercrombie and fitch
michael kors outlet store
michael kors handbags
nike air huarache
bears jerseys
michael kors handbags

ajudan pk said...

I really love this post I will visit again to read your post in a very short time and I hope you will make more posts like this.
cara menggugurkan hamil

Obat Herbal Mimisan Menahun said...

Any disease will surely recover, if we want businesses seek treatment :)

Obat Dermatitis Statis
Cara Ampuh Menyembuhkan Kaligata
Khasiat Lidah Buaya Untuk Keloid Di Kulit Tubuh
Cara Ampuh Menyembuhkan Penyakit Muntaber
Cara Mujarab Mengobati Dermatomiositis
Pengobatan Herbal Jantung Bengkak

Unknown said...

2018531 leilei3915
canada goose
ray ban sunglasses
pandora outlet
coach outlet store online
pandora charms
kate spade outlet online
michael kors handbags
christian louboutin shoes
louis vuitton outlet online
true religion

salma said...




شركة تنظيف في الكويت شركة تنظيف بالكويت
فني صحي فني صحي
سباك الكويت سباك صحي بالكويت معلم سباك صحي الكويت هندي

شركة غسيل سجاد الكويت افضل شركة مصبغة غسيل تنظيف سجاد الكويت
فني كهربائي منازل الكويت معلم فني كهربائي منازل في الكويت




eadwinnubben said...

Harrah's Casino - Tunica Resorts
The casino features 218 충청북도 출장마사지 slot machines and nearly 1,000 slot machines. It was opened in November 1996. It is owned and operated by Harrah's.Owner: Tunica 영주 출장안마 ResortsOpening date: November 30, 1996; 12 제주도 출장마사지 years aLocation: Tunica 김포 출장안마 Resorts, Mississippi 38630‎History 양주 출장샵 · ‎Restaurants · ‎Gaming · ‎Hotel · ‎Restaurants