ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rating: Thread Rating: 3 votes, 3.33 average. Display Modes
 
Unread ASP Free Forums Sponsor:
  #31  
Old July 26th, 2007, 09:39 AM
chapman10s's Avatar
chapman10s chapman10s is offline
**Wanted Wizard**
ASP Free God (5000 - 5499 posts)
 
Join Date: Apr 2006
Location: Who knows...
Posts: 5,410 chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)  Folding Points: 12139 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 4 Days 12 h 36 m
Reputation Power: 1332
Send a message via AIM to chapman10s Send a message via MSN to chapman10s
Quote:
Originally Posted by jmurrayhead
Something that hasn't been mentioned in this thread and that I see a lot of with new developers is unformatted code. Take these two samples for instance:

Code:
<%@ Language=VBScript %>
<%
set conn = Server.CreateObject("ADODB.Connection")
conn.Open "DSN=AdvWorks"
set rs = Server.CreateObject("ADODB.Recordset")
rs.CursorLocation = 3  ' adUseClient
rs.Open "Select * from Employees", conn
rs.PageSize = 2
intPageCount = rs.PageCount
Select Case Request("Action")
case "<<"
intpage = 1
case "<"
intpage = Request("intpage")-1
if intpage < 1 then intpage = 1
case ">"
intpage = Request("intpage")+1
if intpage > intPageCount then intpage = IntPageCount
Case ">>"
intpage = intPageCount
case else
intpage = 1
end select
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE>ASP & ADO Paging</TITLE>
</HEAD>
<BODY bgColor=White text=Black>
<%
rs.AbsolutePage = intPage 
For intRecord = 1 To rs.PageSize 
Response.Write "Record	number: " & intRecord & " " 
Response.Write rs.Fields("FirstName") & " " 
Response.Write rs.Fields("LastName") & "<br>" 
rs.MoveNext
If rs.EOF Then Exit For 
Next
rs.Close
set rs = Nothing
conn.Close
set conn = nothing
%>
<form name="MovePage" action="default.asp" method="post">
<input type="hidden" name="intpage" value="<%=intpage%>">
<input type="submit" name="action" value="<<">
<input type="submit" name="action" value="<">
<input type="submit" name="action" value=">">
<input type="submit" name="action" value=">>">
Page: <%=Intpage & " of " & intpagecount%>
</form>
</BODY>
</HTML>


Code:
<%@ EnableSessionState=False Language=VBScript %>
<%
set conn = Server.CreateObject("ADODB.Connection")
conn.Open "DSN=AdvWorks"

set rs = Server.CreateObject("ADODB.Recordset")
rs.CursorLocation = 3  ' adUseClient
rs.Open "Select * from Employees", conn
rs.PageSize = 2
intPageCount = rs.PageCount

Select Case Request("Action")
	case "<<"
		intpage = 1
	case "<"
		intpage = Request("intpage")-1
		if intpage < 1 then intpage = 1
	case ">"
		intpage = Request("intpage")+1
		if intpage > intPageCount then intpage = IntPageCount
	Case ">>"
		intpage = intPageCount
	case else
		intpage = 1
end select
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE>ASP & ADO Paging</TITLE>
</HEAD>
<BODY bgColor=White text=Black>

<%
rs.AbsolutePage = intPage 
For intRecord = 1 To rs.PageSize 
	Response.Write "Record	number: " & intRecord & " " 
	Response.Write rs.Fields("FirstName") & " " 
	Response.Write rs.Fields("LastName") & "<br>" 
	rs.MoveNext
If rs.EOF Then Exit For 

Next

rs.Close
set rs = Nothing
conn.Close
set conn = nothing
%>
<form name="MovePage" action="default.asp" method="post">
<input type="hidden" name="intpage" value="<%=intpage%>">
<input type="submit" name="action" value="<<">
<input type="submit" name="action" value="<">
<input type="submit" name="action" value=">">
<input type="submit" name="action" value=">>">
Page: <%=Intpage & " of " & intpagecount%>
</form>
</BODY>
</HTML>


Which one is easier to read? I hope you say the one on the bottom. When debugging code, having some type of formatted code (using indents, spaces, etc.) makes debugging much easier because the page is easier to read. Think about the first code sample above if it were a much larger application. Even if you have an editor that shows each line and an error shows the exact line..having formatted text still makes it much easier to debug.


Excellent point!!!
Comments on this post
richyrich agrees: random rep!!!
__________________
I would rather know than not know at all...



Reply With Quote
  #32  
Old August 2nd, 2007, 02:05 PM
sidhu.rs sidhu.rs is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Posts: 1 sidhu.rs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 26 sec
Reputation Power: 0
Yes its true, i tried many times. i agree

-Ravinderjit Singh Sidhu

Reply With Quote
  #33  
Old June 16th, 2008, 11:46 PM
thomasz thomasz is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 10 thomasz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 53 m 56 sec
Reputation Power: 0
I will use hight techniques for software.

Reply With Quote
  #34  
Old November 2nd, 2008, 10:28 PM
ann321 ann321 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2008
Posts: 1 ann321 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 30 m 13 sec
Reputation Power: 0
Debugging techniques

I think this Logger Control could be quite useful. ASP.NET AJAX has a similar concept, however the feature set isn't quite as rich (compare the YUI demo with the ASP.NET AJAX demo and I think you will see what I mean). To assist in debugging ASP.NET AJAX applications, Microsoft created the Sys.Debug helper class
--------------------------
Ann

inspire internet marketing

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > Debugging techniques


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek