0

I would like to be sure I am using the most common naming convention. In the example below would it be more common for deleteEntity to be deleteEntity or DeleteEntity?

var factory = {
    deleteEntity: function (entityType, entityId) {
        var deferred = $q.defer();
        EntityResource.deleteEntity({ entityType: entityType, entityId: entityId },
           function (resp) {
               deferred.resolve(resp);
           }
        );
        return deferred.promise;
    },

2 Answers 2

4

It would be more common to be lowercase. It would still work, but generally capital Functions are reserved for constructors (i.e. used with the new keyword).

Sign up to request clarification or add additional context in comments.

Comments

0

There are no set naming conventions that I know of as such. But as a Java developer, I will be happy to see variables and methods following lower Camel Casing like deleteEntity. But Dot net developers may be comfortable with Upper camel casing like "DeleteEntity".

1 Comment

You could follow the naming convention of the standard library.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.