Re: Conscious antipattern behavior

From: Bob Hairgrove (wouldnt_you_like_at_to_know.com)
Date: 01/11/04


Date: Sun, 11 Jan 2004 11:33:28 GMT

On Sun, 11 Jan 2004 10:13:43 GMT, "Ray Gardener"
<rayg@daylongraphics.com> wrote:

>I've always wondered what other C++ programmers
>fail to do while coding even though they know
>what they're doing is... naughty (and some of the
>items below occur in other languages, of course).
>
>People make these slip-ups all the time accidentally,
>but what I'm getting at is when we make them while
>we consciously _know_ that we're being bad. This is
>the more interesting phenomenon because I tend to
>interpret consciously "fighting the language" or
>consciously "not using the language as intended"
>as an indication that the language or the
>development environment could be improved.
>
>(Granted, in C++ the "right way" is vague because
>C/C++ has broad expressive capability, but there
>are informal standards of good coding practice
>that we all more or less know).
>
>
>Examples:

[snipped]

>Obviously some of the above are rational tactical
>decisions under certain situations, so I'm not
>including those combinations of choice and context.
>
>I'm interested in finding out what poor choices
>C++ programmers consciously make and why. Was it
>easier at the time? More expedient? Force of habit?
>Does the dev environment foster those habits
>(e.g., an editor with great copy/paste might
>actually be bad)? Is good coding a matter of
>willpower or do certain tools turn the tide?
>Does extreme or paired-up programming help
>combat these tendencies? Is perfect discipline
>even desirable?
>
>Ray

Some programmers just plain don't know any better. Then there are
those who don't want to know any better because they have gotten away
with their stuff for years and nobody ever said anything. Then there
are those who know better, but have such ingrained bad habits that the
attempt to adhere to any kind of programming guidelines totally
paralyzes them and they can't get any work done as a result. Then
there are those who would like to change their ways, but management
won't let them for various reasons.

For some companies, in-house software development is only a necessary
evil (or at least treated as such). There is absolutely no budget for
refactoring unless the customer is at the door screaming. Nothing is
allocated money-wise that cannot be billed on a basis of man-hours to
a paying customer. If something works, or seems to work OK, it is sent
into production with a minimum of testing (usually most of the testing
is done by the developer, or there might be some integration tests
with such a limited amount of data that no bugs ever show up before
sending the thing to the customers). Deadlines are totally unrealistic
and are usually not met if the developers try to do any proper design
instead of just ripping out bits and pieces of other software, use 3rd
party components which seem to "do the job" without regard to later
portability or extensibility, etc. etc.

In such an environment, there is very often no code review. Developers
think they are the only ones who will ever have to maintain their own
code, especially if the project has a short life cycle due to other
concerns. Since nothing gets reused, no effort is made to make a good
design. Under these circumstances, copying and pasting often seems to
be the quickest way of implementing "code reuse".

Most of your examples are very good ones. Templates and other advanced
language features, however, were not supported adequately by a lot of
compilers until just recently, so lots of experienced developers avoid
them. As a result, they have no experience using templates and often
don't have the time (or aren't given time) for additional courses so
they can learn how to use them.

Just my 2 cents ...

--
Bob Hairgrove
NoSpamPlease@Home.com


Relevant Pages

  • Re: Tool to mark code which has been executed
    ... a external party where all coders are C# coders ... They are all VB6 developers and management ... why move them to another language. ... VB6 program while we're doing the VB.NET upgrade. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Whidbey - Why is refactoring not in VB.NET?
    ... You basic point is that one should pick the language which one is most ... of the advance features. ... Refactoring is one very important thing. ... VB.NET made us professional developers, using OO Programming, UML, ...
    (microsoft.public.vsnet.general)
  • Re: Tool to mark code which has been executed
    ... a external party where all coders are C# coders ... They are all VB6 developers and management ... why move them to another language. ... Coders who come from Java, C, C++ or anny other curly brace language feel ...
    (microsoft.public.dotnet.languages.vb)
  • Re: When will M$ dump support for ASP?
    ... Intranet or Extranet and not even all Internet. ... Since when do most developers only know one language? ... - .NET does not support VBScript, so former VBScript ASP developers must ...
    (microsoft.public.inetserver.asp.general)
  • Re: Tool to mark code which has been executed
    ... a external party where all coders are C# coders ... They are all VB6 developers and management ... why move them to another language. ... VB6 program while we're doing the VB.NET upgrade. ...
    (microsoft.public.dotnet.languages.vb)