Paulo Morgado

.NET Development & Architecture

This Blog

Syndication

Search

Tags

News

Unit Test Today! Get Typemock Isolator!

Projects

Books

 

Visitors

Visitor Locations

Community

Email Notifications

Archives

Profile

Disclaimer

The opinions and viewpoints expressed in this site are mine and do not necessarily reflect those of Microsoft, my employer or any community that I belong to. Any code or opinions are offered as is. Products or services mentioned are purchased by me, made available to me by my employer or the manufacturer/vendor which doesn't influence my opinion in any way.

How about a keyword for qualifying static members?

I like to always qualify all instance fields with the this keyword.

this.someInstanceField;

this.GetType();

I would like to do the same for static fields, but there's no keyword for that.

I've been thinking about this for a while and I think I found a solution: the static keyword.

typeof(); // no need for the static keyword

static.someStaticField;

Published Sun, May 13 2007 23:30 by Paulo Morgado

Comments

# Naming Conventions for C#@ Sunday, May 20, 2007 5:28 PM

I'm a firm supporter of coding conventions (at least of my coding conventions). Software factories

Paulo Morgado

# Conven@ Sunday, May 20, 2007 6:24 PM

Paulo Morgado

# Convenções de Nomes para C#@ Sunday, May 20, 2007 6:24 PM

Suporto firmemente o uso de convenções de codificação (pelo menos as minhas convenções). As fábricas

Paulo Morgado

# Convenções de Nomes para C#@ Tuesday, July 07, 2009 9:19 AM

Suporto firmemente o uso de convenções de codificação (pelo menos as minhas convenções). As fábricas

Paulo Morgado

Leave a Comment

(required) 
(required) 
(optional)
(required) 
If you can't read this number refresh your screen
Enter the numbers above: