Question

I'm currently working on a project that has a number of legacy code elements. In the past they have have been using the brand name in class definitions and resource names. For example (without me using my clients brand name lets use the imaginary brand name of Johnson)

So the current structure looks a bit like this:

Packages and Classes

com.johnson.activities.JohnsonArticleActivity.java
com.johnson.activities.JohnsonArticleMain.java
com.johnson.widgets.JohnsonHorizontalList.java

Resources

res/drawable/johnson_logo.png
res/layouts/johnson_article.xml

My view has always been that you shouldn't be using the brand name of the company using the code base in the code naming. This comes down to code reusability mainly, but I want to know if there is any other arguments (coding standards) for not using the company name in the code. I've never seen anyone do it. And I can't find any articles or blogs on the subject.

Anyone seen this been done? or have any thoughts about it?

Was it helpful?

Solution

This seems overly redundant, especially if their name is in the package name. I don't see any benefits of adding their name to every single file. It's just going to make file names, class names, etc. longer and you'll have to mentally ignore the first word of every class name to see the class's real name. I wouldn't recommend this at all.

The only time I would add such information is if I have two similar classes, one for company A and one for company B (or replace company with library, etc.), which would cause need for such a distinction.

OTHER TIPS

Since the package already contains the company name i see no point in prepending it to your class names unless you need that to distinguish your classes from classes of other libraries.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top