| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#31
|
||||
|
||||
|
Very nice thread indeed.
Good job bslintx, this thread is very informative for newbies and some of us who have a bit more time making asp code. Thanks for the refresher. I'd give you points but system won't allow it, as soon as I can, they're yours. |
|
#32
|
|||
|
|||
|
This thread is very useful as a guideline, what to do and what not to do
![]()
__________________
ASP ASP hosting SQL Tutorial SQL Strings Loans Canada C D SQL Dictionary Hosting Dictionary Tech Dictionary Job Bank Canada |
|
#33
|
||||
|
||||
|
Comments are your friend. They can also be your enemy.
So not only comment your code, comment it properly. Don't say "what" - that should be apparent from the code. Say "why" - not always so obvious more than 6 months down the line. consider the following, harmless looking code No Comment Code:
... a = a + 1 ... Bad Comment: (I used to work with a programmer who did comments like this all the time) Code:
...
' Add 1 to a
a = a + 1
...
Better Comment: Code:
...
' Keep track if how many items have been added to the collection
a = a + 1
...
Even Better Comment Code:
...
' This will be used to limit a paging algorithm found in function myPageSet.
' It is a count of how many items added.
a = a + 1
...
Ok this is a trivial example, but in a system with 1000s of lines of code thy make a huge difference. Elija |
|
#34
|
||||
|
||||
|
Avoid Redundant Code
Avoid Redundant Code
Redundant code refers to code blocks that are identical or nearly identical in different parts of an application. Redundant code adds processing load on the server side because an ASP page must be compiled each time that it is requested from the server. And the more code there is to compile, the more processing time is used. Also, redundant code is hard to debug and maintain because such blocks of code generally must be edited separately each time a change is made (even though they all perform the same basic process). Subs and Functions If you can identify identical or similar code blocks in your application, consider converting these code blocks to Subs or Functions. Subs and Functions can take parameters so it doesn't matter if the code blocks do similar things; you can create parameters that enable the functionality of Subs and Functions to be extended. In addition, by combining similar code blocks into Subs and Functions, debugging and extending the code can be done more easily. Rather than having to find all the similar code blocks and edit each separately, only one Sub or Function needs to be edited. |
|
#35
|
||||
|
||||
|
Objectives of Good Relational Database Design:
Objectives of Good Relational Database Design:
There are many distinct objectives that you must achieve in order to design a good, sound, structured database. You can avoid many of the problems you may encounter by keeping the following objectives in mind and constantly focus on these whilst designing your database.
Benefits of Good Database Design: The time that you invest in designing a sound, well strucuted database is time well spent. Good database design saves you time in the long run because you do not have to spend time constantly revamping a quickly and poorly designed structure. You gain the following benefits when you apply good design techniques:
|
|
#36
|
||||
|
||||
|
Naming Tables and Fields
Naming Tables and Fields
Once we've reached this point, let's establish our table and field names. Names for all database elements should be:
|
|
#37
|
||||
|
||||
|
Good posts by bslintx but would just like to add:
Subs and functions can not only be used to remove redundant code, that can also be used to simplify code. Move functional blocks of code to subroutines and functions and give them meaningful names. This will turn your main program logic into an overview of the program and clarifies the program flow, makes it easier to debug and change. Elija |
|
#38
|
|||
|
|||
|
This thread is very useful but can you all give more info on database structure and sql joins.
|
|
#39
|
||||
|
||||
|
Quote:
appreciate the response dev...would be great to share your knowledge on this subject too...join on in...again thanks!
__________________
Please give respect to those that helped solve an issue by clicking on the icon
|
|
#40
|
|||
|
|||
|
I am still in learning process and trying to learn as much as possible. All your great thoughts are food for thought for me. thanks again.
|
|
#41
|
||||
|
||||
|
Quote:
no problem dev....i'll work on that soon...thanks for the insight |
|
#42
|
||||
|
||||
|
Use queries as their intended... Their are many different options for your query rather than.. Select * From Table
Here is a good link with some query examples and some comments about them... http://www.l-and-b.dk/asp/sql.asp Access Queries btw Good Thought bslintx Quote:
__________________
werD, MCSD .Net <% ASP,.NET App Development %> Really Help People with Real Diseases... And Get a Cool Blue Flower! If a post has helped you please use the scales... we all need bigger heads
Last edited by werD : June 27th, 2005 at 02:27 PM. |
|
#43
|
||||
|
||||
|
Do Not Cache Database Connections in the Application or Session Objects
Caching ADO Connections is usually a bad strategy. If one Connection object is stored in the Application object and used on all pages, then all pages will contend for use of this connection. If the Connection object is stored in the ASP Session object, then a database connection will be created for every user. This defeats the benefits of connection pooling and puts unnecessarily high stress on both the Web server and the database. Instead of caching database connections, create and destroy ADO objects on every ASP page that uses ADO. This is efficient because IIS has database connection pooling built in. More accurately, IIS automatically enables OLEDB and ODBC connection pooling. This ensures that creating and destroying connections on each page will be efficient. Since connected recor |