Programming is a useful way to experience, and when confronted with a challenge, we are constantly looking for new solutions. You might think that by combining perseverance, intuition, and the right tools, three of them together, you can write elegant, perfect code. However, the consequent poor deployment or another functional requirement, or a heavy dependency, can lead to undesirable iterative updates that can destroy your original dream.
We hope that each effort can have a far-reaching impact, we hope that our application depends on the server as a rock, but the way to get programming is brutal. This does not mean that all of your efforts are valuable. On the contrary, we should learn how to face these cruel facts. Look at the 10 practical truths listed in the following section, which may be of help to your work.
1. If all this is just if-then-else statement
Developers tend to argue over storage (closures), byte (typing) and abstraction (amazing abstractions), eventually choosing old if-then-else statements, which is almost always the demand of all developers, Includes the operation code and algorithm operation code of the input and output memory mobile data. The rest is a comparison between a branch or a non branch.
Around If-then-else statements, developers begin to add some fantastic fake appearances to it, but at the end of the day, the smart statistic recommendation engine picks up the maximum or minimum value in the matrix array list, which, by performing calculations, browses through all the lists until you make the final choice. Otherwise, it will always prompt you. "Is this the maximum, is this the maximum?"
2. Most Web pages store data in a form
Over the past 20 years, the internet has brought fabulous wealth, better friendships, cheaper products, faster communication and so on. At its core, most of the Internet stores data in the form.
Match.com? The form contains a variety of information, such as hair color, religious beliefs and favorite foods. EBay? This list collects the most expensive list of items. Every complaint is recorded in the lines of Blogs. OK, we'll name it table. We have reason to believe that mutual net is a mysterious and intelligent place, it is an automated document file "clerk".
From a programming language perspective, Ruby on rails, one of the most popular languages in web development, is a database framework. You just need to specify a global variable and rails to create a list for you because it is familiar to all the database tables that create the form.
There is also a database that nosql the non relational type. Today's computer architectures require a huge level of scalability in data storage, and NoSQL is committed to changing the status quo. At present, Google's BigTable and Amazon's Dynamo are using NoSQL-type databases.
3. Users have their own ideas
If you want to create event listener listener events for language and labeled "Save", copy the program to disk. In reality, users will expect to see a magic button that fixes all the bugs in their corrupted files or adds them to 401 (k), clicks Open and saves them forever.
Perhaps, the user will think so, we created a perfect machine, every time the user open, each design is foolproof, to avoid any failure. They envision a click to send data that is not stored on disk. All these perfect designs, they want to click on anything they forget in a way.
Sometimes, the user is reasonable, but in most cases they are very demanding and behave more strangely. Programmers try to guess what they think, and when the final code results appear in front of the user, what will they be like? The result was a failure. Because most users are not programmers, they ask programmers to think like ordinary users as if they want a cat to think like a dog, which is simply not logical thinking.
No matter how you invent smart or design elegant code, users don't look at the problem in terms of what you think. Because they do not use 140 characters limit to express their anger and desire.
4. Some of the code will never be used
Does your tool support Xml,csv,aramaic? Whether our operations team can parse Mayan hieroglyphics, perhaps at the end of 2012, if you do not have the function, OK, if you can provide this feature, will get more project orders.
Of course, users don't care too much, they just want a button, this button can even confuse them. This perfect code can be well executed in the QA team when you are able to support the N-1 button at compile time.
Programmers don't look like artists, they can expect their parents or relatives to bring some performance, and our parents don't test performance by executing code.
5. Changes in the project are unavoidable
A manager once told me about his secret, he always smiled and told his team that he loved what they did, even if it was dangerous, he would say "oh, one more thing" the moment he walked out the door. The arc ball partially covers the project and requires you to redesign the application. As a manager, you must first affirm the ability of the team to work.
The degree of expansion of the project scope directly reflects the final outcome of the project structure. Managers always use their whole body number to liquidate statements, first they conceive a great dream, an economic structure model to prove how much they need to invest in the budget.
After the developers have worked hard to put the work in front of the manager, your manager has nothing to worry about: Is this button in the right place? How does the log page look different? Even with a slight opinion, it changes our initial needs, doesn't it?
6. No one understands you--especially the boss.
There are two kinds of programmers: one is to work according to the plan that the boss specifies, no plan, no idea how to write code, and the other is to work hard and write good code in a programmer's way.
Your boss will never understand you or your job, and they are focused on whether you can give an excellent solution when the business grows into a bottleneck, rather than solving a problem such as a computer chip.
If your boss knows how to solve the problem, he will stay and solve the problem. Because he knows to talk to you more than the actual operation of the time spent more.
7. Privacy is a pain
We want our services to protect users and their information (privacy issues), but also hope that the site can be simple and easy to operate, we hope to be able to use the minimum number of clicks to achieve the user's desired purpose.
Privacy means you have to dig up a few more questions to make sure you control the spread of information, but that means we need to have more clicks. Privacy also reflects a responsibility, if the user does not want the server to know their excessive privacy, and the server can not read the user's ideas, how to do? So, responsibility is a problem, and privacy is a nuisance.
Of course, it also has a good side, for example, according to your preferences, the site can automatically provide links, so that you can buy your own favorite items, when you have the need to provide you with help.
8. Building trust with others
The birth of Web 2.0 enriches People's life, this new Internet way, through the network application (Web applications) promotes the information exchange and cooperation of the person and the human in the network, its mode is more user-centric. So you just link the code to someone, and there's a miracle that your code will be invoked.
First, before someone else uses your code, please fill out these protocols, and in most cases the agreement will require you to give up everything, so what will you get in return? Second, building trust with users, under which everyone will commit to the best practices and the highest encryption software to share your information. So don't worry about your code being stolen.
The end result will be much better than you would expect, for example to provide you with more work. Look forward to good luck coming.
9. When code encounters decay
When you start a task, you can get the latest version of the library, use these libraries to work a week or two, then will be born library1.0.2 version, of course, you will not use the latest version of library B, because the use of a version of the programmer has updated the new version, Your boss will also ask you to develop some new features based on the C version, of course, only for 1.0.2.
For example, when houses and ships are to rot, they rot in a uniform way. Many teams have this problem, the code of a project was originally designed well, after a period of time, the code will become difficult to understand, difficult to maintain, difficult to modify. Why? Because code decay is caused by modifying someone else's code without deep understanding. How to prevent code decay?
If you want C, then you need to give up B. If you choose B, then you will need to tell your boss that C is not the right choice.
We take 3 libraries as an example, but there will be more than 10 or more options in the actual project, and the problem will grow exponentially. Worse, decay is not immediately present. Sometimes hidden in a corner, it seems to be a humble problem, time will infect the entire code. It is this small, incompatible code that destroys the entire system.
We should make the code look like a proverb, even if it's still intact after 100 years.
10. Open Source World Thrive
More and more data show the importance of open source, currently, only a small number of open source market, very few people are willing to donate code to the open source community.
This may be why the biggest contributors to Linux and BSD code are turning to closed private code. Devices like TiVo may use Linux as the kernel, but a gorgeous interactive interface is not open source, as is the case with Macs.
Recently, the competition between Linux boxes and Windows boxes is stuck. Many people are questioning: Why buy Linux If you can buy a Windows machine that can install Linux if you spend the same money? The price of a Mac notebook is 2 to 3 times times that of a regular PC, and so much more. However, only a few people know that the iphone is also an open source operating system.
I think the open source world will thrive only if people keep focusing on open source, even if it's just a small part of the performance.
English from:InfoWorld
Translation Address: CSDN