The answer to the
article.If you do not develop software for machines or automatic life support systems, etc. - the following works for you with proper use.
I’ll say right away - not my idea, in the
article “Is there no more design?” Martin Fowler himself wrote about evolutionary refactoring. And Bob Martin even wrote down a whole book with an example of a phased development of the application (and not just one), calling it “Fast Software Development” and demonstrating the ability to use a masterly technique in Java and C ++.
')
First, govnokod at the first stage is required. A lot of reasons. Once - you know nothing about the actual working conditions of the application, all your guesses are garbage. Until real experience is gained, until the first live data is entered by a real user - you have no feedback. If you do not agree, read McConnell, the myth of stable requirements, and get levelap.
Two - the salary is not taken from the air, and from the idea to the somehow start-up startup lies a certain period of searching for successful options for the functional and monetization. First of all - the functional. And the faster a startup can change, the more likely it will develop to the stage of self-sufficiency, it will bypass competitors and money will flow from which developers can be paid a premium. As Bill Gates wrote prophetically in 1997, the 2000s will be a decade of speed. By the way, there was a study on Habré according to which most of the successful startups somehow had govnod in their development.
Some specific examples.
We make a three-level menu with hardcodes (layout and arrays in godobject, magic numbers and other antipatterns), and we have it copied by competitors, designing a tree in the database and making a bunch of classes. We monitor user clicks and see that people are lost. Simplify the menu, change the code in one day (it is simple, and it’s not hard to throw out the hardcode, because we knew that we would rewrite it). The competition begins srach between the leaders, who feel sorry for changing the designed menu and two weeks of cool, correct programming, plus they have an eye on them. As a result, we got two weeks time.
Next we make a denormalized table of products and categories, experimenting with the rubricator. Competitors make the fifth normal form, the categories of nested sets, write a week a bunch of stored in the database. At the same time, over the week, after clicks, statistics, order conversion analysts realized that linear categorization was needed, we threw out categories and made a tag cloud. Competitors in shock, another week won.
Then we make a summary report for the hour with our hands in php. It eats memory, but it works. Analyzing human behavior, we finish the report and proceed to refactoring. At this time, an idealist developer leaves the competitors, who are tired of changing the rules of the game, and they post a month’s search vacancy - after all, they wrote on rails and not in a different php, so the development costs twice as much and the developer’s search slows down the project by four of the week.
Two months later, the competitors died, and we rewrote the project (part I redid on the pros when the traffic grew), because we already knew all the entities, business processes and user stories, covered them with tests, set up CI. We also paid a premium to our dear programmers from the money we earned from a breakthrough in the market, and sent our developers for two weeks to Thailand for free.
Matches with real events are random, if that ;-)
And secondly, in my life I have met among hundreds of developers only three, who is really an architect and immediately designs how to. Such an architect writes in any language, masterfully owning several, and fully understands that language, tdd and methodologies are simply tools that need to be used wisely, and can even use a govnokod to test an idea and write a cool implementation of an already working strategy.
Most of the refactor is not that, not as it should, and not when it is necessary. In php, an example is an early megase-bound zend, when OOP is for the sake of OOP, and for simple operations there are 100500 function calls plus ultra-high connectivity. The weakly related components of symfony2 are good, but there is also some overengineering.
Today, I give my programmers time to refactor, as I myself grew into a project manager from a lead programmer (in the past, application software, then web development).
Because I remember the technical duty and strive to reduce it.
I will conclude with the words of the song of the 17 moments of spring: “but in general, you just need to remember the debt from the first moment to the last.”
I wish you all the time to refactor and the necessary skills!