I
I
ixSci2012-01-28 06:37:42
Automation
ixSci, 2012-01-28 06:37:42

Manual or automatic coding style checking?

Good day, colleagues, programmers!
I have a question for those who use a coding style in a command: how do you check for a match? Are there special programs for checking or do you check everything manually? If the program checks, then how are such moments checked as a mismatch between the coding style in the library used and yours.
For example, in your team it is customary to capitalize method names DoSomething, in your program libraries (C ++) boost and Qt are used, which force you to redefine the behavior of methods named do_something() and doSomething() respectively. It turns out that the program for checking will have a false positive? How do you deal with it?
In general, the question is not idle, I want to check the coding style, but I'm not sure that it makes sense to spend time looking for a suitable program. Because I don't see how it can solve the problem described above, as well as the problem with incorrect naming of variables or invariants ("non-speaking" names)
Thanks in advance for the opinions!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
G
Gribozavr, 2012-01-29
@ixSci

Autoformatters/autocheckers only make sense when a coding style is introduced into an existing project to reduce the amount of manual work at this stage. In practice, they can only be used as an auxiliary tool, and not as a strict criterion for accepting / rejecting a commit, at least due to the fact that in any normal coding style there is a rule “you can break any rule if it allows you to significantly improve the readability / maintainability of the code ".

G
Gregory, 2012-01-28
@difiso

When we wrote the project on Zend, we used phpcs (it has support for various standards, including Zend). This was enough, and once a month, just the last revision was corrected by pens, with a properly configured IDE, if you have to edit it by hand, then very little.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question