Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-9230

Parentheses: omit or not?

    XMLWordPrintableJSON

Details

    • Documentation
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • None
    • None
    • syntax
    • None

    Description

      The Groovy Style Guide mentions that parentheses can be omitted (not always, I know). And that's it. I think the primary purpose of a style guide is to define a good set of recommendations for coding practices, rather than list all the available options. (Because that's like good old Perl: you can write the same thing in so many ways, since the syntax is so lenient, which then practically doomed the language.) So the style guide that is supposed to give us answers, is still leaving us with questions right now.

      I would like to know what you recommend: should we omit parentheses or not? I am really puzzled, because:

      But this still puzzles me.

      • Are missing parentheses really that hard to read? If someone with no programming skills can read statements without them better, than how come the opposite is true for an advanced programmer?
      • Should the no-parentheses style be suggested only for DSLs? That would include Gradle too, right?

      Thanks in advance.

      Attachments

        Activity

          People

            Unassigned Unassigned
            rkrisztian rkrisztian
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: