Unnecessary comma in listing declaration

Possible duplicate:
.NET Enumeration allows a comma in the last field

public enum SubPackageBackupModes
{
    Required,
    NotRequired //no comma
}

public enum SubPackageBackupModes
{
    Required,
    NotRequired, //extra unnecessary comma 
}

Since both compile, are there differences between these ads?

+5
source share
2 answers

I prefer the second syntax because if you add an add member to your listing, you will only have one difference in SCM.

+4
source

No, no difference.

This has also been allowed in C ++, and it continues. I think this is easier with a comma, since you can comment on the last element of the enumeration, and it is easier for code generation tools.

+2
source

All Articles