Re: [Q] Cleaning string whitespace trimming. Does it make any sense?

walter harms
2012-06-13T07:23:44Z

Am 13.06.2012 00:03, schrieb Ezequiel Garcia:
> On Tue, Jun 12, 2012 at 5:58 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
>> Actually, on second thought strim() already does what we want. Just
>> ignore the return value.
>>
>
> But it could make sense to fix such redundant code?
>
> I'm unsure what git tree should I base the patches, given
> I'd be touching all over the place. Perhaps linux-next?
>

Hi Ezequiel,
as rule-of-the-thumb: just do it.

Convenience functions like trim() are added add irregular intervals because
they appear only if someone spots a pattern that he things is worth the effort.
Older Code does not know about it, so changes are required through the whole
code (look at patches from Julia Lawall, she has developed a tool to spot pattern).

How does it look from a maintainers perspective ?
1. He can remove a function from your code and reduce what you have to maintain -> good
2. He has a special need and need its own code -> but at least you know about it now :)

in short: you can make nothing wrong

re,
wh