Solved

Structure Vs Optimisation & Algorithm Efficiency

Posted on 1998-08-30
1
235 Views
Last Modified: 2010-04-30
With the advent of Faster Chips etc - should applications developers be concentrating on Program structure Vs Optimising for Speed ?
When first developing a solution to a problem - I develop an algorithm that solves the problem - If this problem is a new problem - I find it extremely difficult at the semantic level to think of more efficient solutions - gets easy once the program is coded - I always just code the first working solution I get - is this the same for you - please contact mw with your thoughts - as I do not use any optimisation techniques - only do if programs are slow I use Vb 5.0 - what do you think then ??

0
Comment
Question by:gmiajy4
1 Comment
 
LVL 14

Accepted Solution

by:
waty earned 50 total points
ID: 1431983
When you will experience with VB, you will see that all the code you will write will be nearly optimized (of course, you have to take care to have a readble application for later maintenance).

There is a lot of little optimization you can done easily without thinking too much.

Ex : If you go through all a recordset, (1000 records), don' t use the following code :

   Do while record.EOF = FALSE  
     ....
     record.MoveNext
   loop

Use instead

   record.Movelast
   record.Movefirst
   For nI = 1 to record.Recordcount
     ....
     record.MoveNext
   Next

This is due that in the first sample, you will test each time the EOF of the recordset. In the second sample, you will never do that. This increase a lot for large recordset.

If you are interressed, I have written a document indicating how to write a VB app with optimizations...

waty.thierry@usa.net
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question