Re: Use (f)puts instead of (f)printf when possible.
Sam Steingold <[email protected]>
| Newsgroups | gmane.lisp.clisp.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Bruno, > * Bruno Haible <[email protected]> [2017-09-10 16:20:26 +0200]: > >> > #define fprint(fp,string) fputs(string,fp) >> > #define print(string) fputs(string,stdout) >> >> I don't like this for 2 reasons: >> >> 2. I prefer names that are not substrings of other names for the sake of >> grepping convenience. E.g., I would use `cprint` instead of `fprint' and >> `cputs` instead of `print` ("c" stands for CLISP &c) > > You can use the grep option '-w' to search for 'print' only: > $ grep -w print *.d > $ grep -w 'print *(' *.d Yes, I can also use regexps and tag-search in emacs. This is not the point. The point is not "impossible". The point is "I need to make an extra effort". "Write" (code) is done once. "Read" is done many times. Replacing "print" with, e.g., "cprint" is done _once_ by _one_ person. The benefits are reaped _every_ time _anyone_ is reading the code. Thanks. -- Sam Steingold (http://sds.podval.org/) on darwin Ns 10.3.1504 http://steingoldpsychology.com http://www.childpsy.net http://camera.org http://americancensorship.org http://www.memritv.org http://www.dhimmitude.org Nostalgia isn't what it used to be. ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ clisp-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/clisp-devel