Detailed thinking skills required by professional programmers

Source: Internet
Author: User

The thinking skills required by professional programmers: How many details should be paid attention to when writing a program?

I have heard a comment from a teacher about a good programmer: "A program is really fast, but it cannot be used ". In fact, many of us are still writing such programs until today. A program that cannot be used generally has several characteristics. For example, when a program encounters a problem, it always does not know how to handle the problem, or even encounters a problem under normal circumstances. But in the final analysis, it does not exist at all.EarnestSlaveUser perspectiveTo determine how to use the service. If the user inputs the input accepted by the program, it is necessary to give the correct result. The tragedy is that there are so many accidents, because the customer behavior is always unexpected by many programmers, therefore, when a user executes an operation that a programmer deems to be unconventional, the running result may be that the user cannot get any explanation of the problem. Then the user makes a conclusion: "What is this broken software? It's useless! ".

For example, Minsheng online banking is a huge tragedy. I want to perform an online banking operation, that is, to query the amount of money my credit card should pay in the current period, but I can't find the menu, the reason is: 1. the font of the menu is too small, so it is difficult to find it. 2. The first few items look like an account to query. But after you click it, the tragic result is that the prompt "this card is not a debit card ", I was wondering why you didn't prompt me to do that operation for my credit card. So I asked the customer service about how to query and complained to her that the online banking font was too small and there were too many useless menus. So the customer service MM told me how to set the menu. But how do I know how to display/hide those level-1 menus? Finally, I spent a lot of effort to find the menu, and then click the query, I was asked to enter the date, I was thinking, why not directly show the last issue? What can I do in this case? In the end, the more I think about it, the more I think about it, because: 1 this operation process is very uncomfortable; 2 this group of online banking software really breaks the reputation of our programmers. How can we develop such a hard-to-use software? If these programmers are forced to use Minsheng online banking software every day, it is estimated that they will be quite impressed. 3 Minsheng Bank is a good company. How can they get on with such a hard-to-use software? As a result, I naturally think of socialism with "characteristics" as "evil. Later, I thought that as a legal socialist citizen, I should "Make some contributions to China's software business" and give some suggestions to Minsheng Bank. So I wanted to register a forum for livelihood and give my comments. Unfortunately, the tragedy comes again, and there are so many registration information to be filled in, But what's even more tragic is that after I have filled in all the details, I cannot register under ie 9, the system prompts that the verification code is incorrect. Fortunately, I am a programmer. I have three browsers on my machine. So I changed chrome and registered it, but the post was not successfully modified. Calm down, I still have firefox, and the result is garbled. As a result, I once again used the professional qualities of programmers, cleared cookies, used a registered account, and sent a post in chrome to tell Minsheng what ease of use problems were there. After an hour of hard work, it's okay. If it weren't for my breath, I wouldn't be busy until one o'clock in the middle of the night to give the bank a response to the problem (you need to explain that the customer's mm attitude is very good, In addition, waiting for someone like me in the middle of the night, it's really hard for her. When she apologized to me, I replied to her. This is not your problem, and then I went to the Forum to complain ). In my impression, I only complained twice in the middle of the night, one is the movie "to be filmed for the Next Generation" directed by Director Tian Zhuangzhuang, and the other is the Minsheng online bank. You can also see that programmers don't think about how much trouble they will bring to users for the sake of users. You can imagine that if this happens to you as a programmer or your company, how much credit loss will be incurred to you.

This kind of tragedy has also appeared in our team. For example, after the application on the open platform of our SaaS application store has been used by users for trial purposes, users will continue to use it if they feel good, after purchasing the app, the user finds that the app cannot be activated. This is a huge blow to users and us. Let's not talk about how annoying the users are, but ask you, how do you explain the problems to users. You can't tell users that our programmers ignore a situation: "When an application expires, the application cannot be activated, because we need to prevent users from reusing the trial application ". I have been thinking about this for a long time, because I can't simply blame my programmers, because when designing a license to authorize this module, I am busy with other tasks, I didn't try my best to keep him away from our "Concept Design"> "functional specifications"> "design specifications"> "Implementation"> "QA" standard software product production routes, but more importantly, I didn't train them like me. No matter what I do, I must design products with "user scenario driven. Therefore, they can easily ignore the handling of software in Unconventional Operations and some detailed problems. In the end, after I spent an hour solving the problem for him, the customer finally relieved and expressed his understanding and gratitude.

In this article, I would like to give two examples to explain the details of the program and the software processing under Unconventional Operations. I will not elaborate on the "user scenario-driven" design in this article. You can refer to the "framework design guideline" book.

First example: we provide a customer with an activation tool for the uiosp OEM version. The interface for running this tool is as follows:

(1) run the initial interface.

(2) After the serial number is entered, it is being activated.

(3) activation is successful and some information is displayed.

In this small program, consider the following small details:

(1) The interface cannot be resize, because once resize, it will become very ugly;

(2) The background image cannot be blank or blocked with the resolution change, which is also very ugly;

(3) The "ESC" or "enter" button is supported to prevent users from using the mouse;

(4) You can use the Alt + <key> key combination to make it easier for you to use the keyboard;

(5) When you click the "Activate" button, you must change all the buttons to "disabled" to avoid repeated clicks;

(6) The UI should be avoided during the activation process, that is, when you click the interface at this time, the interface can be refreshed in a timely manner;

(7) activation is to display the activation process, prompting the user that the operation is in progress;

(8) The font of the interface should be clear to the user;

(9) Exception Handling: a) if the network is not smooth, prompt the user to check the network; B) if the license is blank, prompt the user to enter; c) If the license is invalid, prompt the user to enter the correct license; d) If the license has exceeded the limit, prompt the user to buy more authorization; e) If the activation is successful, but not the administrator user, the license may not be properly saved in win7, so you must be prompted to set permissions or use the Administrator identity.

(10) If you click "cancel" or "close", You Need To prompt whether the user is sure to cancel the operation.

You may also need to consider internationalization and Localization support, as well as whether to comply with section 508 specifications to support broader usability specifications and other issues. However, there are indeed many details to consider for a truly qualified software, and I am not completely correct. Next, I will use an example to introduce the exception handling instance.

 

The second example: License auxiliary tool, a console program that allows you to open a platform application license to the SaaS application store. Currently, it provides "-help", "-alterlic", "-alterconstraint", "-listconstraint", "-showmac", "-listlicattr", and "-showlic" commands, you can obtain help information, change license attributes, change license constraints, list available license constraints, view local Mac, list license attributes, and view license information. By default, you can drag a license to this program to automatically display the license information. This program is designed using the pipeline-filter architecture. I only use the "-alterlic" command to demonstrate how to handle exceptions.

 

1 namespace uishell. osgi. licenseutility
2 {
3 class Program
4 {
5 static void main (string [] ARGs)
6 {
7 pipeline linepipeline pipeline = new pipeline linepipeline ();

// Pipeline-filter architecture.
8 var showlicense = new showlicensedetailsfilter ();
9 pipeline. registerfilter (New alterlicenseattributesfilter ());
10 Pipeline. registerfilter (New alterconstraintfilter ());
11 pipeline. registerfilter (New listconstraintsfilter ());
12 Pipeline. registerfilter (New showmacfilter ());
13 Pipeline. registerfilter (New listlicenseattributesfilter ());
14 Pipeline. registerfilter (showlicense );
15 if (ARGs. Length = 1 &&
16 file. exists (ARGs [0])/* &
17 path. getextension (ARGs [0]). tolower (). Equals (". Lic ")*/)
18 {
19 try
20 {
21 showlicense. showlicensedetails (ARGs [0], String. Empty );
22}
23 catch (exception ex) // There is details exception in ex. Message. Thus, just show it directly.
24 {
25 system. Console. writeline (ex. Message );
26}
27 system. Console. writeline ();
28 system. Console. Write ("press any key to exit .");
29 system. Console. Read ();
30}
31 else
32 {
33 pipeline. Handle (ARGs );
34}
35}
36}
37}

 

The command is in the format of "-alterlic <file or directory> [-deep true/false] [-lictype FX/bundle] <attribute >=< value> ".

User input exceptions may be:

(1) file or directory is not specified;

(2) the file or directory does not exist. You must be told to enter the correct file/folder;

(3) the file cannot be read. You must be notified to change the permission;

(4) If the file format is incorrect, the user must be notified that the file cannot be processed;

(5) For directory, all license files are traversed. If one of the licensefiles fails to be processed, the other licensefile cannot be affected, but the license for failure must be recorded;

(6) If the attribute "<attribute >=< value>" entered by the user is a string in the "AAA" format, the user must be prompted and ignored;

(7) If the attribute entered by the user does not exist in <attribute >=< value>, you must prompt the user and throw an exception to terminate the change;

(8) If the value in <attribute >=< value> does not match the target type, the system must prompt the user and throw an exception to terminate the update;

(9) The license must be backed up before it is changed for rollback.

(10) other details or exception handling.

Here, we need to consider a lot of details and Exception Handling issues. I Can't elaborate on them one by one for your reference only. I hope I can give you some ideas. With regard to exceptions, I would like to emphasize that exception handling requires you to consider your Unconventional Operations in advance, provide error prompts for such operations, and tell you how to correct them. However, I think you should also find that there is a big difference between creating a software that can work normally and a software that can work well under any circumstances, then we need to make more efforts and more professional skills.

 

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.