VXCMD local and remote together

Robert Brenstein rjb at rz.uni-potsdam.de
Thu Feb 19 14:14:30 CST 2004


>on 2/19/04 12:03 PM, Robert Brenstein at rjb at rz.uni-potsdam.de wrote:
>
>>  Hmm, I do not believe in such absolute dogmas when it comes to
>>  coding. And I have never heard that doubling code is totally wrong.
>
>It is Robert.
>
>Have you hear about "Refactoring" -- new modern ideas
>     general for any programming language.
>
>A lots of useful things.
>I can give you ref on book.

Are you talking about Martin Fowler? Refactoring is important, as far 
as I understand it, for enterprise-level software. That is important 
to you.

>  > On the contrary. There are instances when doubling the code is
>>  beneficial. For example, if I have an if-else condition in a loop
>>  that runs thousands times, it is usually better to have two loops
>>  with if-else around them.
>
>You talk here about
>
>A) seed optimization based on LOOP INVARIANT.
>
>B) Refactoring teach:
>
>     a) yes, move out from loop.
>         but you point here only first step.
>         as you ay you will get doubling code
>
>     b) refactoring require now second step:
>         EXTRACT METHOD STEP: move that doubling code into separate
>             function. So you will have just SINGLE code.

But having to call a separate function in such a loop incurs an 
overhead in most environments which kills the effect of remove if 
from the loop. Function inlining, which does the opposite, is 
recommended in many instances.

The thing is, Ruslan, that what applies to your development and 
coding, may not be true for what we do :) My background is with 
numerical analysis, programs that require weeks of cpu time for a 
single run. And my primary use of Valentina is for web-served 
databases, where again every bit of performance counts. So I rather 
inline than extract and double the code if I gain speed.

There are also stylistic differences arising from programming 
environments and some of the logic that is natural in C++ feels 
awkward in them (cf. our earlier discussions on creating and opening 
databases with encryption).

Robert


More information about the Valentina mailing list