6
голосов
3ответов
520 просмотров

Naming decision: "Create it if it doesn't exist" in one word

Exact duplicate of Function name for creating something if it's not there yet I have a function which checks if a certain thing exists, and if not, creates it. What would be a good word for it? Right now I'm using "maintain", so the function is called maintain_buffer_on_path, but I think that...

0
голосов
5ответов
126 просмотров

Designing a class with **Exceptions**

When I design a class I often have trouble deciding if I should throw an exception or have 2 func with the 2nd returning an err value. In the case of 2 functions how should I name the exception and non exception method? For example if I wrote a class that decompresses a stream and the stream had...

2
голосов
4ответов
7827 просмотров

SQL Server 2008 resolving localhost to a computer name

We're in the process of switching from Windows Server 2003 to Windows Server 2008, and we've encountered a frustrating problem: In the old environment, some developers used sql server 2005 and others used sql server 2008. No problems. Our connection strings all pointed to: localhost/sqlserver. N...

2
голосов
4ответов
118 просмотров

What is the official name of a class that must be inherited from to instantiate?

In OOP terms what is the name of a class that is always a parent, and the class cannot be used on its own, it can only be used if a class inherits from it. I don't need code samples, just the technical OOP term for this class, thanks!

0
голосов
4ответов
444 просмотров

How can I name Tuples?

Is there a language agnostic algorithm to name tuples? Specifically, I want the following function: 1 => Single 2 => Double 3 => Triple 4 => Quadruple ... 10 => Decuple ... 100 => Centuple First of all, is this human-language independent? For example, will ...

2
голосов
5ответов
307 просмотров

Is there a standard name for this function?

What would you name a function that takes a list and a function, and returns True if applying the function to all elements gives the same result? def identical_results(l, func): if len(l) <= 1: return True result = func(l[0]) for el in l[1:]: if func(el) != result: ...

6
голосов
4ответов
536 просмотров

Saxon Genitive in Naming Conventions?

What do you call your functions when names that contain a saxon genitive like "Verify Task's Priority" and "Change Argument's Priority" or "Increase Action's Delay"? Do you drop the apostrophe? verifyTasksPriority(), changeArgumentsPriority(), increaseActionsDelay() Do you drop both the apostro...

0
голосов
1ответов
37 просмотров

Alternate name for BackingStoreException

I'm about to undertake the task of abstracting out all SQLExceptions from an ORM's public interfaces with something more generic - that is declaring a generic exception which would in most cases wrap say an SQLException), and I'm wondering about naming. I'm thinking of something along the lines ...

4
голосов
6ответов
179 просмотров

How to deal with changing feature and product names in source code?

What is a good strategy for dealing with changing product and feature names in source code. Here's the situation I find myself in over and over again (most of you can relate?)... Product name starts off as "DaBomb" Major features are "Exploder", "Lantern" and "Flag". Time passes, and the Featu...

1
голосов
10ответов
171 просмотров

Opposite of "Abstractor"

I have a function that takes object instances and reduces them down to an abstract/generic format. Like this: class Dog { id=0, awesome=1 } => [id:0, type:'dog'] //abstract, generic version class Cat { id=1, awesome=0 } => [id:1, type:'cat'] class Narwhal { id=42, epic=1 } ...

1
голосов
4ответов
533 просмотров

How to name variables that represent thresholds or limits?

For example, say we have a ticketing system that can be configured to offer tickets at normal price, but once you're within X hours of the event, you offer them at a different price (it may be discounted or increased). We'll call this the 'rush price'. Moreover, once you're within Y hours of the ...

2
голосов
4ответов
2925 просмотров

.NET valid property names

Where is the documentation for valid property names in .NET? Obviously things like space, * or & aren't valid in a property name, but where is this documented?

3
голосов
14ответов
330 просмотров

Better name for dictionaries

I'm designing a programming language, so I've been putting a lot of thought into the way base types are named. "Dictionary" seems like a bad name for what dictionaries do. They aren't organized lists of words with their definitions; they don't deal with words, they don't with definitions, and t...

1
голосов
1ответов
339 просмотров

Table and Column names causing problems

I have an issue when the T4 linq templates generate the classes for my MySql db using subsonic 3. It looks like one of our table names "operator" is causing problems in the Context.cs generated class. In the following line of code in Context.cs Visual Studio sees <operator> as a c# operato...

47
голосов
7ответов
27433 просмотров

What is the purpose of constraint naming

What is the purpose of naming your constraints (unique, primary key, foreign key)? Say I have a table which is using natural keys as a primary key: CREATE TABLE Order ( LoginName VARCHAR(50) NOT NULL, ProductName VARCHAR(50) NOT NULL, NumberOrdered INT ...

4
голосов
3ответов
207 просмотров

Create interface for object or for action / behavior?

When come to create an interface, do u create it based on behavior, follow the -able standard, e.g. interface Comparable interface Enumerable interface Listable interface Talkable interface Thinkable Or based on object, e.g. interface Comparator interface Enumerator interface List interface H...

5
голосов
7ответов
7132 просмотров

Strong database names on database server

We have a SQL server with many databases in it. We have customers with multiple versions of a similar app and multiple apps for a single customer. Almost all databases are tied to specific websites. How do you stay organized with your database names? Surely there is no single answer, but do you...

21
голосов
12ответов
1568 просмотров

Will bad things happen to me if I name my arrays, collections, lists, enumerables, etc. just the plural of what they contain?

I have always thought it was "best practice" to be explicit in naming my collection variables. So, if I had a collection of Car objects, I would typically name a Car[] carArray and a List<Car> carList. And then 99% of the time, I end up just doing something like... foreach (Car car in car...

4
голосов
2ответов
315 просмотров

What would you call a non-persistent data structure that allows persistent operations?

I've got a class that is essentially mutable, but allows for some "persistent-like" operations. For example, I can mutate the object like this (in Python): # create an object with y equal to 3 and z equal to "foobar" x = MyDataStructure(y = 3, z = "foobar") x.y = 4 However, in lieu of doing ...

14
голосов
5ответов
1524 просмотров

Class naming chaos

I often struggle with deciding how to name a class. Not so much because the class's purpose is unclear, but because of names like xxx***Controller***, xxx***Manager***, xxx***Info***, xxx***Helper***, xxx***Util*** etc that I see everywhere. If I have a class that uploads some stuff over HTTP...

1
голосов
2ответов
144 просмотров

how to phrase the result of an action in BDD/TDD

The title is probably not very clear. I have the following example in mind: an Authenticator object authenticates a user using credentials. It returns a AuthResult object. This AuthResult object says the authentication succeeded, or that it failed (and if so, why it failed, eg username not found...

3
голосов
1ответов
318 просмотров

Why is the heap (as in where we put objects) called that?

Possible Duplicate: What is the origin of the term “heap” for the free store? Why is the heap called the heap? I mean the bit of memory which we dynamically allocate bits of.

5
голосов
12ответов
677 просмотров

Function name for creating something if it's not there yet

From time to time I write a function that just creates something if it's not there yet and otherwise does nothing. Names like CreateFooIfNecessary() or EnsureThereIsAFoo() do work but they feel a bit clumsy. One could also say GetFoo() but that name doesn't really imply that foo may be created...

0
голосов
1ответов
56 просмотров

If I have a solution folder, is it ok to name projects ProjectName instead of MyCompany.MySolution.ProjectName?

So the directory layout would look like: Visual Studio 2008\ Projects\ MyCompany.MySolution\ Models\ Models.Tests\ Services\ Services.Tests\ UI\ etc.. rather than Visual Studio 2008\ Projects\ MyCompany.MySolution\ MyCompany.MySolution.Mod...

3
голосов
9ответов
156 просмотров

Name for program that converts between two formats?

This question is a little silly, but sometimes it's tough to figure out how to name things correctly. The conversion will parse a config file into XML and vice versa. I want to call the program MyCompany.Config2Xml, but the program also needs to be able to "Xml2Config".

7
голосов
2ответов
4929 просмотров

Naming scheme for typedefs

I'm working on a library that extensively used constructs like typedef struct foo_bar_s { ... } foo_bar_t; It's a bad idea to use the _t suffix, because it's a POSIX reserved namespace. The _s suffix for structs is also pretty useless. So I thought I can change it all to typedef struct fo...

11
голосов
11ответов
2097 просмотров

What are some class names that would signal a need for refactoring?

I came across a few articles like this one, which suggest that some words should never be used as part of a class name. When a class has one of those words in the name, it means the code should be refactored or redesigned. Example: Manager Reason: Since almost all classes "manage" something an...

2
голосов
4ответов
685 просмотров

How do you come up with a good name for a website or software you are building?

How do i come up with a good name for a website or software I am developing. Are there references for naming websites or software?

1
голосов
1ответов
2271 просмотров

How to override methods in Coldfusion (adding and changing arguments etc.)?

I have two almost identical Beans. Bean "Item" contains a unique identifier (primary key), a name and an array that contains structs with data for different Users that are related to the "Item". Bean "User" contains a unique identifier (primary key), a firstname, a lastname and an array that co...

3
голосов
3ответов
8035 просмотров

Массовое переименование таблиц и хранимых процедур

Мне нужно переименовать все мои таблицы, хранимые процедуры и, очевидно, код внутри каждой хранимой процедуры, который ссылался на старые имена таблиц. Почему лучше всего это сделать? Некоторые методы, которые я рассмотрел: SP_Rename - Выполняет половину работы. Однако это не меняет код...