From: tedd on
At 12:32 PM -0400 4/14/10, Robert Cummings wrote:
>tedd wrote:
>>My "logic" works the other way -- when presented with a logic
>>problem, I come up with a solution that works the way I think and I
>>always to solve the problem presented. Perhaps my solution isn't as
>>clever nor as cryptic as others, but it's always easier to read and
>>understand.
>
>Maybe you haven't debugged enough "other people" code in your time
>as a developer... there's a certain knack to weeding out logic
>failures :)

That could very well be. I don't usually debug other people's code
and seldom have clients want me to do so. I usually have clients who
present a problem and then I solve it -- thus, all original code.

Several yeas ago, I had one client who had considerable prior work
done and I found myself rewriting everything at a cost of many weeks
of my non-billable time. I won't be doing that again.

>It also helps to use proper indentation and bracing format as
>illustrated by all my code examples so that you can more easily see
>where problems lie >:D
>
>Cheers,
>Rob.

Ain't that the truth!

We are almost identical in our formatting.

I've found that when I run into someone who has similar ideas as I
have, they are usually very intelligent. :-)

Cheers,

tedd

--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
From: Al on


On 4/14/2010 12:28 PM, tedd wrote:
> At 5:06 PM -0400 4/13/10, Robert Cummings wrote:
>> Nathan Rixham wrote:
>>>
>>> well that's one job I'm not getting :p
>>
>> Well you DID get 66.7%. I've met "coders" that would stare at the
>> answer and still not understand :D
>>
>> Cheers,
>> Rob.
>
> Well.. count me among those staring. I just don't get those type of
> things until I see them actually work.
>
> My "logic" works the other way -- when presented with a logic problem, I
> come up with a solution that works the way I think and I always to solve
> the problem presented. Perhaps my solution isn't as clever nor as
> cryptic as others, but it's always easier to read and understand.
>
> Cheers,
>
> tedd

I'm with you Tedd. I'm forever cussing myself when I use a super clever trick to
solve a logic problem and then later can't figure out how the damn thing worked
even though I documented it.

Incidentally, about formatting scripts, one of the reasons I like phpEdit is
that it has a terrific code beautifier. You can set it for phpDoc or Pear
rendering. And, it auto indents, etc. as you enter stuff.

Al...........
From: Paul M Foster on
On Wed, Apr 14, 2010 at 12:28:13PM -0400, tedd wrote:

> At 5:06 PM -0400 4/13/10, Robert Cummings wrote:
>> Nathan Rixham wrote:
>>>
>>> well that's one job I'm not getting :p
>>
>> Well you DID get 66.7%. I've met "coders" that would stare at the
>> answer and still not understand :D
>>
>> Cheers,
>> Rob.
>
> Well.. count me among those staring. I just don't get those type of
> things until I see them actually work.
>
> My "logic" works the other way -- when presented with a logic
> problem, I come up with a solution that works the way I think and I
> always to solve the problem presented. Perhaps my solution isn't as
> clever nor as cryptic as others, but it's always easier to read and
> understand.

+1

I've never had other coders looking over my shoulder, and I agonized for
years over whether my logical solutions were the "best" approach. Now I
just code and take pride in the fact that I can understand what I did
later (mostly).

Paul

--
Paul M. Foster
From: Ashley Sheridan on
On Wed, 2010-04-14 at 16:52 -0400, Paul M Foster wrote:

> On Wed, Apr 14, 2010 at 12:28:13PM -0400, tedd wrote:
>
> > At 5:06 PM -0400 4/13/10, Robert Cummings wrote:
> >> Nathan Rixham wrote:
> >>>
> >>> well that's one job I'm not getting :p
> >>
> >> Well you DID get 66.7%. I've met "coders" that would stare at the
> >> answer and still not understand :D
> >>
> >> Cheers,
> >> Rob.
> >
> > Well.. count me among those staring. I just don't get those type of
> > things until I see them actually work.
> >
> > My "logic" works the other way -- when presented with a logic
> > problem, I come up with a solution that works the way I think and I
> > always to solve the problem presented. Perhaps my solution isn't as
> > clever nor as cryptic as others, but it's always easier to read and
> > understand.
>
> +1
>
> I've never had other coders looking over my shoulder, and I agonized for
> years over whether my logical solutions were the "best" approach. Now I
> just code and take pride in the fact that I can understand what I did
> later (mostly).
>
> Paul
>
> --
> Paul M. Foster
>


I think as long as the code is readable, and doesn't have any glaringly
obvious issues (I've seen people re-writing built in PHP functionality
because they didn't know the built-in function existed) then it should
be OK. Add comments to aid any areas where you think you might forget or
other people might not easily understand what is happening.

Don't get me wrong, clever ideas are nice, and sometimes with the right
comment they just work beautifully. Just occassionally though something
is done in such a neat clever way, that in the future when it comes time
to extend the system, this neat clever idea is actually a hindrance and
causes extra work because it has to be re-written a 'less-clever' but
more flexible way!

Thanks,
Ash
http://www.ashleysheridan.co.uk


From: Paul M Foster on
On Wed, Apr 14, 2010 at 10:06:39PM +0100, Ashley Sheridan wrote:

> On Wed, 2010-04-14 at 16:52 -0400, Paul M Foster wrote:

<snip>

>
>
> I've never had other coders looking over my shoulder, and I agonized for
> years over whether my logical solutions were the "best"
> approach. Now I
> just code and take pride in the fact that I can understand what I did
> later (mostly).
>
> Paul
>
> --
> Paul M. Foster
>
>
>
> I think as long as the code is readable, and doesn't have any glaringly obvious
> issues (I've seen people re-writing built in PHP functionality because they
> didn't know the built-in function existed) then it should be OK. Add comments
> to aid any areas where you think you might forget or other people might not
> easily understand what is happening.
>
> Don't get me wrong, clever ideas are nice, and sometimes with the right comment
> they just work beautifully. Just occassionally though something is done in such
> a neat clever way, that in the future when it comes time to extend the system,
> this neat clever idea is actually a hindrance and causes extra work because it
> has to be re-written a 'less-clever' but more flexible way!

That reminds me of a story. I once wrote what was almost an RPG (RPG--
the language, not the game) interpeter under FoxPro to handle incoming
EDI traffic and update invoicing, etc. The big problem with EDI is that
no one follows the standards properly, so every vendor tendering an
invoice did it differently. So you needed a database driven system which
would selectively make decisions based on each line of incoming EDI
content. Worked great, and when a new vendor came along, you just
analyzed their transactions and populated some more records in the
database to handle that vendor's transactions. I know, it sounds
obscure, but it made perfect sense at the time.

Shortly after that, I left that company. I documented the system, and it
worked fine, but it was hard to wrap your wits around how it worked. And
I just know the next coder on that account was cursing me day and night
for writing that system.

Anyway...

Paul

--
Paul M. Foster