ASP.NET Coding Standards

G

Guest

Hi All,
Can anyone tell me where can I find a good aritcle on ASP.NET Coding
Standards. I wanted only ASP.NET coding standards guide.

Bye
Praveen
 
M

Mark Rae


The above is another standards document which discourages the use of
Hungarian notation in .NET...

This has always puzzled me... To me, using something like Hungarian notation
which makes my code easier for me to read and understand, has got to be a
good thing.

I've never yet seen a valid rason for not using Hungarian notation in
..NET...

Would be interested in other people's opinions...
 
J

Joerg Jooss

Mark said:
The above is another standards document which discourages the use of
Hungarian notation in .NET...

This has always puzzled me... To me, using something like Hungarian
notation which makes my code easier for me to read and understand,
has got to be a good thing.

I've never yet seen a valid rason for not using Hungarian notation in
.NET...

Funny. I feel the exactly the opposite way.
Would be interested in other people's opinions...

Well, HN uses prefixes in an identifier's name depending on the identifier's
type. In a true OO environment featuring polymorphism, the exact type is
quite often unknown (just think of object factories that simply return
interface types). Actually, most of the time you don't even care abut the
real type, as long as the object complies to some sort of interface contract
(by implementing an interface or inheriting from some other class).

Next, there are potentially thousands of types -- which could mean using *a
lot* of prefixes. Oh, and once I need to change a type, I have to rename all
identifiers using that type. Hey, even worse, if it's a "visible" change
like

public int Foo(int someInt)
to
public public long Foo(long someLong),

you would want to change your code as well, if you're using my Foo()
method -- any variable in your code holding Foo's return value will use the
wrong prefix otherwise.

Not to mention all those classic HN prefixes that make no sense in .NET at
all -- l, p, sz, ...

Cheers,
 
K

Kevin Spencer

The reason for naming conventions is to make code easier to read and get
into. Therefore, it doesn't matter what convention you follow, as long as
you stick to it. We use the Microsoft naming conventions because if someone
comes to us new, they are more likely to recognize it, and therefore, will
be able to work with it faster. That said, it is no better nor worse than
any other set of naming conventions.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top