comp.lang.ada
 help / color / mirror / Atom feed
* Re: Does ObjectAda optimize at all??
@ 1998-08-22  0:00 dewar
  1998-08-24  0:00 ` Optimizations' effect on software quality (was: Does ObjectAda optimize at all??) dennison
  0 siblings, 1 reply; 2+ messages in thread
From: dewar @ 1998-08-22  0:00 UTC (permalink / raw)


T.E.D. says

<<Exactly. I think I'm familiar enough with my own ignorance to aviod this 
personally. But its awfully hard to stop other folks from doing this in their
 own code when they know:

  o  The code in question is called several times from a high-frequency
  routine  o  The complier is unable to do the optimization for them.  o  If
  they manually "optimize" the code later, they are liable to  accidentally
  introduce new bugs (at a very late stage in development). >>


This is missing the most critical criterion, namely that it will actually
make a difference to do the transformation. As I say, often programmers
just don't know it will make a difference. For example, loop unrolling
may or may not help.

A programmer who tries to improve their program with inadequate knowledge
is a completely in the dark. Yes incompetent programmers might do anything
(you always seem to be worrying about them), but there is no reason to think
that knowing anything about the compiler will in positively affect their
behavior if they are this incompetent!

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Optimizations' effect on software quality (was: Does ObjectAda optimize at all??)
  1998-08-22  0:00 Does ObjectAda optimize at all?? dewar
@ 1998-08-24  0:00 ` dennison
  0 siblings, 0 replies; 2+ messages in thread
From: dennison @ 1998-08-24  0:00 UTC (permalink / raw)


In article <6rngqo$dep$1@nnrp1.dejanews.com>,
  dewar@gnat.com wrote:

> is a completely in the dark. Yes incompetent programmers might do anything
> (you always seem to be worrying about them), but there is no reason to think
> that knowing anything about the compiler will in positively affect their
> behavior if they are this incompetent!

I'm referring to real software developers that I deal with on a daily basis.
Some of them are neophites, yes. But everyone here was at one point as
well. As a matter of fact, if we take a definition of competence that includes
"knowing not to try to hand-optimize code up front without making sure that it
actually significantly helps", we would label "incompetent" nearly every
software engineer I have ever worked with. I think that's a bit extreme.

If you work with nothing but expert engineers, you should consider yourself
fortunate. I have been on a couple of projects like that, and they are a joy
to work. But generally I deal with a lot of engineers who are new to Ada and
haven't spent a lot of time learning what I would consider sound software
engineering principles. You may be able to dismiss such folks as
"incompetent", but I don't have that luxury.

Its my responsibility to help such people along, with the poor powers of
logic and persuasion that I have at my disposal. For this particular issue,
I'm used to using they compiler's optimization features to strengthen my
argument. My own ameteur psycology theory is: Yes, the real point is that you
shouldn't blindly perform "optimizations" that might not help. While the
logic of that is generally convincing, accepting that when they have already
started hand-optimizing code means accepting that they aren't superior
engineers, which they have a lot of trouble doing. However if they can also
tell themselves, "well, the compiler can do that for me later", then it
becomes an issue of saving them work. That's much more palatable. Consider it
the sugar that helps the medicine to go down.

But there's a bit more to it that just that. Suppose I know my compiler
doesn't do subprogram inlining at all. Am I going to break everything up into
lots of tiny modular one-use routines? Certianly not to the extent I would
have otherwise. If I know that my compiler is incapable of moving
loop-invariant code outside of a loop, I'm probably not going to put any
(that I notice) inside a loop, even if it would have made the source code a
little bit clearer and less sensitive to change.

So lack of optimizations in the compiler will have a real effect on the
readability and maintainability of the resultant code. The effect will
probably vary by developer. It could be striking, or it could be subtle. But
it will be there.

--
T.E.D.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-08-24  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-08-22  0:00 Does ObjectAda optimize at all?? dewar
1998-08-24  0:00 ` Optimizations' effect on software quality (was: Does ObjectAda optimize at all??) dennison

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox