PHP coding standards at work: Insane, or am I?

salahpirate

New Member
I prefer coding standards to be logical. This is my argument for why the following set of standards are not.

I need to know one of two things: (1) why I'm wrong, or (2) how to convince my team to change them.
camelCase: Functions, class names, methods, and variables must be camelCase.
  • Makes it hard to differentiate between variables and classes
  • Goes against PHP's lowercase/underscored variables/functions and UpperCamelCase classes
Example:\[code\]$customerServiceBillingInstance = new customerServiceBillingInstance(); // theirs$customer_service_billing_instance = new CustomerServiceBillingInstance();\[/code\]
Functions/methods must always return a value (and returned values must always be stored).This appears on hundreds of our php pages:\[code\]$equipmentList = new equipmentList();$success = $equipmentList->loadFromDatabase(true, '');$success = $equipmentList->setCustomerList();$success = $equipmentList->setServerList();$success = $equipmentList->setObjectList();$success = $equipmentList->setOwnerList();$success = $equipmentList->setAccessList();\[/code\]The return value is rarely used but always stored. It encourages the use of copy-and-paste.
No static methodsLines like the following appear thousands of times in the codebase:\[code\]$equipmentList = new equipmentList();$success = $equipmentList->loadFromDatabase();\[/code\]I would prefer:\[code\]$equipmentList = equipmentList::load();\[/code\]What reason is there to not use static methods or properties? Aren't static methods responsible for non-instance-specific logic? Like initializing or populating a new instance?
Your code is not OOP unless everything returns an objectThere's a piece of code that performs a query, checks it several ways for errors, and then processes the resulting array. It is repeated (copied+pasted) several times, so I put it in the base class. Then I was told returning an array is not OOP.
How do you defend these practices? I really do need to know. I feel like I'm taking crazy pills.If you can't defend them, how do you convince the adamant author they need to be changed?
 
Back
Top