Name : Utils or Utility ?

Started by
9 comments, last by Bearhugger 8 years, 6 months ago

Hi,

What is the more correct to use for a folder name : Utils or Utility ?

I always used Utils but maybe Utility is more correct.

Thanks

Advertisement

'Utils' isn't a word. 'Utilities' is the plural form of 'Utility'.

Apparently it is a word. huh.png

'Utils' isn't a word. 'Utilities' is the plural form of 'Utility'.

Apparently it is a word. huh.png

I think it was an abbreviation from older systems for "utilities" and it just stuck.

Neither is more correct, but I'd lean towards a proper, descriptive word myself unless there's good reason to abbreviate.

On windows, for example, the max path length is effectively ~260 characters, and that could be a concern in deeply-nested directories. Abbreviation for its own sake, or as an attempt at obfuscation, aren't good reasons, IMO.

throw table_exception("(? ???)? ? ???");

Agreed with Ravyne, I would tend to prefer the full word (in this case "utilities") unless there's some good reason to abbreviate. In this specific case however you can expect the abbreviation ("utils") to be well understood and I wouldn't expect it to cause any problems.

It's also best to stay consistent with your own rules unless there's some specific reason for departing from them, so what is your normal rule for naming things? Do you normally use full words, or are abbreviations common?

- Jason Astle-Adams

You should name it what it is:

MiscelleneousCrapIDontKnowWhereElseToPut

(seriously, Utils and Utility are both terrible names, because they're meaningless.)

Sean Middleditch – Game Systems Engineer – Join my team!

Coming from an Amiga background I think it should be called "Prefs" ;p

You should name it what it is:
MiscelleneousCrapIDontKnowWhereElseToPut

haha, it's not false.

Other solution is to put all in Core folder and don't have Utils/Utility/Utilities maybe.

They do SOMETHING and they are used SOMEWHERE, so those could be guidance.

You mention "Core", which could be a good place. Core\SomeTask\Whatever

I dislike "utility". Look deeper at what it is doing and find a good location for it. Algorithms, Structures, Numerics, Processing, or whatever more generic term is most related to actually doing.

In my experience, abbreviations tend to make code more difficult to read, and modern IDE features like Intellisense and auto-complete have all but eliminated any benefits (as marginal as they were in the first place). The only reason I'd abbreviate these days is if the full name was excessively long, to the point where horizontal scrolling became an annoyance, if there were some hard limit on the name (such as the max path length mentioned above), or if the abbreviation was something standard and common throughout the codebase, such that everyone knew what it was at-a-glance.

Not that either "Utils" or "Utilities" is the best name to begin with biggrin.png

This topic is closed to new replies.

Advertisement