Software maintenance

T

tea party

Le 16/09/10 08:06, Brian a écrit :
jacob navia wrote:
[snip]

You entire post and every "point" in it was a strawman.
Well, thanks for your very substantive contribution. It offers me the
possibility of refining certain points of my post.

The first point that I underscored was (in a few words) that inheritance
increases the dependency between the framework or software you inherit
from, and the rest of the code.

Obviously your software runs in *some* kind of context, and even if you
do not formally inherit from the environment, you are bound to it. My
proposition was that APIs and Interfaces are a much cleaner separation
boundary that allows for code reuse without commiting completely
everything to everything else.

A second point concerns the problem of readability of C++ code, that in
my opinion is not really where that language shines. I can't offer a
formal proof of that, but there are some facts that should prove my
assertion

(A) If you go to the discussion group comp.lang.c++ you will find a lot
of questions from newcomers and not newcomers asking more or less:

"I do not understand why this code doesn't compile".

In many questions the answers are: "It compiles in Comeau and gcc", or,
"I tried it in g++ under Sun Os", etc. An answer like:

"Your code can't compile because the error is at line 5: you forgot that
the default value ..." (etc, some explanation as to WHY the code doesn't
compile). The "explanations" offered (when at all) are just that compler
xyz compiles (or not) the stuff.

In the C discussion group this kind of "reasoning" is seldom used
because C is much more transparent and can be read by a seasoned
programmer WITHOUT having to go to the compiler to get a definitive
answer.

(B)
The underlying problem is evident when you read the SPECIFICATIONS of
the language. For instance, when I tried to understand the sequence of
rules being applied to operator overloading and the selection of the
function to call, the C++ standard went for several PAGES of completely
abstruse specifications that needed a "topological sort" of the classes
involved to figure out which function will be called!

But this means that a normal development programmer can't know in a
medium size project what function will be actually called and can at
best make an educated GUESS of what will be the result of the
topological sort of the classes that are considered and their possibly
overloaded methods. In most cases this works, and the cases where that
can NEVER work aren't discovered by the developer but by the maintenance
programmer that must figure out WHY the program took a completely
unexpected path and crashed...

A third problem I proposed to consideration is the fact that templates
have no specifications for their arguments, what makes unit testing MUCH
more difficult since the set of their arguments is completely UNBOUNDED.
ANY type can be thrown to a template and it is very difficult to test
within the template if the given type is acceptable.

Confronted to the typical mess of C++ code it is completely out of the
question for the maintenance programmer to READ the code to figure out
what is doing. The only way (and the accepted way of learning how the
program works) is to use the debugger and an IDE that understands C++.
In many companies where I worked the windows version was maintened not
because the program run under windows but because the MSVC IDE have that
MAGIC feature called "go to definition". Grep will not help you because
to know where an indetifier is defined you must know which of the
several definitions is the one used.

This message was a proposal to reflect about that part of language
design that is obviously not as "sexy" as "look how easily you can write
this or that" but about "look how easily you can READ this code and
understand what it is doing".

I hope that now you can better understand what I am trying to do.

jacob

You are so full of shit Naiva, shame that since the death of Richard
HeathField there is noone to call you on the shit you spew into this
group.

You want to make C into C++, you have bought someone elses compiler and
passed it off as your own, now you try to say "not C++, but just all my
nonstandard C++ shit is OK" - NO IT IS NOT OK, leave C to die quietly in
peace and do not try to make it into C++ Naiva.

Please go away and do not spew your shit into this group. Thanks.
 
M

Malcolm McLean

The teams I have trained have coding standards and follow them.  Those
standards listed the features to be used.
The problem is that, in an academic programming environment such as
the one I work in, it's very difficult if not impossible to enforce
this.
 
I

Ian Collins

The problem is that, in an academic programming environment such as
the one I work in, it's very difficult if not impossible to enforce
this.

Ah, there is that! Managing academics must be like herding cats.
 
M

Malcolm McLean

since the death of Richard HeathField there is noone to call you on the shit you spew into this
group.
Is this a joke?
I haven't been following the ng regularly.
 
K

Keith Thompson

tea party said:
You are so full of shit Naiva, shame that since the death of Richard
HeathField there is noone to call you on the shit you spew into this
group.

"tea party" is lying. Richard Heathfield is fine; I received an
e-mail message from him this morning. He's merely taking a break
from Usenet (a well earned one IMHO), from which he may or may not
choose to return.
 
S

Seebs

"tea party" is lying.

This post is misleading. By observing that he is lying, you imply that
this is a state people would have doubted. I think a more accurate response
would be to say "tea party has made a statement the truth of which would
matter to other people". We already know he's lying; the difference is that
normally he lies about things no one cares about.

-s
 
B

Brian

Ian said:
The teams I have trained have coding standards and follow them. Those
standards listed the features to be used.

Are you their "social security" though?
 
B

Brian

Ian said:
It may, but then the developer's pair slaps him round the head with a
rolled up copy of the standard. Or the next pair to change the code
take the offending construct out. I prefer short (often a page or
two) wiki based project coding standards that can evolve as the team
matures.

Oh I've been there and done that! You have to use the ISO When In
Rome standard.

Didn't Rome fall around 400 AD?
 
B

Brian

Seebs said:
Interesting, I haven't done anything with pair programming,

Don't worry about it, it's a stupid idea. You go to work to work, not
**** in cubicle. Nuff said. Change is fine and welcomed. Be forth about
it and shove it up your ass if you think you are entitled.
 
B

Brian

Malcolm said:
The problem is that, in an academic programming environment such as
the one I work in, it's very difficult if not impossible to enforce
this.

"Academia!". OMG? Really. It's really tough for those guys, but if you
are posting here you are an abused intern of the professor? Step one: the
campuses are GONE. People aren't (OK they are) pricks. You're still
alive, you're just no longer GOD. You have been subsumed by wikipedia.
Academics should not research like they have been. OK, I don't know what
I'm talking about. I'll post it anyway.
 
B

Brian

Ian said:
Ah, there is that! Managing academics must be like herding cats.

Stop being an ass or study something. Dedicate your life to it. Else shut
up and be greatful that you have viagra.
 
B

Brian

Nick said:
Nick said:
Nick Keighley wrote:
I've no idea what you are on about. If you have a specific
criticism of Jacob's post why not state it explicitly. Or are you
just trolling? [...]
I started to add some thoughts, but after a few responses I
realized he had an agenda
he probably does. So which bits of his post are wrong or refutable?

Like I said, the whole thing is so lame that it is not worth
responding to other than as a whole, which I already did.

failure to repond in any meaningful fashion noted.
You don't want a piece of me, so shove it. Because I WILL put you in your
place.
 
B

Brian

jacob said:
Le 16/09/10 08:06, Brian a écrit :
jacob navia wrote:
[snip]

You entire post and every "point" in it was a strawman.
Well, thanks for your very substantive contribution. It offers me the
possibility of refining certain points of my post.

Save it dude, for someone who gives a shit, I don't "vote".
 
B

Brian

Seebs said:
This post is misleading. By observing that he is lying, you imply
that this is a state people would have doubted. I think a more
accurate response would be to say "tea party has made a statement the
truth of which would matter to other people". We already know he's
lying; the difference is that normally he lies about things no one
cares about.
It's a good tangent thread: I suggest you all post under the same nick or
get out of dodge because there ain't no guns in Big Whiskey. The law has
come to town.
 
N

Nick Keighley

Nick said:
Nick Keighley wrote:
Nick Keighley wrote:
I've no idea what you are on about. If you have a specific
criticism of Jacob's post why not state it explicitly. Or are you
just trolling? [...]
I started to add some thoughts, but after a few responses I
realized he had an agenda
he probably does. So which bits of his post are wrong or refutable?
Like I said, the whole thing is so lame that it is not worth
responding to other than as a whole, which I already did.
failure to repond in any meaningful fashion noted.

You don't want a piece of me, so shove it. Because I WILL put you in your
place.

<giggle>
 
B

Brian

jacob said:
Le 16/09/10 23:50, Keith Thompson a écrit :

A language is REGULAR if there are simple rules that allow easy use of
features.

Rule:
Comments are comments and not program text. What is behind a comment
doesn't affect the code.

Exceptions:
If a comment ends with a backslash, it will swallow the next line.
If a comment has //???/ (or similar) the sequence ??/ can be
undesrtood as a trigraph \ and will provoke similar behavior.

All this is completely unnecessary BS.

You are funny. Well you would be if you weren't so old. The world
probably does owe you, but that's undefined behaviour.
 
B

Brian

Keith said:
I don't disagree, but I'm just not sure how to fix it.

Leaving trigraphs aside for the moment, there's a conflicting set of
rules:

Each physical line is a logical line, except that trailing backslashes
may be used to join two or more physical lines into a logical line.

The standard resolves this by doing line-splicing in phase 2 and
tokenization in phase 3. The result is unambiguous, but can lead to
some surpising results.

So how would you resolve this without breaking too much existing code?

Do you propose swapping phases 2 (line splicing) and 3
(tokenization)? That would cause backslashes within comments to
be ignored, but it would mean you couldn't have a line-splicing
backslash in the middle of a token. Older code commonly uses this to
splice long string literals; this is better done with concatenation
(handled in TP6), but breaking such code would have a real cost.

(And yes, I certainly would have done trigraphs differently, probably
leaving them disabled unless there's an explicit enabling sequence at
the beginning of a physical source file.)

Ken: and the world needs this? Why?
 
J

James Dow Allen

OO legacy code is very difficult to deal with due to acute lack of
modularity and the additional dependencies introduced by the frameworks
that OO code needs to get going. Since the frameworks lack in many cases
a formal API, the code using them becomes completely dependent of the
framework through inheritance...

Thank you for your comments, Jacob. It might be interesting to
read studies, since some people seem to conclude the opposite!
(But I suppose studies' conclusions are ... mixed!)
In C++ it's harder to shoot yourself in the foot, but when you do,
you blow off your whole leg.

This hardly seems an endorsement of C++.

The argument that C++ is "just" a superset of C, so harmless,
needs to be stamped out. Does anyone have a good quote to
ridicule the "just a superset" argument? Best I know is
Dennis Ritchie's:
Let me begin by saying that I'm not convinced that even the pre-December
qualifiers (`const' and `volatile') carry their weight; I suspect that
what they add to the cost of learning and using the language is not
repaid in greater expressiveness.

James Dow Allen
 
B

Ben Bacarisse

James Dow Allen said:
The argument that C++ is "just" a superset of C, so harmless,
needs to be stamped out. Does anyone have a good quote to
ridicule the "just a superset" argument? Best I know is
Dennis Ritchie's:

It helps to know the context. It is about a proposed language that
never was (a draft of C90) and inferring from it any option about const
is therefore questionable. (His opinion about volatile as it ended up
does seem to be conveyed by this quote.)

From the same paper at the end:

Const has two virtues: putting things in read-only memory, and
expressing interface restrictions. For example, saying

char *strchr(const char *s, int c);

is a reasonable way of expressing that the routine cannot change the
object referred to by its first argument. I think that minor changes
in wording preserve the virtues, yet eliminate the contradictions in
the current scheme.

So, const has virtues worth preserving -- his objections are about the
working in the draft. Also, the main force of the paper you quote is to
argue that "noalias" should go -- and it did.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,954
Messages
2,570,116
Members
46,704
Latest member
BernadineF

Latest Threads

Top