You are here: Re: Problem with a script « PHP Programming Language « IT news, forums, messages
Re: Problem with a script

Posted by Tim Streater on 04/12/07 16:38

In article <evll5o$ont$1@nyytiset.pp.htv.fi>,
Rami Elomaa <rami.elomaa@gmail.com> 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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация