[PD-dev] Refactoring Pure Data (2 of 2)

Mathieu Bouchard matju at artengine.ca
Wed Sep 13 03:17:30 CEST 2006


On Wed, 13 Sep 2006, Vincent Lordier wrote:

>> You didn't replace the fprintfs by posts. It should be posts because then
>> it can be routed through the GUI.
> True.

Actually, they should be calls to error() or to pd_error(). The latter 
should be used when there's an object associated with the error, so that 
the GUI may find that error. Warnings should just go through post() as it 
is now.

> Why not ? the engine, if running on a remote machine should also be able 
> to send messages to the user in its language...

This doesn't work if there are several clients connected to the server, 
who want error messages in different languages.

>> - Safe fprintf can be used to avoid overflow.
>> Which overflow?
> see snprintf

Ah. But there wasn't any sprintf in your example, and I don't remember 
seeing error messages generated by calling sprintf directly.

>> > An explicit name saves the dev brain power at coding time ;)
>> I assert that often it doesn't. A name shouldn't be more explicit than it
>> needs to be,
> Quote from Wikipedia on software quality
> => http://www.gnu.org/prep/standards/standards.html#Names

yes, according to that page, "Local variable names can be shorter, because 
they are used only within one context". So, what's your point?

> => http://en.wikipedia.org/wiki/Hrair_limit

Exactly: if it's too long, one identifier may occupy the mind more than it 
could, and thus it isn't really optimal.

> => http://www.coding-guidelines.com/cbook/sent787.pdf

That's a big document. If you want to show this to me you better find a 
page number in particular.

> => http://www.aivosto.com/project/help/pm-understandability.html

This one assumes that its code metrics do more revealing than hiding. I 
don't believe one can assess the value of identifiers in a program without 
first reading the program. What's important about identifiers is not 
their length, it's how valuable they are.

  _ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju
| Freelance Digital Arts Engineer, Montréal QC Canada


More information about the Pd-dev mailing list