[sane-devel] scanimage frontend

Povilas Kanapickas povilas at radix.lt
Tue Apr 26 22:24:31 BST 2022


Hi,

On 2022-04-26 17:11, James Ring wrote:
> Hi all,
> 
> Would there be any objection if I did some work on tidying up the
> scanimage frontend implementation? Currently, there are some deeply
> nested parts of the scanning code interspersed with ifdefs that make
> it pretty hard to follow.

Agreed, any such improvements are welcome.

> More controversial question, what about writing some parts of it in
> C++? Applied judiciously, it could make the code easier to maintain.
> My plan would be to use a small subset of C++ (no exceptions, for
> example).

That would be great.

I suggest to start with the C++ migration first, because it's easy to
introduce leaks and similar problems when refactoring C code.

Also, I suggest to split the changes into as many commits as reasonably
possible.  Large refactoring is likely to introduce regressions. When
there are many commits it's possible to quickly bisect the problem.
Having 10 line change in front of the eyes and knowledge that the source
of the problem is exactly there makes it much easier to quickly address
issues.

Cheers,
Povilas




More information about the sane-devel mailing list