Re: Problem with a script
- From: Tim Streater <tim.streater@xxxxxxxxxxxx>
- Date: Thu, 12 Apr 2007 17:38:15 +0100
In article <evll5o$ont$1@xxxxxxxxxxxxxxxxxx>,
Rami Elomaa <rami.elomaa@xxxxxxxxx> wrote:
[snip]
You still have them as uniquely named array indexes... (indices? whatever.)
I believe that for the new guy this code would be readable, and
identifying problems should really not be any more difficult with this,
plus I think that it actually might save some time to write the actual
code from the beginnig, even though it's not at it's final stage,
instead of first writing everything spread out, and then rewriting the
same code again cleaned. If anything, writing the code twice will only
introduce new bugs which still would need to be detected.
I agree it's very important to code clearly for those who will follow
and probably maintain the code. The idea of making a working but messy
version I find bizarre - probably the OP is much cleverer than me. I
could never work this way; I prefer to take the time to construct the
final version.
However, my original intent was not to concentrate on the bad code, err,
your personal style of writing test code, but to draw your attention to
the fact that there was so much of it. When you write to a forum such as
this, requesting for help, do concider trimming the code to a very very
short piece where the problem is shown. If you post several hundreds of
lines of code, who's gonna start reading it all?
Not me that's for damn sure.
Most just take a glimpse at it and think "spaghetti!" and ignore it.
Just what I did.
Had you isolated the
problem to less than 20 lines, people might've actually paid attention
to it and been able to help you with it. You see, people in c.l.php have
the patience of an adhd child high on sugar. If the problem isn't solved
within 10 seconds, it's ignored. If you expect a person to spend an hour
reading your entire code and parsing it in their head, you wont get any
help and have to solve the problem by yourself.
Yep, that's it. You have to capture people's interest with your post.
And there was no evidence that the OP had spent any time doing his own
debugging and reducing the (as far as I could tell unspecified) problem
to a short piece of code.
I'm sure you have your own style of coding and after reading your
explanation you've convinced me that you may not actually be entirely
rookie in coding. The difficlty seems to be that you've not yet grasped
the fine skill of posting a question to usenet. I wouldn't want to think
that this was all waste of both of our time, so I'll try to learn the
lesson here and not judge people and their code so harshly, if you'll
consider sending shorter piece of sample code the next time you post,
agreed? :)
A final word on refusing to use loops is an educating story on Worse
Than Failure (formerly known as The Daily WTF) that you might want to
read: http://worsethanfailure.com/Articles/Checking_Your_Digits.aspx
Ouch.
-- tim
.
- References:
- Problem with a script
- From: Jerim79
- Re: Problem with a script
- From: Schraalhans Keukenmeester
- Re: Problem with a script
- From: Jerim79
- Re: Problem with a script
- From: Rami Elomaa
- Problem with a script
- Prev by Date: Re: rotate text
- Next by Date: Re: $i = $i++
- Previous by thread: Re: Problem with a script
- Next by thread: Re: Problem with a script
- Index(es):
Relevant Pages
|
|