Sign in to follow this  

Name : Utils or Utility ?

This topic is 810 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Edited by Alundra

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

I tend to frown the use of abbreviations in this day and age of IntelliSense, but "utils" is one of those abbreviations that I consider common enough in programming to be fine to use, and I see it very commonly used in existing code bases. It's like the "init" abbreviation, which is used all over the place in the Linux kernel. Init this, init that. Purists will still frown the use of abbreviations in the comfort of Visual Studio, but I guess I can't blame a bunch of C programmers remote-debugging a kernel in terminal-mode emacs with a 80-character limit if they have no patience for very long names. laugh.png

 

As to whether you should have a util folder instead of having more descriptive names, that's a totally different matter.

Share this post


Link to post
Share on other sites

This topic is 810 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this