naming-conventions

Best Practice for Naming the Id Attribute of Dom Elements

This is related to naming conventions for a DOM element's id attribute and I guess the name attribute as well. When it comes to JavaScript, from what I understand and have done is always use camel case except for the names of classes. Classes are Pascal cased. Having said that I develop in ASP.NET mainly and here's where I run into a na...

.NET: Common programming-keywords dictionary

On episode #162 of Hanselminutes they were talking about PowerShell, but more importantly around 04:50 they mentioned that PowerShell used something called The Common Engineering Criteria to have a standard on which words to use when developing new modules for it. I cannot find any concrete dictionary on recommended words through this p...

Resource (.resx) file Key naming conventions?

Hi all, I'm building a C# app that will likely contain a couple resource files to store strings for use in language translation. I'm trying to come up with a naming convention for the Keys in my resouce files, but thought I'd see if anyone has tackled this before me? Thanks! ...

What should I do when a class name is very common?

I've just added yet another 3rd-party component to my .net project that contains a class called Client and it got me thinking about common class names. Do you name your public classes something as common as Client, or do you try to make the name more specific? In the past I would have said Client was fine, since it can always be access...

Why does visual studio break the naming convention for methods in C# ?

I know the naming convention for class methods in C# is to begin with a capital letter and each new word is a capital letter (e.g. GetDeviceName). So my question is why when I create a form, place a control on it, then double click the control (for the method to be created automatically for me by the IDE) I get a method begining with a ...

Naming advice for replacing/avoiding hungarian notation in UI?

I've stopped using Hungarian notation everywhere except in the UI, where often I have a username label, a user name text box, a user name local variable, a required field validator, a user name property and method parameter so on, often all in the same context. current: lblUser, txtUser, rfvUser, _User, User, user If I do the obvious, ...

Is it recommended to suffix all C# enums with "Enum" to avoid naming conflicts?

This stackoverflow question has an interesting discussion on how to avoid giving enums and properties the same names so that you don't have code like this: public SaveStatus SaveStatus { get; set; } It seems the accepted answer suggested to use "State" for the enum and "Status" for the property: public SaveStatus SaveState { get; set...

javascript naming conventions

I know there is a lot of controversy (maybe not controversy, but arguments at least) about which naming convention is the best for JavaScript. How do you name your variables, functions, objects and such? I'll leave my own thoughts on this out, as I haven't been doing JS for long (couple of years, only), and I just got a request to crea...

Basic F# questions: mutability, capitalization standards, functions vs. methods

Feel free to point me to other answers if these have already been asked! I'm just starting F# with the new release this month. I've got some background in both OO and functional languages (Haskell and Scheme, but not OCaml/ML). A couple of questions have arisen so far from reading through the little tutorial thing that comes with the F#...

Wcf Service Proxy Name / Namespace naming strategy

Anyone have a naming strategy that works well for service proxy classes? For example, if I am given three web services within two projects as follows: XWs AService.asmx YWs BService.svc CService.svc What would use as the Service Reference Name & Namespace for AService, BService and CService ? In general, I'd like something in ...

Terminology/naming convention for queue operations/APIs?

The "queue", or FIFO, is one of the most common data structures, and have native implementations in many languages and frameworks. However, there seems to be little consensus as to how fundamental queue operations should be named. A survey of several popular languages show: Python: put / get C#, Qt : enqueue /dequeue Ruby, C++ STD: p...

HTML naming conventions for ID, class and to include element type prefix?

Hi there, Does anyone know of a good resource to explain good naming conventions for HTML ID and classes and whether to prefix with IDs with an element type i.e. btn or button or similar? Should classes be plural or singular? I get that IDs should be singular due to them being unique, but what about classes? IDs and classes should us...

Naming a New Assembly for Application Front End

Hi there, Im after some suggestions for naming a new assembly. The project is a multi-tier rich client app using WPF and we've got good names for all the assemblies (data and business layers) except for the front end. The assembly in question holds the actual user interface and classes for data binding. We want it to be something shor...

What characters are allowed in C# class name?

What characters are allowed and what is not allowed in a C# class name. Could you please help? EDIT: To specify. What special characters are allowed. Please be specific, because links to 50 pages specs in high-technical language is not a answer that will help me a lot. EXPLANATION: What I try to acomplish is to divide class name into d...

Naming conventions for tables and columns in database

Hello, Each time when new project starts, I’m thinking about naming conventions of table and columns in database. Which case is your recommendation and why? Case 1. column_name Case 2. ColumnName Case 3. Column_Name Case 4. columnName ...

What special characters are allowed in T-SQL column name?

I would like to know what special characters are allowed to be used in column name in T-SQL, MSSQL. So I know I can use letters and numbers, but are the other characters that are available without using brackets [] to refer to this column? ...

What is the best way to define semi-constant class variables in C#?

I have a class called ItemBase from which a number of classes inherit. In this class I have a number of one-line methods which simply return a string or object and are available to all the inheriting classes. I use these quite a bit in inherited classes to make code more readable and so that I always have one and only one place that def...

Any sucess using UI-based program structuring?

Have you ever structured your source code based on your user interface parts? For example if your UI consists of: GridView for showing some properties 3D rendering panel panel for choosing active tools , then you name and group your variables and functions more or less in the following way: class Application { string Properties...

MVC naming conventions for JSON actions

What naming convention is recommended when writing an MVC app that has both front-end and JSON paths to the required data? For example, let's say the user of your site has "Things". They should be able to go to a page to view their things, but we also need a way to pull those things back as JSON on other pages. I've been able to think...

Name conventions for xibs

I've been looking at the sample code and sometimes Apple names xib files ClassNameView and sometimes ClassNameViewController. The ClassName is always a UIViewController or UITableViewController, which had me wonder what convention to use when naming a xib. I would think View as it's not really the ViewController, but curious on what the ...