10 programming skills of ASP beginners

zhaozj2021-02-16  71

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, use notepad to write your ASP code! You can also watch it about "pure natural"

The ASP code is dedicated to the article. At http://4guysfromrolla.com/webtech/020299-1.shtml 3. Know where you can find the information you need! No matter what programming language to develop applications, an important Part is to know where you have to find what you need! Everyone will always encounter such problems in the process of development (some people have more troublesome), so I know where you can find what you need. The information is that there is still a way. There are not many books on ASP programming, but you can get help on many Internet sites, there are many sites on the Internet full of useful information as this site, I often go ASP-speaking site is: ASPWire.com Headlines http://4guysfromrolla.com/webtech/news.shtml ActiveServerPages.com ASP FAQ http://www.activeserverpages.com/learn ASP FAQ on 4Guys http: // 4guysfromrolla. COM / Webtech / FAQ / FACTOC.SHTML ASP Today http://www.asptoday.com/ Now you know where you want to find the information you need? You have won half a battle! :) 4. Wisdom Directory structure! I often see some sites use confusion file names and directory structures. The article is named after the date of use. The directory name is not easy to understand, and people don't know what documents are put in this directory. If your file name can describe This file is dry, your directory name has a clear meaning, which will be great to you and you in the surfers you sit. We can assume that you have established a site about ASP, some of which is about how Learn ASP. Put the scripts about learning ASPs in a directory of a name / Learn. If you have a file that discusses the database, then it is best to name the file DBQuestions.asp. Now, we only need Flying quickly swept over the directory, you can understand what /learn/dbquestions.asp this file is to tell /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 change a mistake. You may have discovered Reading and understanding the code written by others is quite tasty (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. (It is best to do this, don't wait until you have already written your All code!) And let others take a look at your code, you will know if your document is complete in detail from your colleagues' comments. So you can make some good friends (or enemies, this depends on you The readability of the code!). :)

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

New Post(0)