naming-conventions

Django template file extension preference

This Django ticket says that they will not add a default Django template file extension. What file extension do you use? ...

What is the correct name for this data format?

I am a perfectionist and need a good name for a function that parses data that has this type of format: userID:12,year:2010,active:1 Maybe perhaps parse_meta_data() I'm not sure what the correct name for this type of data format is. Please advise! Thanks for your time. ...

CakePHP HABTM Plugin table naming conventions (for 1.3)

Hi everyone, I know naming conventions for tables used by plugins generally start with the name of the plugin and then the model pluralized. For example lets say I had a plugin called Poll, with a model also called PollPoll and another model called PollTag then the resulting table names would be poll_polls and poll_tags. They would also ...

What to name functions that perform operations on strings that enter/exit db

Need advice on what to name functions that do this Perform operations on strings before inserting into db to protect from MySQL injection Converts HTML special characters Ex: enter_db() exit_db() However, these function names sound kinda corny. Any suggestions or advice on other names? Thanks! ...

naming convention for methods that return boolean or indicate binary state?

Can someone point me to a guide for naming methods that return boolean or indicate a boolean state? I'm talking about things I've named like recordsExist(), issetVariable(), questionPrompted(), commentAsked(). Thinking this over, I think that two basic problems I'm looking at are 1: Has a user-interface event happened? and 2: do[es] dat...

Naming convention for assets (images, css, js)?

I am still struggling to find a good naming convention for assets like images, js and css files used in my web projects. So, my current would be: CSS: style-{name}.css examples: style-main.css, style-no_flash.css, style-print.css etc. JS: script-{name}.js examples: script-main.js, script-nav.js etc. Images: {imageType}-{name}.{imageE...

Use of the suffix "base" when naming types

I sometimes see types named with a suffix of "base", presumably meaning it forms the parent of one or more sub-types. Is implying the use of inheritance in the type name like this a code smell? ...

Should a method parameter name specify its unit in its name?

Of the following two options for method parameter names that have a unit as well as a value, which do you prefer and why? (I've used Java syntax, but my question would apply to most languages.) public void move(int length) or public void move(int lengthInMetres) Option (1) would seem to be sufficient, but I find that when I'm codin...

Namespace and Assembly names for a reusable component

Hi everyone! I've got a bit of a conundrum on my hands. I'm currently compiling a load of 'code snippets' into reusable libraries that I obviously intend to use in multiple applications. I'm having trouble deciding on an appropriate namespace and assembly name. Basically, I've currently got JasonSummers.Validation as an example for m...

Naming conventions for cookies in PHP

When it comes to cookies and PHP, what naming style do you use? Here are a few styles I can think of: lower_case camelCase UPPER_CASE ...

Naming of build scripts

We do our build-management with Ant, we have to build scripts, one to create a dispatchment for our customer, with hash informations, the sourcecode, installation-guide etc., the other build-file lies in the created artefact, and is the build for the customer which creates the war file from the sourcecode. for the build-file which creat...

What should I name my global module in Python?

I'm writing an application in Python, and I've got a number of universal variables (such as the reference to the main window, the user settings, and the list of active items in the UI) which have to be accessible from all parts of the program1. I only just realized I've named the module globals.py and I'm importing the object which cont...

Why is the LINQ "apply-to-all" method named Select?

When I read code that uses Select I think "select-all-where". When I read code that uses Map I think "this-to-that" or "apply-to-all". I can't be the only person that feels the name Select is confusing. Map ...

Javascript and CSS, using dashes

I'm starting to learn some javascript and understand that dashes are not permitted when naming identifiers. However, in CSS it's common to use a dash for IDs and classes. Does using a dash in CSS interfere with javascript interaction somehow? For instance if I were to use getElementByID("css-dash-name"). I've tried a few examples us...

What is "POSNR" an abreviation or acronym for?

I'm working with some data that's coming out of an SAP system. There's a field named POSNR that appears to be a line item/database identifier of some kind. What is this an abbreviation for? It's not hyper-critical to what I'm doing, but every time I stare at the word it looks like pure gibberish and can be slightly distracting. ...

Is hungarian notation applicable to Perl?

In Perl, reference to anything is a simple scalar, and has the $ sigil. It's sometimes hard to say what kind of reference it is. I personally prefix variable names for references with a letter, which indicates ref type. Examples: my $aValues = []; # arrayref my $hValue = {}; # hashref my $oValue = b...

What is proper naming convention for MSVC dlls, static libraries and import libraries.

Hello, What is standard or "most-popular" naming convention for MSVC library builds. For example, for following platforms library foo has these conventions: Linux/gcc: shared: libfoo.so import: --- static: libfoo.a Cygwin/gcc: shared: cygfoo.dll import: libfoo.dll.a static: libfoo.a Windows/MinGW: shared: libfoo.dll import: li...

Method names for getting data

Warning: This is a not very serious question/discussion that I am posting... but I am willing to bet that most developers have pondered this "issue"... Always wanted to get other opinions regarding naming conventions for methods that went and got data from somewhere and returned it... Most method names are somewhat simple and obvious.....

Are there any naming conventions for primary/entrant classes and their super classes?

I have a question regarding naming conventions in C# that I don't think are covered in either the majority of the previously asked questions or the usual resources like the MSDN Naming Guidelines. The majority of existing naming conventions focus on frameworks and things to be consumed by other classes. This may be a bit different. What...

Names of HTML form naming conventions

In Rails and CakePHP1.2, forms tend to include input elements with names like the following: <input name="comment[author]" /> Is there a formal name for the notation used in the "name" attribute? Likewise, in CakePHP1.1 I do believe that the same would have looked like this: <input name="comment/author" /> Again, is there a formal...