But Ansible playbooks are not Python, nor do we assume folks will need to know Python.
Further, these are not statements, but parameters, which are *commonly* if not always placed on one line. On Mon, Aug 25, 2014 at 10:45 AM, Jeff Geerling <[email protected]> wrote: > > > On Monday, August 25, 2014 9:17:33 AM UTC-5, Michael DeHaan wrote: > > My feeling is, in this day of widescreen monitors and laptops, there's >> plenty of room in nearly all cases, and 79 character line wrap is obsolete. >> >> Making more concise playbooks makes them easier to read and skim, rather >> than things being several pages long. >> >> I do believe in significant use of whitespace between lines, giving every >> task a "name:" attribute, and things like that. >> > > There's plenty of room for argument there, though... I work primarily on > an 11 MacBook Air and a 9.7" iPad. At my desk, I will hook the Air up to a > 24" monitor, but I still have 3-5 windows on the display, and like being > able to stack at least two windows side-by-side, meaning I get a max of > maybe 120 characters comfortably. > > There's that (anecdotal evidence, of course), and the fact that most > languages discourage placing multiple statements on one line (Python's own PEP > 8 style guide <http://legacy.python.org/dev/peps/pep-0008/> states "*Compound > statements (multiple statements on the same line) are generally > discouraged.*", the Linux kernel coding style prohibits it > <https://www.kernel.org/doc/Documentation/CodingStyle>, ). > > There are other <http://stackoverflow.com/a/18525577/100134> good > <http://benalman.com/news/2012/05/multiple-var-statements-javascript/> > reasons, too: > > > - Easier to read, and less chance that future you/other developer > would glance over an important variable when debugging. > - Better for VCS, since each line diff is highlighted (and better > support in diffing software for line-by-line diff than intra-line diff > highlighting). > - Less error-prone, and easier to maintain (need to nix a param just > dd/Ctrl-K the line and that param is gone). > > This argument is more philosophical than practical in some ways, but in my > experience, splitting things to multiple lines and breaking up task lists > into short playbooks (usually < 100 lines per playbook) makes it easier for > me to jump back into something I haven't touched in months and debug/rework > it, and for me to be able to see differences more easily in GitHub PRs. > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/a7382aeb-9099-48f8-885d-9c32bce5490b%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/a7382aeb-9099-48f8-885d-9c32bce5490b%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgwX5EGaPbqL2Ss4TeAxBn3Qm_rLCAnXpbJbtt_0zHWVQA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
