emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Elisp programming style
@ 2011-10-27 18:03 Thorsten
  2011-10-28 10:17 ` Štěpán Němec
  0 siblings, 1 reply; 14+ messages in thread
From: Thorsten @ 2011-10-27 18:03 UTC (permalink / raw)
  To: emacs-orgmode


Hi List, 
doing some Elisp programming (in an orgmode context) recently, the
following question with regards to the 'accepted programming style' for
Elisp concerned me:

How independent and self-sustained should helper functions be? 

I found some redundancy in elisp code, e.g. several (main and helper)
functions that do exactly the same thing to extract the same specific
args out of an argument list. My first reaction was, to factor out this
extraction into the main function, and then call the helper functions
from inside a (let ...) environment where the extracted args are stored
in a local variable.

But then I recognised, that the helper functions cannot be called
independently anymore, but only make sense when called from this one
main function with its local bindings.

Is there a kind of convention in a case like this? Like: "Make every function,
even a helper function, independent, and don't care about redundancy"?
Just being curious

cheers
-- 
Thorsten

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2011-10-29  7:44 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-27 18:03 Elisp programming style Thorsten
2011-10-28 10:17 ` Štěpán Němec
2011-10-28 14:09   ` Thorsten
2011-10-28 14:31     ` Nick Dokos
2011-10-28 15:59       ` Thorsten
2011-10-29  2:13       ` Eric Abrahamsen
2011-10-28 14:34     ` Tassilo Horn
2011-10-28 14:40       ` Eric Schulte
2011-10-28 16:04       ` Thorsten
2011-10-28 14:35     ` Eric Schulte
2011-10-28 15:52       ` Thorsten
2011-10-28 17:43     ` Tom Prince
2011-10-28 18:05       ` Thorsten
2011-10-29  7:43         ` Tassilo Horn

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).