naming-conventions

Where can a self-teacher learn general good programming habits and conventions?

A few mistakes and general childishness in early adulthood have left me in a situation where I work a menial job, with no possibility (in the near future) of attending school. I aspire to one day work in the programming field (gaming specifically), after proving myself on the indie end of things. I've gotten very confident in C++, ja...

Naming of boolean column in database table

I have 'Service' table and the following column description as below Is User Verification Required for service ? Is User's Email Activation Required for the service ? Is User's Mobile Activation required for the service ? I Hesitate in naming these columns as below IsVerificationRequired IsEmailActivationRequired IsMobileActivatio...

Is there advantage of using in CSS #image-box vs #image_box (hyphen vs underscore)?

Or is it just mainly a personal preference? As a programmer I always use underscore, but have seen it as - and so I will have to conform to it working in that project. ...

typedef boost::shared_ptr<MyJob> Ptr; or #define Ptr boost::shared_ptr

I've just started working on a new codebase where each class contains a shared_ptr typedef (similar to this) like: typedef boost::shared_ptr<MyClass> Ptr; Is the only purpose to save typing boost::shared_ptr? If that is the case, is the only reason not to do #define Ptr boost::shared_ptr in one common header the general problem...

Database date fields - Naming Convention

What's a good way of naming date/datetime fields? Can't decide if I want to use things like expiry_date, end_time, created_on, or simply expires, modified. ...

Java add() method convention

So, I'm normally a ruby programmer, so my grasp of Java conventions is shaky at best. If I have a class A and want to define a method to add two instances of that class, what's the convention on the behaviour and return type? public class A { //... public NotSureWhatTypeItShouldReturn add (A that) { /* ... */ } Should I re...

A naming convention for the column intended exclusively for ordering

Say, we have a set of records that should be ordered with a non-trivial ordering method, e. g. natural sort or just in some specific sequence, defined by a user. We have to introduce a special column intended just for ordering. Is there a more or less common convention for naming such columns? What names do you use? ...

Capitalization of an acronym that starts a parameter

I have a variable that indicates the length of time the UI can be idle. I have elected to call this variable UITimer. I want to pass the variable into my classes constructor and then store it off in a local field. What is the proper way to do the casing of this? We use the common convention of a parameter not being capitalized. So s...

Should naming of methods within interfaces be concrete or abstract?

Often when I create new classes, I first create a new interface. I name the methods of my interface exactly as I would like them to behave. A colleague of mine prefers to have these method names being more abstract, ie: areConditionsMet(). The reason, he wants to hide the 'implementation details'. IMO implementation details are differen...

Do methods ending with _! have a special meaning in Scala?

Do methods ending with _! such as delete_! or i_is_! have a special meaning? Are they "just names"? Do they follow some convention? There's even bulkDelete_!!. (The specific context is Lift if it makes a difference.) ...

How to deal with duplicated function name within C?

I have a little project in which I named two same name function in two different source file, but while I building the project, the compiler failed with 'func_name already defined in filename.obj'. Why could not I have two function with the same name in two differenct source file? I thought the function should be local to the source fil...

Is there a naming convention for Django apps

Is there a preferred naming convention for creating a Django app consisting of more than one word? For instance, which of the following is preferred? my_django_app my-django-app Update: Not allowed syntactically mydjangoapp Recommended solution While all of them may be options 1 and 3 are syntactically allowed, is there a preference...

Java code conventions: Using 'default' as a variable name

I would like to use 'default' as a variable name. Is there a code convention (like class -> clazz) that suggests how I should name the variable? ...

How to name C# source files for generic classes

I am trying to stick to general naming conventions such as those described in Design Guidelines for Developing Class Libraries. I put every type into its own source file (and partial classes will be split across several files as described in question Naming Conventions for Partial Class Files), using the name of the type as the file name...

What's the standard practice for naming an intermediary table in SQL?

I have a table called Product and a table called Shop. Each shop has a list of Products that it sells. I need an intermediate table that has ShopID and ProductID in it. What should I call that table? My mind has drawn a blank. ShopProducts? Edit: Perhaps I should call it "ShopAvailableProducts"? Or is that too confusing. ...

Naming conventions for persistence layer: DAO vs Manager vs ... ?

DISCLAIMER: I'm almost sure that I've seen the same question before but I can't find it now. If someone finds that question, please, give a link. I heard at least two opinions on the best name for classes which implements CRUD operations: someone says that DAO is a classical name and everyone knows what it means, but others say that Man...

Programmers dictionary/lexicon for non native speakers

I'm not an English speaker, and I'm not very good at English. I'm self thought. I have not worked together with others on a common codebase. I don't have any friends who program. I don't work with other programmers (at least nobody who cares about these things). I guess this might explain some of my problems in finding good unambiguous ...

What do you call a single header whose purpose is to include other header files?

I've seen this done before in various C++ libraries - namely Qt (QtCore, QtGui, etc.) and Irrlicht (irrlicht.h): // file - mylibrary.h #include "someclass1.h" #include "someclass2.h" #include "someclass3.h" // and so on... Obviously this exists for convenience - a programmer wishing to use the library only has to include one header i...

What do you call a URL path without a host name?

Out of curiosity and the need to name a configuration setting properly: What do you call an URL that is an absolute path reference but without a domain? http://www.domain.com/path/to/myfile is an absolute, full URL. ../to/myfile is a relative path. What would you call /path/to/myfile? Is there a convention? Am I just daftly overloo...

txtFirstName vs FirstNameTxt

Over the past several years I have been using the naming convention of FirstNameTxt when I'm referring to a TextBox Control for a 'First Name' field. However, I've noticed the majority of other developers tend to use the naming convention txtFirstName Which is the best convention to use? ...