From: Thomas Andersson on
wolf wrote:

> these are all valid arguments to improving the code :)
>
> However, since the original poster didn't even know how to wield
> SPLIT, i wanted to keep it as simple and un-confusing as possible,
> demonstrating just SPLIT as the important thing to handle.
> As such the code works well enough :p

Thanks, I'm not just looking for solutions but to learn as well so the
simple solutions is best, the fancy stuff I can do later.


From: Sherm Pendley on
"Thomas Andersson" <thomas(a)tifozi.net> writes:

> wolf wrote:
>
>> these are all valid arguments to improving the code :)
>>
>> However, since the original poster didn't even know how to wield
>> SPLIT, i wanted to keep it as simple and un-confusing as possible,
>> demonstrating just SPLIT as the important thing to handle.
>> As such the code works well enough :p
>
> Thanks, I'm not just looking for solutions but to learn as well so the
> simple solutions is best, the fancy stuff I can do later.

You should take sln's suggestions with a grain of salt. He does appear
to know his way around regexes, but he's got that regex hammer in his
hand and wants every problem to be a nail - even when it's clearly not.

Also keep in mind that "fancy" solutions are rarely the best. I've heard
it said that debugging is twice as difficult as writing code, and that
being the case, code that's written to the limit of one's abilities is
by definition impossible to debug. In all but the most extreme cases,
clarity and ease of maintenance are *far* more valuable over the long
run than clever tricks.

sherm--

--
Sherm Pendley <www.shermpendley.com>
<www.camelbones.org>
Cocoa Developer
From: Tad McClellan on
Sherm Pendley <sherm.pendley(a)gmail.com> wrote:

> I've heard
> it said that debugging is twice as difficult as writing code, and that
> being the case, code that's written to the limit of one's abilities is
> by definition impossible to debug.


Everyone knows that debugging is twice as hard as writing a program in
the first place. So if you are as clever as you can be when you write
it, how will you ever debug it? ~Brian Kernighan


That Kernighan guy has a bit of a reputation amongst programmer types. :-)


--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
The above message is a Usenet post.
I don't recall having given anyone permission to use it on a Web site.
From: Sherm Pendley on
Tad McClellan <tadmc(a)seesig.invalid> writes:

> Sherm Pendley <sherm.pendley(a)gmail.com> wrote:
>
>> I've heard
>> it said that debugging is twice as difficult as writing code, and that
>> being the case, code that's written to the limit of one's abilities is
>> by definition impossible to debug.
>
> Everyone knows that debugging is twice as hard as writing a program in
> the first place. So if you are as clever as you can be when you write
> it, how will you ever debug it? ~Brian Kernighan
>
> That Kernighan guy has a bit of a reputation amongst programmer types. :-)

Aha, yes! That's the quote I was thinking of. Thanks for filling in the
citation - that would have bugged me until I found it. :-)

sherm--

--
Sherm Pendley <www.shermpendley.com>
<www.camelbones.org>
Cocoa Developer
From: Uri Guttman on
>>>>> "TM" == Tad McClellan <tadmc(a)seesig.invalid> writes:

TM> Sherm Pendley <sherm.pendley(a)gmail.com> wrote:
>> I've heard
>> it said that debugging is twice as difficult as writing code, and that
>> being the case, code that's written to the limit of one's abilities is
>> by definition impossible to debug.


TM> Everyone knows that debugging is twice as hard as writing a program in
TM> the first place. So if you are as clever as you can be when you write
TM> it, how will you ever debug it? ~Brian Kernighan


TM> That Kernighan guy has a bit of a reputation amongst programmer types. :-)

is twice as hard the same as twice the duration? i find i have a very
different ratio of development time to debug time than many coders. i
break it up into three periods and mine are roughly 40% design (much in
my head), 40% coding and 20% debugging. and much of the debugging is
very easy stuff (at least to me). my take on the general coder
population is like 10% design (if that much), 40% coding and 50%
debugging. well it seems like that from what i see and hear. debugging
should be easy IMO if you design the code right. a given bug should be
quickly isolated to the area that handles that part of data. this brings
up the design philosophy of high isolation of modules. again, few adhere
to that idea so they have many places which could cause a given bug
thereby making debugging harder. i don't use a debugger, IDE or anything
but print and i get working code without pain. brains over typing! :)

uri

--
Uri Guttman ------ uri(a)stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------