You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by br...@tariffenet.it on 2005/02/25 09:41:20 UTC

[OT] Bad programming experiences

I'd like to share with you a small experience with bad programming
practices I had just yesterday.
I made a Struts-based application a while ago, when my experience with
J2EE application was at its beginning. I wrote a "Business Delegate" (the
quotes are intentional) that had an HttpServletRequest and ActionForms in
its parameters, therefore it had a tight connection to Struts. I was
thinking it was the fastest solution to write code.
After a while (about 6 months) when my experience was greater, I wrote
another business delegate (a real one this time) with no reference to
Struts and servlets at all, thinking it will be useful in the future.
Yesterday I had to modify a classic (i.e. with a GUI) application that
needed those business delegates wrote before. As you may realize, I had no
problem with the second one, but with the first one... I am still
modifying the "wrong" business delegate (and consequently all the calling
code).
Conclusion: beware of bad programming practices. You may think that
writing code in a certain "faster" way will consume less time. But when
you need to change something or reuse code, you will see that using design
patterns and other nice things will make you happier later :-P
Ciao
Antonio Petrelli


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [OT] Bad programming experiences

Posted by Andrew Hill <an...@gridnode.com>.
I dunno mate. The usual technique in the industry would seem to be some 
variant of the following:

Write junk
Go home on time (actually get to see family occasionally!)
Leave for better job letting someone else cleanup mess
Repeat as necessary

(Health department warning: If repeated excessively can result in a 
managerial position thus exposing one to danger of sunlight & flying 
golfballs on weekends...)

Lets face it, those of us who actually try to do things right will just 
get labelled as 'perfectionists' and not 'people who get things done', 
and the time we have to spend wading through the code the got-doners 
left so we can add feature Y makes us look like a hopeless bottleneck 
when compared to how quickly they got the original feature X working...


brenmcguire@tariffenet.it wrote:
> I'd like to share with you a small experience with bad programming
> practices I had just yesterday.
> I made a Struts-based application a while ago, when my experience with
> J2EE application was at its beginning. I wrote a "Business Delegate" (the
> quotes are intentional) that had an HttpServletRequest and ActionForms in
> its parameters, therefore it had a tight connection to Struts. I was
> thinking it was the fastest solution to write code.
> After a while (about 6 months) when my experience was greater, I wrote
> another business delegate (a real one this time) with no reference to
> Struts and servlets at all, thinking it will be useful in the future.
> Yesterday I had to modify a classic (i.e. with a GUI) application that
> needed those business delegates wrote before. As you may realize, I had no
> problem with the second one, but with the first one... I am still
> modifying the "wrong" business delegate (and consequently all the calling
> code).
> Conclusion: beware of bad programming practices. You may think that
> writing code in a certain "faster" way will consume less time. But when
> you need to change something or reuse code, you will see that using design
> patterns and other nice things will make you happier later :-P
> Ciao
> Antonio Petrelli
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org