Reducing the duration and efforts of new employees in coding brainwashing standards

At my current job, we are pretty strict about code quality and coding standards. All new employers go through brainwashing when senior developers prepare them to write (hopefully) better code.

The code review process is meticulous and usually slows down the performance of reviewers. And sometimes the brainwashing period is delayed by 2 or 3 months. Sometimes the corrections are subtle (for example, structuring the IF statement so that it is short-circuited as soon as possible), and sometimes you cannot help but raise an eyebrow (for example, declare a line and set it to String.Empty and assign it a different value on the next line).

I am looking for suggestions to reduce the time and effort to get new employees assimilated by team coding standards.

What do others do in such circumstances? What processes or tools do you use? Is there a way to automate this? I reviewed FxCop, but have not really tried it, and I don’t know if this will actually help reduce time and effort, or is it even the right tool? For logistical reasons, we cannot perform pair programming if this is an offer. And I would doubt it, reducing the effort.

We tried to keep the internal “fixes” wiki, but it’s not so sad. The lack of coercion, and also because it is easier "to correct someone’s mistakes" rather than "reading and trying to prevent mistakes."

Also, as you guys tow it to new employees, is it important to know the quality of the code? And do you guys beat those who lack quality in the interview, or are you trying to change them after they are hired?

Many thanks.

EDIT: Thanks for all the answers. I'm not sure if there is a correct answer to this question, but I will mark as correct the one that I will definitely test.

+6
coding-style code-review software-quality
source share
6 answers

Spend some time writing an application that demonstrates all your principles of optimal code. The source of this can be turned into a guide "What needs to be done." People are much better at achieving goals with specific goals, rather than being constantly punished with startling "anti-goals." It also takes less time to point people in the right direction than to describe the right direction in terms of all the wrong ones.

Your optimal code primer design can also be deliberately suboptimized with common errors and poor algorithmic design. Notes on the difference between the two can be inserted into the primer with hard facts about how one of them is clearly not optimal compared to the other.

These are not just beginners who can benefit from such an artifact, I myself am completely isolated in my work and rely on the online coding community for most of my professional development. Some clear examples of best practices that could harmonize everything will be of great interest to me.

+6
source share

I'm not sure if you have some of them in place, but they can be useful.

  • The training period for new employees - where they focus on anything and anything about your company, including code standards.
  • Penalties for non-compliance with code standards - do you have a “code standard bank with violations”, where they pay a penalty for non-compliance with standards, or they must contact you for lunch for every 10 or so violations. Of course, negative motivation does not always work.
  • Delete your commits that do not meet the standards - you are not sure if all version control systems allow, but if the encoder commits an incompatible code, then this is necessary. There are no excuses.

Ultimately, I think that training is all you need, although the other two proposals tend to border the fascists, I admit.

+2
source share

If you strictly adhere to your coding standards and do all this work manually, you can significantly save time by using several automated tools. They will make life easier for your senior developers (I assume you use .NET, as you mentioned FxCop):

  • On the client side, you can use things like ReSharper R # with template functionality to make sure the code matches your recommendations
  • On the server side - you need to configure a continuous integration system and integrate tools like FxCop into it. We use FxCop and complement it with a product of our company called PBA, which allows you to use the same functions.
+2
source share

Perhaps this is not due to what you asked, but I just want to share with you guys:

As soon as my algorithm teacher saw that someone wears a T-shirt on it: "No mistake, good programmer!" Then he said: “I don’t think so. You must have errors in order to be a good programmer.” - It was an interesting moment.

So why not teach you how to write mistakes? I am talking about using the return path so that people are a good programmer.

0
source share
  • Provide training on standards standards and have a background document
    • Use a code style checking tool - even handle some style errors, such as build errors
    • Read commits reviews
    • Version control systems allow you to configure hooks and commit queues, so no bad code goes into the main tree
    • From time to time, from time to time, from time to time, from time to time it will not hurt. Sometimes the “why” of some of the recommendations is not obvious to everyone and, therefore, difficult to apply, so such a post can even cause a lunch / coffee discussion that everyone can learn about.
0
source share

I don’t think that you can shorten the duration of the study period, but you can reduce the amount of unnecessary work caused during this by more frequent code reviews than for more experienced developers.

Start by saying that the new starters corrected the errors and looked at each of their corrections how they did it. An additional advantage of fixing errors should be that they will be subject to the action of your existing code, which, as you hope, will meet your standards already (unfortunately, too many do not have ours).

0
source share

All Articles