4
votes
3answers
496 views

Extension method naming convention [closed]

We are using some utility methods in our company to simplify programming. So we have following string extension: public static bool IsNoE(this string s) { return string.IsNullOrEmpty(s); } ...
15
votes
3answers
1k views

Is it poor practice to name a property/member the same as the declaring type in C#?

For instance, a class like: class Dog { } //never mind that there's nothing in it... and then a property like: Dog Dog { get; set; } I've been told that if I can't come up with a more ...
0
votes
1answer
202 views

How to justify efforts to make capitalization of class and property names uniform? [closed]

In this thread, an Oracle Product Manager (username "Alex Keh") refused to make Oracle's EF provider to conform with .NET's PascalCase coding standard for class names and property names, saying that ...
9
votes
7answers
1k views

Data structure for accessing units of measure

TL;DR - I'm looking for the "optimal" data structure to define units within a unit of measure. A Unit of measure is essentially a value (or quantity) associated with a unit. SI Units have seven ...
2
votes
3answers
390 views

Naming the project containing only interfaces

I've extracted interfaces from my repository classes, like ICustomerRepository, IProductRepository and so on. The project which contains the repositories is named X.DataAccessLayer. Should I call the ...
6
votes
1answer
226 views

Naming of related classes and interfaces

I have created an ObjectParser class which parses data into strongly typed objects using an IObjectParserDataSource as the data source (the data could be an Excel file, text file, array, query string, ...
2
votes
4answers
406 views

Derived Class Method Naming

I'm having a hard time coming up with a good naming convention for methods in derived classes that serve the same purpose as the methods in the base class. For example, if both the base class, and the ...
0
votes
1answer
334 views

Is C# namespace should be Project-Name?

I am working with multiple websites (freelancer) and a good amount of them I write using C# MVC4. I created a very good boilerplace project that I plan to use on every next starting mvc4 application ...
2
votes
1answer
416 views

What should be done with class names that conflict (common) framework names

What should be done exactly when the most obvious class name for a component is taken by a framework? In my case, I need to make a class that describes an HTTP request. Of course, the most common name ...
5
votes
3answers
708 views

Naming Convention for Dedicated Thread Locking objects

A relatively minor question, but I haven't been able to find official documentation or even blog opinion/discussions on it. Simply put: when I have a private object whose sole purpose is to serve for ...
4
votes
7answers
2k views

What is it called when you set properties on object initialization?

What is it called when you set properties on object initialization? var customer = new Customer() {RequestID = request.ID, AddressID = 5}; Is it considered good practice?
5
votes
3answers
1k views

What should I name this helper class? [closed]

Usually when writing unit tests I create a helper class with extension methods. I use these methods exclusively for generating generic data for things that I am too lazy to type out. I usually name ...
5
votes
5answers
1k views

When inheriting from a class in C#, which naming convention is preferred?

If you inherit from Tile, for example, should the subclass be called CollisionTile or just Collision? What about for painting tools in an application like Paint? PenTool or just Pen? Are there any ...
8
votes
5answers
2k views

What's a good naming convention for generic types in C#? [closed]

I decided to ask this question here instead of on stack overflow because it is rather subjective. In C#, typically I see generic types with very poor names. Specifically, "T" is commonly used but is ...
14
votes
2answers
3k views

c# class naming standards/guidelines

Over the years I've used various naming conventions for services in my applications for example: [ClassName]Service [ClassName]Manager [ClassName]Factory [ClassName]Provider ...
1
vote
5answers
244 views

Case convention- Why the variation between languages?

Coming from a Java background, I'm very used to camelCase. When writing C, using the underscore wasn't a big adjustment, since it was only used sparingly when writing simple Unix apps. In the ...
10
votes
8answers
5k views

Variable naming conventions?

I've just started using ReSharper (for C#) and I kind of like its code smells finder, it shows me some things about my writing that I meant to fix a long time ago (mainly variable naming conventions). ...
3
votes
4answers
3k views

Naming Convention for Private / Public Fields [duplicate]

I read the following on the MSDN: Use Pascal casing for all public member, type, and namespace names consisting of multiple words. Note that this rule does not apply to instance fields. For ...
7
votes
6answers
4k views

What naming Convention to Use for C# Function Parameters

There are situations when a name passed in Parameter will be Cast into a new type, but the name of the Passed object should remain similar. For the case of Class Attributes, we can use this operator, ...
4
votes
3answers
528 views

What should I name these methods?

I have two interfaces, one with and one without generic type parameters. The non-generic interface is used internally so that I can store instances of the generic interface in a collection. All would ...
3
votes
6answers
822 views

“As” Naming Convention

I'm experimenting with a naming convention I've devised and am seeking opinion. It involves the use of an "As" infix, and at this point I am envisioning it in the context of JavaScript, C# and C++ ...
14
votes
13answers
1k views

async & await - poll for alternatives [closed]

Now that we know what is in store for c#5, there is apparently still an opening for us to influence the choice of the two new keywords for 'Asynchrony' that were announced by Anders Heijsberg ...