Hi guys,
if I have the following private member:
private int xIndex;
How should I name my gettter/setter:
getXindex()
setXindex(int value)
or
getxIndex()
setxIndex(int value)
Say you have data in the format:
name=john;age=33;gender=male
How would you call a method that converts data like that into an an object / associative array?
I've been thinking about:
- unserialize_variables
- parse_variables
So, this may be a can of worms. But I'm curious what your practices are?
For example, let's say your website consists of the following needs (very basic):
A landing page
An information page for an event (static)
A listing of places for that event (dynamic)
An information page for each place
With that said, how would you design your URLs?
…
How do you name different classes / interfaces you create?
Sometimes I don't have implementation information to add to the implementation name - like interface FileHandler and class SqlFileHandler.
hen this happens I usually name the interface in the "normal" name, like Truck and name the actual class TruckClass.
How do you name interfaces…
Hello
There are some simple entities in an application (e.g containing only id and title) which rarely change and are being referenced by the more complex entities of the application. These are usually entities such as Country, City, Language etc.
How are these called? I've used the following names for those in the past but I'm not sure…
I have an interface named PropertyFilter which used to take a Propertyand decide if accepts it or not. And the world was good.
But now the interface changed, so that implementations may choose to add additional Propertys. For example a Customer property might get expanded into Name and Address properties.
I think it is obvious this is…
Hi there!
I was reading this C# article about the usage of properties and methods. It points out why and when to use properties or methods.
Properties are meant to be used like
fields, meaning that properties should
not be computationally complex or
produce side effects
I was asking myself how you could express this…
Which of the following three options would you choose for a column name in a SQL Server table, and why?
YearToDateWages
YTDWages
YtdWages
Follow up:
SSN
Ssn
SocialSecurityNumber
Convention has it that table names should be the singular of the entity that they store attributes of.
I dislike any T-SQL that requires square brackets around names, but I have renamed a Users table to the singular, forever sentencing those using the table to sometimes have to use brackets.
My gut feel is that it is more…
I'm trying to put together a really simple module with one .py source file in it, and have already run into a roadblock. I was going to call it scons-config but import scons-config doesn't work in Python. I found this SO question and looked at PEP8 style guide but am kind of bewildered, it doesn't talk about two-word-name…
I'm trying to name a function that runs when a character is received by the object.
For the caller, it should be named sendCharacter, so that it can call:
object->sendCharacter( character ) ;
That looks nice for the caller.. but for the receiver, it implements a method
/// Called when this object is do something…
This is a subjective thing of course, but I don't see anything positive in prefixing interface names with an 'I'. To me, Thing is practically always more readable than IThing.
My question is, why does this convention exist then? Sure, it makes it easier to tell interfaces from other types. But wouldn't that argument…
Lets say i have a variable that contains the number of search engine names in a file, what would you name it?
number_of_seach_engine_names
search_engine_name_count
num_search_engines
engines
engine_names
other name?
The first name describes what the variable contains precisely, but isn't it too long?, any advice…
I'm a bit bewildered on this subject, as I relate variable prefixes to being a thing of the past now, but with Visual Studio 2010 onwards (I'm currently using 2012), do people still do this and why?
I only ask because, these days, you can hover over any variable and it'll tell you the variable type and scope.…
If I create a table with datetime default getdate() field that is intended to keep date&time of record insertion, which name is better to use for that field ?
I like to use Created and I've seen people use DateCreated or CreateDate.
Other possible candidates that I can think of are: CreatedDate,…
In other words - what would be a good name for a variable that references the currently logged user?
I've come up with a few:
logged_user
visitor
me
I'm not convinced either of them is good enough though.
For functions that need to index files in a directory and rename them FileName0001, FileName0002, etc... I often need to write a function that splits the file name from the file path and rename the file. When I put the file name and file path back together, I don't have a very good name for the…
I thought about this awhile ago and it recently resurfaced as my shop is doing its first real Java web app.
As an intro, I see two main package naming strategies. (To be clear, I'm not referring to the whole 'domain.company.project' part of this, I'm talking about the package convention…
A naming context (also known as a directory suffix) is a DN that identifies the top
entry in a locally held directory hierarchy.
A new naming context can be created using ODSM, the OUD gui admin console, as described in…
If you are regular reader of this blog, you must be aware of that there are two kinds of blog posts 1) I share what I learn recently 2) I share what I learn and request your participation. Today’s blog post is where I need…
There is a pattern that I use from time to time, but I'm not quite sure what it is called. I was hoping that the SO community could help me out.
The pattern is pretty simple, and consists of two parts:
A singleton…
So I've been working on a relatively large project by myself, and I've come to realise that some of the variable names earlier on were.. less than ideal.
But how does one change variable names in a project easily?…