Philosophical question on class naming case choice...

Aug 27, 2010 at 9:54 PM

So I'm curious about something -- when I use the wrapper, my code often looks like this:

 

                listBatchSubscribeInput listBatchSubscribeInput =
                    new listBatchSubscribeInput
                    (                        
                        list.MailChimp_ListID,
                        batch,
                        false,
                        true,
                        true
                    );

                listBatchSubscribe listBatchSubscribe = new listBatchSubscribe(listBatchSubscribeInput);

So what looks odd here is having a lowercase letter for the class name. It is nice that it doesn't conflict with using the same name for an instance of the class. So it's all perfectly fine to use as is but standard or typical C# would look something more like this:

 

                ListBatchSubscribeInput listBatchSubscribeInput =
                    new ListBatchSubscribeInput
                    (                        
                        list.MailChimp_ListID,
                        batch,
                        false,
                        true,
                        true
                    );

                ListBatchSubscribe listBatchSubscribe = new ListBatchSubscribe(listBatchSubscribeInput);

 

So my question is more about the philosophy of going with the lowercase. To be clear though it isn't a big deal. I'm just a curious person :).

Coordinator
Aug 28, 2010 at 5:06 AM

I'm just a mysterious person — here are 3 clues...

  1. Your question is based on a mistaken premise.
  2. You are asking the wrong person.
  3. The answer is in the documentation.

 David

Coordinator
Sep 2, 2010 at 3:56 PM

No guesses?? How disappointing.

The reason that classes are defined as they are, is to be consistent with the MailChimp method names; the classes start with the MC method name; listSubscribe, campaignCreate, etc.

So reason for the clues..

  1. That this is typical C#, that I apply a philosophical approach to technology, and that I'm philosphical by nature. Only the latter is true. In technology, I succumb to the practical over the philosophical when they are in conflict.
  2. Ask MailChimp (this naming was pre-Jesse I believe), but not untypical PHP conventions.
  3. In my documentation is states that classes are named methodInput, methodOutput, etc. — hence the lowercase first character

My biggest problem is not mixing naming conventions since I program in multiple languages for multiple clients -- which have their own internal naming conventions at times. ...and God forbid I have a flashback to my early days of COBOL, Fortran, and RPG for naming conventions.

Have a good one.
David

Sep 2, 2010 at 6:26 PM

Ah! I was still thinking. I went over the documentation and didn't catch that so I didn't want to comment until I pored over it again. The thought that it matched the API names did come to mind at some point but I wasn't sure how much to put into that because I suppose I see a class name as a non-concrete thing and an instance as more of a concrete thing similar to an API call. But that is getting out there maybe!

Thanks for the explanation David!

Cymen