Solved

Structure Vs Optimisation & Algorithm Efficiency

Posted on 1998-08-30
1
233 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA: Add rows to listbox based on criteria 7 73
How to create a duplicate finder Application 9 115
VB6 - Convert HH:MM into Decimal 8 51
VB6 ListBox Question 4 33
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

920 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now