2

I am try to find a namespace naming-convention for code I release as an individual outside of a company environment.

The Microsoft guidelines only help for code written by companies.

The general rule for naming namespaces is to use the company name followed by the technology name and optionally the feature and design as follows.

CompanyName.TechnologyName[.Feature][.Design]

But what should I do as an individual with no company?

In Java I would use the address of my personal website, but in C# url-like namespaces do not seem to be favoured.


This is a subtly different question to namespace naming conventions, since it is about naming conventions for individuals, not companies.

Community
  • 1
  • 1
sdgfsdh
  • 33,689
  • 26
  • 132
  • 245
  • so use your internet handle, your last name, or don't include the first "section" it at all. Seems like you have less than a handful of options. – Kritner Sep 10 '15 at 21:24
  • Typically, individuals or open source libraries omit the `CompanyName` part. – Matthew Watson Sep 10 '15 at 21:31

2 Answers2

4

IMHO,If you release it as individual I think better name it like your project/program name, let's imagine that you writing a library with code name "SuperLib" : SuperLib.SuperFeature.SuperDesign.

ivamax9
  • 2,601
  • 24
  • 33
1

This is totally subjective, but the format I use is:

<SolutionName>.<ProjectName>.<FolderName>.<SubfolderName>.<SubSubFolderName>.<etc>

For me, at least I find that my namespacing closely follows my folder structure.

Here are a few examples:

namespace Project.Models.DTO

namespace Project.Domain.Services.Implementations

namespace Project.Controllers
Christopher Rayl
  • 319
  • 2
  • 10