Code cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I just had a look at the code of some of the plug-ins and I noticed that
there is often lot's of room for improvement:

1) some constructions are plain clumsy, for example somewhere I saw:

	for (k = 0; k < bytes; k++) destline++;

instead of simply: 

	destline += bytes;

2) a lot of functionality has been added since the last update of some
of the plug-ins. Result: duplicate functionality

3) sometimes it's just lack of C knowledge:

	if (p)
	   free(p);

can be simply replaced by just: 

	free(p);

No need for the test, unless performance is really critical and we
expect to free a lot of NULL pointers.

4) some plugins have obvious memory leaks.


So my question: is it worth the effort to carefully go through all the
code (not only plug-ins) and clean things up?

Advantages:

1) source code becomes smaller. Not a big deal with Gb harddisks, but
nice for future maintenance.

2) object code becomes smaller. My initial estimate that for example
most plug-ins can be easily reduced with 10 a 20 % without much effort.

3) during the process we might find further bugs.

Disadvantages:

1) this will cost time/effort (I am willing to make my contribution).

2) we might break things that work

3) we don't spend time on other fun things liking adding functionality.


Any thoughts/comments?


[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux