Answer the question
In order to leave comments, you need to log in
How to learn to write code correctly?
Guys, tell me how to learn how to write code correctly? I work in a company where the IT department is not very large and there is no direct mentor - Team Lead, there is just a project manager who has nothing to do with development. And we try to write the code correctly as much as possible based on experience, but it still turns out somehow crooked. Duck, the question is how to learn how to write competently code, and competently develop applications in such a situation, I repeat once again - there is no Team Lead, there is no that person who was kicked for poorly written code (((
Answer the question
In order to leave comments, you need to log in
Before you write competent code, you need to correctly develop the architecture. Read Grady Booch first. Understand design patterns. Do each other's code-review as much as possible to find fault with the code. And then it will go.
Visual Studio -> Code Analysis
How To Set up code analysis for a managed code project. Just do not turn on all the rules at once, there will be hundreds of warnings, turn on one at a time, how to fix the shortcomings (carefully reading the warnings on the Microsoft website), apply others, and so on until "All" is turned on.
I liked these rules (each company has its own requirements for the code), now I use it wherever I write from scratch.
You can use StyleCop, but it seems to be abandoned, there is a fork for Roslyn, but these are enough to teach the team to follow the Microsoft practice.
Design Patterns Free Book, GOF for .NET by Certified Professionals.
I realized that this path is endless, in books they write that people looking at their code written a year ago "cry / laugh, they say - who wrote it." :)
I'm experiencing the same thing.
And without kicks? Practice, look for bottlenecks in the project. Learn to use profilers of all stripes. Read "Perfect Code" by McConnell. Well, you can describe what exactly you think is crooked and how you think it should be
You can participate in some interesting OpenSource project for you.
See what code. For what tasks?
If you make a crutch in a failed project, then no matter how elegant the code is, it will be a waste of time. (IMHO) If you are developing part or all of a project that seems promising for some qualities in the portfolio), then without a mentor (teamlead) , you can’t build a competent solution until you yourself have enough experience and knowledge.
The fact is that it is not enough just to write code correctly.
Initially, it is necessary to design a solution, subject it to criticism (preferably in a team or an authoritative specialist from outside), correct the shortcomings, and only then proceed to the next step, which is still not coding.
Implementation tools are selected. If we talk about web development, then this is a platform for a solution (OS and its services), these are all kinds of libraries and blanks (frameworks \ CMS), and then a programming language.
Taking into account the architecture of the project, the features of the runtime environment and the available ready-made solutions (I repeat: libraries, frameworks, plugins, ...), it already becomes clear where and what needs to be added, rewritten, written from scratch ..
That is, from scratch more often In total, projects do not rise. It’s rare now in serious development that a specialist opens C ++, on the second notepad monitor and away we go. Everything from scratch. Why reinvent the wheel if large pieces of solutions have long been implemented and optimized. And they are in open access (OpenSource), take and use.
In any case, like this, with a swoop, you can’t comprehend all the “zen”. But that doesn't mean it can't be done at all.
A mentor, a mentor, he is definitely needed. Nothing without him. Without it, the learning process will take a very, very long time, a lot of bumps on your forehead and a "seated" reputation in front of those customers on whose projects you have trained and tried. If you have a conscience, then your self-esteem will suffer. Why do you need this?
And for starters, in order to talk with a mentor in detail, you can take and read the source codes of public open source projects of the same. Study them. Not just to understand the functionality, to decipher the algorithms, but to ask yourself why it was done that way and be sure to find answers to it. Why this or that tool was involved, source. Why did the developers bring certain functions to the public, and left some cool, cool and super-useful ones in the local. And other others ..
Try to build your own, albeit small ones for a start, projects. Ask for help from more experienced colleagues in optimizing the structure of the project / code. Communicate actively with your community on the forums. Be that as it may, but the style of coding and project management in general, only a person can convey to you. Not a manual. Not a book, although you can't do without them.
In general, look for a mentor, look for a mentor. He is your guide to excellence. To make it interesting for him to mess around with you, give him a part of the profit from those projects that he will oversee. These are acceptable terms and a fair deal. Thanks to him, you will be able to take and complete the project, make a profit from it, and thanks to you, his work will be rewarded in den. signs.
Well, maybe hire a lead or a mentor - there are such offices. They will review the code and poke their noses into the wrong places. If you want, I'll help.
Contacts copist.ru/about
Reading someone else's or your own old code can sometimes really become a problem. If you work in a team, then you should decide on clear rules by which you will work. When the whole team starts to adhere to the standards, it will be easier to use and correct for the team.
In my company we use a guide written for AirBnB - https://github.com/airbnb/javascript
We also use BEM to create a convenient infrastructure - https://ru.bem.info/
Now many companies hold hackathons, where under the guidance of a mentor they unite into teams and you can get useful experience. Courses such as Yandex.Practicum can give a lot of positive experience, there are also teams, a reviewer and a mentor there. After training, you will be able to successfully apply the experience gained and conveniently organize work in a team.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question