10 programming skills of ASP beginners

zhaozj2021-02-16  61

1. Comment Your code! Many programmers are in seeing the code that they wrote by only months, there is no hair, in fact they are still making trouble for future! One of the reasons for hard reading of the old code is They lack effective comments. In ASP (if you use VBScript), you can use a single quotation number to comment your code, here is an example: <% 'Create a variable to hold the user's name Dim Strname ...%> If you use JavaScript, you can use // to comment the code, the following is an example of JavaScript comment: <% // create a variable to hold the user's name var strname; ...%> but when we should note the code In the world of code, there is no "excessive annotation" problem. Therefore, as long as you think this special place needs to be annotated, you should do not hesitate to add a comment! Generally, the new variable defined, the annotation process And functions, annotation of some segment (explanation to write this code) and some lines particularly difficult or particularly complicated in the code. By detailed notes for the code, your maintenanceability of your ASP application will be greatly improved. In a sense, the comment is an unknown science. If you don't want to spend time, you will write a comment, then you will be in the long development journey, you can have a pure, you can write the ASP code First write the corresponding pseudo code, this is also a note, since then, you will take the way of comments. 2. You will write "pure natural" ASP code! Now we often find that many programmers have Drumbeat or Visual The ASP development tool of the INDERDEV has a deep dependence. These development tools do not log, but if you leave these GUI tools, you don't know what to do, then they are harmful! Why are they harmful? Ok, let us imagine, once your hand does not have these GUI development tools, but your code has a few questions, what should you do? It is obvious that you can't get a dilemma. Or or the GUI tool you use cannot be completed You need a special feature, you have strongly dependent on these development tools, you will not know how to complete the previous development tasks. I have always seen that ASP beginners are mastering the basic skills of writing ASP code. Before, you should leave those GUI's development tools. In other words, it is to write your ASP code with notepad! You can also see a special discussion of "Pure Natural" ASP code. In http: // 4Guysfromrolla.com/webtech/020299-1.shtml 3. Do you know? Can find the information you need! No matter what programming language to develop applications, an important part is to learn what you need to find what you need! Everyone will always encounter this in the process of development. The problem (some people have more trouble more), so I know where the information you need is, it is necessary. Not much book on the ASP programming, but you can in many Internet sites Get help, there are many sites on the Internet that are full of useful information as this site, and a few ASP sites I often have: askwire.com headlines http://4guysfromrolla.com/webtech/news.shtml "target = _blank> http://4guysfromrolla.com/webtech/news.shtml ActiveServerPages.com ASP FAQ http://www.activeserverpages.com/learn "target = _blank> http://www.activeserverpages.com/learn ASP FAQ on 4Guys http://4guysfromrolla.com/webtech/faq/Factoc.shtml "target = _blank> http://4guysfromrolla.com/webtech/faq/Factoc.shtml asp Today http://www.asptoday.com/" target = _BLANK>

Http://www.asptoday.com/ Now you know where you need the information? You have won half a battle! :) 4. Use a wise directory structure! I often see some sites Chaotic file name and directory structure, the article is named after the date of use, the directory name is not easy to understand, people don't know what files in this directory. If your file name can describe this file is dry, your directory name There is a clear meaning, which will be a great advantage of your site. We can assume that you have established a site about ASP, some of which is about how to learn ASP. Scripts related to learning ASP It is quite wise to put it in a directory called / Learn. If you have a file that discusses the database, then it is best to name the file DBQuestions.asp. Now, we only want to sweep over the directory, you can immediately Understand /learn/dbquestions.asp This file is what is said. If this file is named /webtech/051399-1.shtml, you will not know the cloud. :) 5. Let others take a look at your code! Have you been assigned to see the code written by other people? Maybe you will add some new features to this code, maybe it will be correct. You may have discovered that you have already discovered that the code to read and understand the code written by others is quite Taking force (if their code is not writing very well, there is no good comment). I found that let others look at your code and confirm that they can easily read it is a quite good idea. (Best early Something, don't wait until you have written your code!) And let others take a look at your code, you will know if your documents are complete in detail from your colleagues. So you can also make Some good friends (or enemies, depending on your code readability!). :)

转载请注明原文地址:https://www.9cbs.com/read-14887.html

New Post(0)