Solved

Structure Vs Optimisation & Algorithm Efficiency

Posted on 1998-08-30
1
232 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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…

746 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

16 Experts available now in Live!

Get 1:1 Help Now