Tag Info

New answers tagged

0

There's a simple rule that you can follow: If you modify a file with code, you use the coding standard used in that file. If you create a new file, you use any good coding standard. (Plus: If your compiler can give warnings, you enable all reasonable warnings, turn warnings = error on if possible, and don't allow any code with warnings. Plus: If you use ...


0

Consider using pull requests for new code into the repository. This gives a convenient place to do code review. Code that fails the code review is not merged into the repository until it is up to shape. Just be careful not to make the pull requests too large. In my experience they shouldn't be bigger than between half a day to max two days or you will have ...


1

I think it depends on a lot of social factors. For one, does it even affect you or your position if you do not adhere to the style guide? After all, a lot of code has been written by others with this guide in place already. If it does not really affect you, do you (for whatever reason) want to champion the style guide? Most of the times, I found that once a ...


6

First, you say that there are two teams currently working in the code, so the obvious answer is "ask whoever is in charge". It makes no sense doing the effort of adapting the code to the company styles if the other teams do not try to adapt it, too. If you were alone maintaining some other people old code, probably most of your time you will be modifying ...


0

If all the code is in one consistent style, or if the code base is very big, or if there's no budget, then I choose the battles I can win and adapt to the other style. If I'm not the only person actively working on the project I would talk to the other developers and reach a shared agreement. I would aim at writing all the new code following the guides. ...


0

Conforming to the style guide is important, but unless you have the necessary resources to adapt the entire code base to the standard on paper, it could create more disorder than it removes. In general, I wouldn't reformat less than an entire file merely to conform to any standard, and then only if it isn't clearly a business-value-negative proposition (i.e. ...


0

On the first sight I think it should stay in the Value Object because of cohesion and encapsulation principles - getChildMap() method implementation is intimately connected to the implementation of MyContainerVO object so it should stay inside this object without necessarily exposing the implementation details (childList). The problem here is that it's not ...


0

The preferred coding style would be (b) according to all style guides that I've seen (e.g. https://github.com/objc-zen/objc-zen-book#property-declaration). They recommend explicitly specify readwrite attribute (for the sake of clarity, I guess).


3

This rule and consequent warning is sensible - I definitely wouldn't like to see class/constant definitions mixed with side-effects in one file. But in this particular case I wouldn't mind - PHP bootstrap files are usually a bit like this - setting up the environment which sometimes consists of several distinct (and possibly unrelated) steps. You could ...



Top 50 recent answers are included