Programmers need to learn to read source code _ Programmer

Source: Internet
Author: User
Tags git clone ruby on rails

In the complex field of "communication", it is much more difficult to write coherent passages that can be grasped and understood by humans than to knock out a few lines of software code that does not "vomit" the interpreter or compiler.

That's why--in terms of software development--all documents are probably bad. Moreover, because writing is much more difficult for people to write than for machines, the document may continue to suck in the foreseeable future. There's basically nothing you can do about it.

Besides doing something ...


"Luke, learn to read the source code. ”

Luke Skywalker, a character in the movie Star Wars, who came from the planet of Tatooine and, after discovering the SOS message that Princess Lisa entered into the robot r2-d2, fought the evil Galactic Empire with Jedi Knight Obi-Wan and finally rescued the princess. The Star Wars series is a sci-fi film produced by Lucas Studios. The Lucas Film company first launched Star Wars in 1977, followed by the launch of Star Wars 2 and Star Wars 3 in 1980 and 1983 respectively. It then launched 3 "Star Wars prequel" series in 1999, 2002 and 2005 respectively.

The JavaScript "always comes with the source code" is a revolutionary force, which is one of the main reasons I have put forward the "Art law" (I still believe in this rule.) Even if the view Source feature is not inline (but it should be there), you should also request access to the underlying source code under your software. Whatever the document says, the source code is the ultimate fact, the best, most definitive, and most recent "document" You can find. This fact will never change, so the sooner you accept the fact, the better your situation as a software developer will be.

Translator's note: "Atwood's Law" (Atwood's laws) is the author's own point of view, the content is: any application that can be written in JavaScript, will eventually be written in JavaScript.

I was going to write a good deal about this, but later on Hacker news website Brandon Bloom has written a great post. I am humbled. Read it carefully, because he explains the benefits of reading the source code, and under what circumstances you need to read the source code.

I started working on the Microsoft platform around the age of 15 and used it as an industry. I worked as a software developer for Microsoft to do integration work on Visual Studio. More than 10 years after I wrote the first line of Visual Basic code, I hope I can no longer link to a closed library.

Using software is not the same as developing software. When you use the basic functionality of most software, there is generally no problem, because the "old" road has been traversed many times. Some other people may have problems, and enough people to reflect them, prompting core developers to fix these problems. And when you are developing software, you are doing something "new". Also, there are many "ways" to make things happen, and you will encounter parts that have never been touched before, reach a corner that has already been corroded, and go to a code path that has not yet been completed. You will encounter some edge situations where the problem is known, but it has never been really solved (before it was just bypassed).

In some cases, the document is incomplete. Sometimes, it simply is wrong. The source code is never a lie. For an experienced programmer, it is often quicker to read the source code (especially if you are already familiar with the package architecture) ... I'm working with a couple of startups in a medium-scale shared office area. Many of the chief technology Officers and engineers from other companies often run to our team to seek guidance and advice. When they came over with the problematic software, I asked them the first question: "Hey, have you seen the source code?" ”

I encourage developers to "Git clones" all the source code they rely on. At first they were all a little afraid. "That project is too big," he said. I can never find out the problem. "I'm not that smart, I can't read those codes." "Those codes are too ugly." It's horrible. "But you don't have to turn the code upside down and just follow the lead." Besides, if you don't understand the platform you're relying on, how can you harness your own software? In most cases, novice programmers think that beauty is often superficial, and they think that ugliness is often a time-tested product-level code written by the hacker Masters. Now, after a year or two, several developers came to me, thanking me for forcing them to "dive" or "swim" in someone else's code. Their skills are much better now than they used to be, and they sigh: I don't know how to do things well in the past without someone else's source code ...

Git is a source control tool that is widely used in the open source community. git clone is a command that can copy remote source code to this computer.

When you run a company, if your software fails, your client doesn't care if it's your fault or Linus, or caused by a rails developer. They only know that there is something wrong with your software. All other people's software becomes your software, because their mistakes are counted on your head. Once a failure occurs, you need to find the problem and fix it. You need to fix it in the appropriate location in the "Application chain" to reduce risk, maintenance costs, and turnaround time. Sometimes, a quick contingency is best, and at other times you have to recompile your code. Most of the time, you can get other people to fix the problem upstream, but there are plenty of times when you have to work it out yourself.

Translator Note: Linus Torvalds (Linas Tovaz) is the creator of the Linux core, who is called "the father of Linux". He was highly rated by Time magazine: "Some people are born to be leaders of millions, others are born to write software that subverts the world." The only person who can do both at the same time is Torvalds. "Even in the 100 most important figures of the 20th century, which were chosen by the Time magazine according to the reader's vote, Linus was ranked 15th, and Bill Gates was 17th."

Translator Note: Rails means Ruby on rails, a Web application framework built on the Ruby language.

There are two options for dealing with closed software: Begging for their generous rescue, or adopting alternative solutions. For open source software, if their developers do not give the power, it is recommended to deal with the problem of closed software. Older software vendors tend to slowly develop their ability to maintain branches, patches, and other trivial issues.

There is only one simple fact in the real hacker world: If a software is running on my machine, it is my software. I'm responsible for it. I have to figure it out. Starting from source code is a principle that must be followed and is no exception. I have to control my environment, I have to control all the things I rely on.

No one reads other people's code for fun. Heck, I don't even want to read my own code. It's absurd to think that you're comfortably seated in a leather chair, dressed in plain clothes, served with a glass of brandy, reading someone else's code to spend a wonderful night.

However, we need to be able to access the source code. We have to read other people's code, because we have to understand the code before we can do our own thing well. So, Luke, please don't be afraid to read the source code-no matter how scary it may seem, and wherever it takes you, go with it.


from:http://blog.csdn.net/happydeer/article/details/18772735

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.