|
Posted by Jerry Stuckle on 11/25/07 12:53
Knut Krueger wrote:
>> CPU cycles have nothing to do with it. This is all about good
>> programming techniques.
>>
> sure are CPU cycles and therefore SQL queries a question especially at
> an internetserver.
>
Nope, the reason for doing it correctly has nothing to do with CPU cycles.
>> It is much better to not make the call you know is going to cause an
>> error in the first place. The way you're doing it is just sloppy
>> programming. Such techniques are problems just waiting to happen.
>
> If the record is more than 50% available, then there are less sql
> queries with the suppress error method otherwise with the other method
> is better.
No it is not. It is stupid and sloppy. And anyone on one of my
projects who insisted on writing such crappy code would be looking for
another job.
You've been told the correct way to do it - have two functions, one for
SELECT statements and one for others.
> I started programming with assembler and 8068 processors and in this
> time everybody must take care about CPU and memory usage.
>
Damn youngster. I was programming a good 15 years before that. Try a
mainframe with 4,000 bytes (not 4K) of core memory and clock rates in
the 100's of kHz range. That describes the first system I was on.
But those days are long gone.
> And if the CPU usage (means CPU instructions) was less with suppress
> error it was a must to use this. That's why it is possible to suppress
> errors.
Do you see a performance problem? I don't think so. But your way takes
up more time than necessary.
> In both cases the error handling was important but it was in different
> ways.
> and using the @ including an error handling should not a bad programming
> style if the usage of the server is more less.
>
No, error handling is not the important thing here. Writing good code
is. Which means not doing what causes the error in the first place.
> Therefore I my mind there is still the question which way is with less
> cpu usage. That's not the question for one user, but for 1000 users
> simultaneously
>
> Regards Knut
>
>>
>
Doing it the right way and not causing the error in the first place.
Anything else is just plain sloppy or lazy.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|