|
-
Oct 30th, 2006, 07:21 PM
#4
Re: Capitalize beginning of sentences(single and double spaced)
 Originally Posted by BrendanDavis
What I wrote will get the job done, as you say. And it does so quickly and with more options than the code you presented.
what options? the number of spaces thing is irrelevant in my code - and if you want the DoEvents then it's just one extra line
 Originally Posted by BrendanDavis
While your code may be shorter and more practical, it isn't any faster in the grand scheme of things. So why does it matter, really?
It is much, much faster.
Some quick timings (compiled) reveal that for a short string (the one i used in post #2) my code was ~8 times faster.
For a string 32x that length it was ~19 times faster
For a string 32768x that length, well mine took ~80 milliseconds and i gave up waiting for yours after 5 minutes.
someone could still get much faster results than my code if they were willing to put the effort in.
also your code doesn't even work without modification (you've cut and pasted the wrong sections)
 Originally Posted by BrendanDavis
True, I could have made the code MUCH smaller(in fact, I already did ;D) by not copying the procedure several times. But like I said, it still does the job and does so quite nicely and quickly, even if it does leave room for improvement.
if you knew that you could have done it better then why not wait till you've improved it - the code in the CodeBank is meant to set an example.
 Originally Posted by BrendanDavis
I may not be the best coder out there, especially being that I've been away from all forms of programming for more than 6 years until just recently(about 3 weeks ago or so), but that doesn't mean that something I wrote is useless just because there is another way to do it. Each person is different, and they're going to write their code in whatever way they understand it best AS WELL AS whatever way works for them/what they're doing.
No harm in that =)
but there is harm - the code is slow, bloated and advocates the use of bad programming logic (GoTo) and redundacy (If withDoEvents = True Then) - people use the codebank for examples of good code that they can learn from. This isn't good code, and needs to be highlighted as such.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|