Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews Application Program Interviews:AutoCADBEA WeblogicBioinformaticsBizTalk ServerBug Tracking ToolsBugzillaClarify CRMCoding StandardsComputer Aided Design (CAD) DesignerCVSGIMPJMXLINQLoadRunnerMagentoMATLABMicrosoft AccessMicrosoft ExcelMicrosoft OfficeMicrosoft OutlookMicrosoft WordModel View Controller (MVC)OLAPOOADQuickbookRational RobotRDFSchemaSiebelSilkTestSVGTest PlanTesting ToolsUnity 3D DeveloperVRMLWCF SDKWPFXML DOMXPointer
Copyright © 2018. All Rights Reserved
Coding Standards Interview Question:
What is the structure of Coding Standard?
Submitted by: Administrator☆ Add a single space after each comma delimiter;
☆ Add a single space around binary operators (==, &&, ...), with the exception of the concatenation (.) operator;
☆ Place unary operators (!, --, ...) adjacent to the affected variable;
☆ Add a comma after each array item in a multi-line array, even after the last one;
☆ Add a blank line before return statements, unless the return is alone inside a statement-group (like an if statement);
☆ Use braces to indicate control structure body regardless of the number of statements it contains;
☆ Define one class per file - this does not apply to private helper classes that are not intended to be instantiated from the outside and thus are not concerned by the PSR-0 standard;
☆ Declare class properties before methods;
☆ Declare public methods first, then protected ones and finally private ones. The exceptions to this rule are the class constructor and the setUp and tearDown methods of PHPUnit tests, which should always be the first methods to increase readability;
☆ Use parentheses when instantiating classes regardless of the number of arguments the constructor has;
☆ Exception message strings should be concatenated using sprintf.
Submitted by:
☆ Add a single space around binary operators (==, &&, ...), with the exception of the concatenation (.) operator;
☆ Place unary operators (!, --, ...) adjacent to the affected variable;
☆ Add a comma after each array item in a multi-line array, even after the last one;
☆ Add a blank line before return statements, unless the return is alone inside a statement-group (like an if statement);
☆ Use braces to indicate control structure body regardless of the number of statements it contains;
☆ Define one class per file - this does not apply to private helper classes that are not intended to be instantiated from the outside and thus are not concerned by the PSR-0 standard;
☆ Declare class properties before methods;
☆ Declare public methods first, then protected ones and finally private ones. The exceptions to this rule are the class constructor and the setUp and tearDown methods of PHPUnit tests, which should always be the first methods to increase readability;
☆ Use parentheses when instantiating classes regardless of the number of arguments the constructor has;
☆ Exception message strings should be concatenated using sprintf.
Submitted by:
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.