📜 ⬆️ ⬇️

IT bicycle industry

Introduction


I can’t say for sure what made this post write - maybe my accumulated experience and belonging to php-programmers who are known worldwide for their bydlokodom or recent post in which the author describes the problem that appeared in his bike and related to global variables in different modules.

After reading the comments to which, I felt really bad ... I just did not understand how people do not see the essence of the problem, but see only its consequences - a problem in a bicycle. And the essence is that the author completely lacks any knowledge of “bicycle construction”. And the worst thing is that this knowledge is not missing from one of them. And almost the entire mass of inventors who saw the bikes themselves only in the pictures.

And if you take into account the fact that they do not even want to look at other bikes ...
')

Part one. The story of one cyclist



I think we need to start with the fact that we should mentally return to the bar of experience of a young cyclist who faced difficulties for the first time. One and a half years ago - on a snowy winter night and my room, lit by a 19-inch CRT monitor, quiet depressive music coming from the depths of the old Soviet record player and me personally - sitting on the floor and cutting out a mediator on an unconnected seven-string Ibanez .

At that time, I was an ordinary student who studied in the last year in the specialty 230101, which remained a little more than one month before the pre-diploma practice, and then ... one single feature - diploma protection, having stepped over which I will be thrown into a completely different world, which in complexity, size, cruelty and the number of opportunities to realize themselves, hardly compare with the one in which I was. With knowledge, it is hardly a little higher than what I received at school, and with complete lack of understanding how to apply them in real life.

And I was a puff and bydlokoderom in its most terrible manifestation - the sorts I wrote in a column was a mixture of four languages ​​(html, php, sql and javascript) using functions and classes scattered across various files with all sorts of vulnerabilities that only may exist. But despite this, I felt that I really wanted to develop further in this direction and improve my skills as a programmer.

Therefore, I perfectly passed the diploma, the theme of which sounded something like “CMS using AJAX technology”, and like many pykharis, I decided to create my own bicycle. I was enthusiastic, and I was impatient to finally put together all my knowledge of modern cycling: the paradigm of object-oriented programming, ajax technology, block layout using CSS, and even a bunch of xml with xslt.

It is now I understand that then I did not know anything about cycling. All my knowledge of two-wheeled vehicles was limited to the 19th century. Of course, they were no longer a modification of the railcar Macmillan, who essentially created the first bike in the world in our understanding - with a saddle and a steering wheel, they were clearly no more progressive than the brainchild of Pierre Lalman, who thought up to equip the bike with pedals. On the front wheel.




Trolley Macmillan
Pierre Lalman's bike
The perfect bike in the understanding of the average puffer

But then it seemed to me that I was inventing, a modern mtb-hardtey on a reinforced crumbling frame, hydraulic disc brakes, multispeed and a fairly light weight. What would you feel comfortable in cross-country without worrying about getting stuck somewhere in the middle of the forest. It is the same on the streets of the city, doing the straight, without even thinking that it can work out under you if you fail to jump from the stairs.
cutter_2005_complete.jpg - upload images with Picamatic
mtb hardtail


This was facilitated by my environment, consisting of the same pykharey, of different ages. Some of them had much more experience than me. And they all said the same thing: “I need to write my cms”, “Why should I use someone else’s framework if I can write it myself” and “The Web is a dubious place for an object-oriented approach, where the script has a lifetime of no more than one-fifth of a second” .

I was stupid, naive and therefore listened to them. And he wrote. Therefore, it is not surprising that my first bike looked like a wheelchair — some parts in it were first nailed to each other with nails, and after they were welded, forming a monolithic construction, which was not everything ... but she still went. And it was already unimportant that to turn left, we need to remove the legs from the pedals, lift the steering wheel and only then turn it. That the front shock absorber was blocked in one position and after driving over the bumps you could feel like a miner who spent eight hours with a chopping hammer. That breaking a camera, if of course this could ever happen to a metal camera at all, we would have had to replace the floor of the bicycle with a hammer, a hacksaw, and a gas welding machine.

But I studied. And stubbornly followed these inept directions. Write your bike spinning in my head. WRITE! I wrote. Of course, I got more and more experience - pictures with different bikes were encountered more and more often, they became bigger, so some details could be seen on them. Yes, and I learned about such a thing as design patterns.

At that time, I considered them to be something so sent from above, long-solved problems of all mankind, which only the last fool does not use. And at that moment, looking at myself from the outside, I began to consider myself just a fool - I write, I try, I spend my time and I don’t get anything. There is no progress.

Now I understand that I interpreted these patterns not quite correctly - I perceived them as a silver bullet, which ideally solves all the problems that people had before me. And owning it, I could easily create complex applications in a very short time, without even thinking about the fact that I could step on unknown rakes, everything was already decided before me. It was up to me people were stepping on a rake. Before me, they hurt their heads against the walls until they found the right path. And I just have to walk on it - that's all.

And I started writing using them. And I knew about 15 of them. Do you know what the effect of the second system is? If not, imagine a bmx with 20 inch studded wheels, a wheel of a road bike, two shock absorbers, four hydraulic brakes, two for each wheel (disc and v-brake), supporting side wheels (for those who are just learning to drive), three seats, glove compartment for tools, strollers in the back, planetary gear shift, pedals, four car headlights, rear-view mirrors and a seat belt.
Pg_2113029834.jpg - Picamatic - upload your images
ordinary bmx

And if this is all made to keep on one huge object-oriented nail - the Registry, thanks to which we can not say for sure if this bike can ride, if we want to remove one of the lamps ... then we will get an exact copy of the system I created ...

To be continued.

Part two. Continuation



I will not be surprised if many programmers see themselves in this story. Moreover, I would not be surprised if they see themselves at the very beginning of this path - surrounded by puffers, who are advised to invent, invent and invent again. Forgetting that in order to create something new. It is necessary to understand how it works. Smart people understand this moment.

I will even take it for granted if you finish reading to this line and catch yourself thinking that I am from the height of my experience, which you probably have already questioned, trying to say “The invention of bicycles is evil”. Use existing. Not. Then we will return again to the level of monkeys, and maybe even back to the sea.

But let's break everything down.

Part Three Shelves


And so we have a small problem (we put it on the first shelf), which is fueled by other problems (we put them on the second shelf), and which in turn give rise to the third kind of most terrible problems that can only exist. We put them on the lowest shelf.

And so the problem lying on the first shelf is extremely simple - a low level of entry. Anyone can learn how to invent new mutant bicycles in a very short time. Unfortunately, to solve it is not easy. Just to take and raise the level of entry into the language is almost impossible. You can name the reasons yourself.

The problem lying on the second shelf is visible to the naked eye - too much freedom of action. At first it seems very attractive and not a problem at all. But only after a while you realize all the danger of this freedom. When confronted with something that goes beyond conventional logic, or the butterfly effect, he commented on a line in one part of the project, the rest fell. I saw this myself, with my own eyes. More than once.

But on the last shelf we have the most interesting problems, which I crucify here. Namely, that people who themselves do not understand anything in cycling are beginning to lecture others, lead them along the most unsuccessful thorny path along which they once walked themselves, forcing them to step on the same rake. The path to the invention of the bicycle mutants.

And now I just realized that putting all these problems on the shelves is somehow easier and does not become. Rather, on the contrary, you understand even more that the mechanism has already been launched and debugged for a long time, giving birth to all the new puffers that create bydlokod in tons and consider it better to write everything from scratch. Although it’s interesting that they don’t build houses for themselves, they don’t sew clothes, they don’t make their own money. Why do they generally use the software if they are able to write everything themselves and better!

But I still want to hope that there is a way out of this familiar system. At least for myself, I found it. And I didn't even have to learn another bicycle programming language.

Part Four Starting from scratch.



And only after the second time I realized that I was doing something wrong. I decided to look at the problem from the other side. Just sit down and think about what exactly I am doing wrong. After a while I saw the answer - I knew how to solve the problem, but did not know why it should be solved that way. My banal was very weak theoretical base.

And I started learning. From scratch. Two to three hours a day, which I found due to the fact that I began to devote less time to everything that surrounded me — friends, loved ones, music. And during this time I have rediscovered for myself such concepts as abstraction, polymorphism. I finally understand why inheritance is needed, when it should be used, and when it is necessary to use encapsulation instead. I rediscovered object-oriented programming.

It dawned on me that what is written in the textbooks is only suitable for writing stupid examples of apples and geometric figures that are divorced from reality. I realized that an object is an entity, it is not tied to real objects. It has its own state, obligations to other entities and needs for other objects. It is so simple. This is written in every programming tutorial. The first lines. They give us an understanding of what object-oriented programming is, and then take it away with examples with a square inherited from a rectangle. And the person gets used to consider that the object is something from the real world. And then he screams “produced objects here” when he meets a competent object-oriented code. He has to break his understanding of this approach. Just as I broke it.

I finally got the essence of design patterns that really became patterns for me, and not a silver bullet that solves all possible problems. They do not tell us how to write. And just suggest. Now refactoring for me did not mean rewriting again any piece of code without disturbing everyone else.

Thanks in large part to the various design books (which are easy to read while traveling on the subway) and digging into other people's bikes (zend, ci, symfony), I realized that it’s not always the use of a planetary gear shift mechanism that is ideal for city walks (which I can assemble and disassemble in the morning, with my eyes closed and a terrible hangover), much better than the usual mechanism with a bunch of stars. I even realized that sometimes it is not needed at all. Why bmx'u with a dozen speeds. To banniki pull on the bench was easier? Or occupied with a flatland (in fact, dancing with a bicycle).

We do not always need to design a heavy two suspension, which is ideal for freeride, but also inappropriately and go into another facet - creating incredibly lightweight road builders who can ride at unreal speed, but only on a perfectly smooth surface.

Every day I tried to learn something new. I wrote and rewrote the code several times in the sandbox, in which I had my first practical acquaintance with the components of which the bicycle should consist. The second acquaintance either was not, or it already happened in real projects. Where I saw this thing work. And just as I imagined. Now one of them can already assemble a good bike *, which will almost completely copy the ZF. But that’s why I don’t see the point. It will not even appear when I encounter conditions in which ZF will become a stone that pulls the entire project to the bottom (due to its poor performance). I understand that completely different approaches to writing code will already work there effectively.

Conclusion



In conclusion, I would like to apologize to those who believe that I have touched it, and among these I think there will be a sufficient number of competent developers with their own quite competent bicycles, on which more than one good project was raised. It was still not about you. You can not be called pykhary :)

*


This is no longer the case. Now it is already assembled into a single “drawing” in which I left only the interfaces for each component, along with the exceptions. Ruthlessly removing everything that was once written and depriving the old name (brix framework), which, I think, only now will most accurately reflect its essence: brix from the fact that briks (bricks), and not a measure of the mass ratio of dissolved sucrose as wikipedia tells us.

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


All Articles