I have a very familiar friend who is busy now. He has a lot of unfinished contracts, and an assistant developed with him also leaves him. As a result, he failed to take a rest for several weeks under the urging of three major accounts.
One of the customers talked to him about the iPad app he made for the customer.ProgramThe customer told him that "We spent money to hire another programmer to review yourCodeHe said that your code is poorly written ."
When he told me this story, I just smiled and remembered how I used to drop others' code. When I first started programming, I saw a program. I thought it was unquestionable. I deleted the code, I wrote it again in what I think is better. When I became mature, I looked back and found that the code I deleted was actually using a good design model, and I re-wrote it was really ugly.
So I got a lesson.
In the days that follow, I often encounter code that I think is ugly and cannot be ugly again. Even so, I will not deny them all. I will only find some particularly intolerable parts to rewrite them. There were nine in 10 times. When I was about to finish it, I found a problem that forced me to say "Oh, no wonder they want to write it like this" to myself ", then restore the code to its original state, or use the same "ugly" method to complete it.
Now that I have become more mature, I can confidently tell you that I will no longer look at the Code Compiled by others and say "oh, this code is so bad. I know that before you know the solution of the entire program, you can't easily judge the Code's advantages and disadvantages. Really, sometimes it looks silly, it's not finished well, or it's not documented (I mean self-commenting), however, you simply cannot know how Programmers think when writing this code. More[Source: gameres.com]In many cases, there is a certain reason for them to choose to do so. Unless you study them in depth, there is no other simple and quick way to understand the context of the program.
So every time I hear someone looking at someone else's code, I just smile, reminding me of my innocence and self-confidence. Indeed, I used to believe that I was a good developer and knew every typeAlgorithmOptimal design. I miss my arrogance, but I'm glad to learn these ideas. I know that the only code I can despise is my own code, the reason for contempt is that I cannot make it better.