How web programmers deal with web standards page 1 / 2

Time:2020-1-13

Author: jxdawei

Jxdawei’s blog: http://www.iwcn.net/

This paper discusses the positioning of web programmers and how to cooperate with designers to develop web projects in line with web standards in the context of the popularity of web standards.
This article is suitable for programmers who are not very clear about the division of labor under the traditional table layout.

1: Learn web standards to make your work easier.

Web standard is the general trend, so as a web programmer. You have to brainwash, you have to learn web standards. To re understand HTML tags, to understand how to make the program output the code required by the page.

For example:

How web programmers deal with web standards page 1 / 2

On the top is the effect drawing of the artist, and on the bottom is the program code that meets the standard:

    Dim oHtml
    set rs=server.createobject(“adodb.recordset”)
    Sql = “select top 10 id,Title From tbl_News  order by id desc”
    rs.open sql,conn,1,1
    oHtml=”<ul>”
    do while not rs.eof
        oHtml=oHtml & “<li><a href=””shownews.asp?id=” & rs(“id”) & “”” title=””” & rs(“title”) & “””>” & rs(“title”) & “</a></li>”
    rs.movenext
    loop
    oHtml=oHtml & “</ul>”
    rs.close
    set rs=nothing
    response.write (oHtml)

In the traditional table layout, the programmer will write a lot more HTML code. To write table, judge when to output tr to wrap the line, add an img to the front of each news to output a small icon, and use the program to control the length of the output title. All the work needs first page code, programmers can write this program.
For programmers, you should take the web standard as a blessing. You should read it as a Bible to understand what the page code really needs, and then you will find out. You are much more relaxed than before. Because web standards focus on the separation of performance and content, and the program is only responsible for content data. From then on, you don’t need to think about how to use program code to control the color change between lines, the output of a line in several columns, and so on. What you need to do is to output the most direct content to the page without any decoration.
Of course, if you are developing with. Net, you can be more thorough. You can fully focus on building objects, class libraries, data access, etc., and provide methods to the presentation layer. The following example is my previous project, which should have some reference value.

2: Web programmers, don’t let HTML tags get in your way.

If you think you really hate the tedious HTML tags, and your learning direction is not in the presentation layer of the website, say goodbye to the HTML tags thoroughly.

I used to work in a traditional desktop software development company. Programmers couldn’t understand HTML. When the website project was tight, they had to help. We take several examples of visual studio. Net 2003 to analyze carefully. According to the object-oriented structured layered development mode, we can also cooperate very well. Take the development of news module as an example:
First stepWeb programmers can design databases based on demand analysis. You can be responsible for creating tables and writing stored procedures. Programmers are very familiar with such things.
The second step: defines the object. Objectify the information of the website, such as:

    Public Class News
        Protected _id As Integer
        Protected _typeId As Integer
        Protected _title As String
        Protected _author As String
        Protected _original As String
        Protected _updateTime As DateTime
        Protected _content As String
        Protected _clickCount As Integer

        Public Property Id() As Integer
            Get
                Return _id
            End Get
            Set(ByVal Value As Integer)
                _id = Value
            End Set
        End Property

        Public Property TypeId() As Integer
            Get
                Return _typeId
            End Get
            Set(ByVal Value As Integer)
                _typeId = Value
            End Set
        End Property

        Public Property Title() As String

        End Property

        Public Property Author() As String

        End Property

        Public Property original() As String

        End Property

        Public Property UpdateTime() As DateTime

        End Property

        Public Property Content() As String

        End Property

        Public Property ClickCount() As Integer

        End Property
    End Class

Just like this, try to objectify all the tables in the website. Then define the recordset related to the object. The upper part defines a single news object, and then defines a recordset of news.

Public Class Newss
……
End Class

12 read the full text on the next page