Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best practice for renaming property/method names that are reserved words?

I'm creating a class. What's the best practice for naming properties/methods when your preferred name is a reserved word?

like image 582
Cory House Avatar asked Apr 25 '09 15:04

Cory House


1 Answers

I usually try to think of some synonymous alternative word, or variation, though it doesn't sound like that is applicable for you.

Alternatively, you can use the '@' prefix (in C#) or [square braces] (in VB.NET) to explicitly avoid the conflict with reserved words in the language.

like image 118
Daniel Fortunov Avatar answered Oct 12 '22 23:10

Daniel Fortunov