Tag Info

Hot answers tagged

3

There is nothing like that in PHP, however you can go for something like this -- even tho I'm not really recommending it: if ( in_array(foo(), array(1, 2), true) ) ... Please note that it's not gonna work on && conditions and you're limited only to == and ===.


3

Try setting a tab equal to two spaces. It cuts back on whitespace by a factor of 2.5x, yet it provides more than enough visual feedback.


1

Ask yourself honestly why you want to refactor. That's really important. then think what you're doing at your company - are you hired to write nice code, or to create good product. I think too many developers get so caught up in the minutiae of the codebase that they forget what they're supposed to be doing - which is making something useful out of it. Its ...


1

I believe this is nothing but a matter of style - no "measure of readability" (which is always personal) can help you here. So before I go any further, let me say this: Whatever the style choice, if you're working in a team, define a clear standard that the whole team must comply with, because if there is one thing that everyone can agree on that makes ...


1

You could leave a blank line between the class declaration and the class body, with the bracket at the end of the line, like so: class ThisIsAClass { public void thisIsAFunction { // Do stuff } }


1

You have a lot of duplicate code here, which defeats the DRY principle. This would be better: private function arrangeElementsLine(pElementSize:Dimensions):void { for (var i:uint = 0; i < target.numElements; i++) { var layoutElement:ILayoutElement = target.getElementAt(i); layoutElement.setLayoutBoundsSize(pElementSize.x, ...



Only top voted, non community-wiki answers of a minimum length are eligible