Click here to Skip to main content
15,881,248 members
Articles / Programming Languages / C#

.NET: String Constants vs Static Readonly Fields

Rate me:
Please Sign up or sign in to vote.
4.29/5 (7 votes)
13 Jan 2013Apache1 min read 27.3K   6  
If there is even a remote possibility that your “constant” value might change in the next version, make it a readonly field.

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

No alternatives have been posted.

License

This article, along with any associated source code and files, is licensed under The Apache License, Version 2.0


Written By
Technical Lead Thomson Reuters
United States United States
Ivan is a hands-on software architect/technical lead working for Thomson Reuters in the New York City area. At present I am mostly building complex multi-threaded WPF application for the financial sector, but I am also interested in cloud computing, web development, mobile development, etc.

Please visit my web site: www.ikriv.com.

Comments and Discussions