📜 ⬆️ ⬇️

Technology technology, and most importantly - the code

So why do we write this bad code that slows down our work day by day?
Because we then had to do something faster!
I will leave you alone with this logical inconsistency ...
At one of the lectures of Robert Martin

We at DevConf will not be the most ordinary master class. There will not be talk about new technologies or hayload. Will talk about the code. Good, bad. It is called Principles of good code with real examples . Let's ask the author a little.

Who are you and what are you doing?

My name is Adele. I'm a freelancer. I usually do backend development. Sometimes I also write and add phpStorm plugins. From the popular Laravel plugin and .env files support .

What prompted you to such a master class?

Depression of the current situation in the industry. All obsessed with technology. Recently cloudy. You read the vacancy, list the technologies used, the necessary experience (which is almost never, in fact, needed). It sounds very cool at the interviews. Come to the project. You look at the code ... and he sadly tells you: "Shoot me." You look deeper and understand all his sadness. He is mortally ill. As cancers grew, classes that someone, as a joke, called controllers. Like metastases, copy-paste spread everywhere. The psychology of the code is put under pressure by the fact that it is only a miserable binding for cool cloud technologies. But shoot expensive.

We were interrupted here on habrakat, but you continue

We have to roll up our sleeves and remove copy-paste, reduce the controllers to a couple of methods with 3-4 lines. Spread logic, infrastructure on the necessary classes. Well at least the project management has always endorsed such edits. But you come to a new project and there again the same thing. I am afraid that this problem is getting deeper. I worked for 6 years in a large company (> 1000 employees), which invested a lot in the training of its employees. And this is not the kind of training that is needed! All these courses are again about technology. Correct writing code is not taught there, quite the contrary. You watch code samples which show there and it is that, the infected code which threatens to turn into above described.
')
What does a person who is just about to become a programmer see? Sees a list of technologies that need to be explored. And that's it! Occasionally, someone smarter still advises reading Refactoring or Perfect Code. But this is not enough.

What do you suggest?

I have nothing to offer yet. I will share what I had to deal with on projects. What prompted to write like that. How to fix it and the most important thing - how not to write. Sample plan: why and how to separate logic from infrastructure, validation where and when, unused power of exceptions, patterns, unit tests, etc. I, honestly, until I imagine how much material I can fit, so this plan is very exemplary.

Do we have any chance for a bright future?

I hope. The industry is slowly emerging from chaos. Special training IT institutes are being created. Someday a learning standard will be formed, where like design patterns, but much wider and deeper will cover standard tasks and ways to solve them. I would be extremely happy if services like Codility were created and became popular, but testing not the ability to quickly solve problems of the Olympiad type, but the ability to correctly write code for an ordinary task, automatically checking the correctness of the task cutting into parts (classes). Slightly more intelligent than parameters such as cyclomatic complexity.



If you wish, come listen. DevConf this year is held in conjunction with YiiConf .

On June 16, YiiConf will be held .
June 17 - DevConf .
June 18 is the day of master classes for both conferences.

The program YiiConf has already been formed . According to the reports of DevConf , the voting is on. Hurry up to buy tickets at the May prices.

Source: https://habr.com/ru/post/329704/


All Articles