darcs

Patch 1613 refactored show repo command

Title refactored show repo command
Superseder Nosy List bfrk
Related Issues
Status accepted Assigned To
Milestone

Created on 2017-10-10.10:35:29 by bfrk, last changed 2017-10-11.08:44:37 by bfrk.

Files
File name Status Uploaded Type Edit Remove
refactored-show-repo-command.dpatch bfrk, 2017-10-10.10:35:28 application/x-darcs-patch
See mailing list archives for discussion on individual patches.
Messages
msg19718 (view) Author: bfrk Date: 2017-10-10.10:35:28
1 patch for repository bf@hub.darcs.net:darcs-current:

patch 2999050c2cb0539cc3035e8f40729bb74e81df5a
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Sep 29 08:13:36 CEST 2017
  * refactored show repo command
Attachments
msg19728 (view) Author: gh Date: 2017-10-10.17:09:57
We save a few lines with this one and the output remains the same. 
Accepted.
msg19732 (view) Author: bfrk Date: 2017-10-11.08:44:36
My motivation for such changes is not so much to save lines of code
(though this is usually a beneficial side-effect), but to improve code
readability by exposing the patterns and factoring them into (re-usable)
functions. That we can do this sort of refactoring easily is the
milestone of functional programming, IMO.

In this case I added a small, generally usable function that captures
the pattern of what goes on (showing a list of items on one line,
separated with comma and space) and gave it a name that reflects what it
does. Using this function made two narrow, specialized procedures so
trivial that it made sense to inline them at their call site.
History
Date User Action Args
2017-10-10 10:35:29bfrkcreate
2017-10-10 17:09:57ghsetstatus: needs-screening -> accepted
messages: + msg19728
2017-10-11 08:44:37bfrksetmessages: + msg19732