[PATCH 10/10] Remove unused functions.

Thorsten Wißmann edu at thorsten-wissmann.de
Wed Feb 5 15:35:03 CET 2014


On Wed, Feb 05, 2014 at 02:50:39PM +0100, Simon Ruderich wrote:
> On Tue, Feb 04, 2014 at 02:08:42PM +0100, Thorsten Wißmann wrote:
> > I read about your intention of increasing the maintainability. But I see
> > most of these function as a library (A library won't delete a function
> > f() if the maintainers guess no application uses it).
> 
> Well, hlwm is no library so changing the API is not a problem.

It was not about changing the library. I wanted to describe the order in
which I write code: Normally I create a struct with it's operations
(like objects, monitors, settings...) and then I use it and call some of
these operations. And some of the operations aren't used but when
writing the "library"="object"={struct + operations on it} I found them
being usefull and added them.

> I just noticed that those functions were unused at the moment and
> thought unused code doesn't have to be kept around.
> 
> > For example, I will need..
> >
> >   - monitor_with_coordinate to implement monitor focussing with
> >     focus_follows_mouse being enabled.
> >   - monitor_with_frame for the same feature if hlwm receives a click event
> >     on a frame window.
> >   - hsobject_link_rename_object to rename a object, e.g. I could use it
> >     for renaming tag/monitor objects in the future.
> 
> But in this case, just keep them or drop only those which won't
> be useful in the near future.

Looks like a reasonable compromise.

> > It might be that we don't need the other functions anymore. Do you
> > really think we should remove them?
> 
> If they are not used I see no reason to keep them. If they become
> useful in the future, the commit can always be reverted.

Technically yes, realistically no: If somebody writes code and uses some
structs from a certain header file, he looks at the header file to get a
list of operations working on that struct. If the operation he's looking
for is not there, he will write it from scratch but he surely won't
browse the git history looking for an appropriate function which could
be brought back to the code base.

Cheers,
Thorsten
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 230 bytes
Desc: not available
URL: <https://listi.jpberlin.de/pipermail/hlwm/attachments/20140205/38e8232d/attachment.sig>


More information about the hlwm mailing list