1. 5
  1.  

  2. 7

    I put those (reportedly useless) quotes in there for 1 reason myself: consistency. If I happen to need to quote one of the values because it contains a space, why aren’t all other values of the same nature quoted too?

    If all computer languages I know of use quotes to delimit the beginning and ending of string values, why should the space implicitly mark the ending of a string?

    Somewhat related: I use “useless” quotes in YAML too, for the same reason, why should the newline character mark the ending of a string when we’ve had quotes for decades?

    1. 0

      Right. Why should the newline character mark the ending of a statement when we’ve had parentheses for more than half a century?

    2. 5

      Rants are usually bad opinions expressed angrily, to give them a veneer of seriousness / quality they wouldn’t otherwise have. Affective override is a powerful thing.

      1. Claims about readability are almost always done without evidence, and for any one person’s view on what is readable, you can certainly find someone who believes with the same conviction the exact opposite thing. If you can bring evidence (not arguments), then sure, make your case. Otherwise, arguments toward readability ought to be in the garbage bin.
      2. Not using quotation marks may work in certain contexts, but it’s less future-proof. It’s the string version of Apple’s GOTO FAIL bug, where a lack of braces around a block led to an unintentional unconditional jump. If you need to add a class to an HTML element in the future, then you’d need to add quotes, and if you forget, then it will likely be silently interpreted as a valueless attribute, and may cause future problems.
      1. 2

        I can also see problems happening when an unquoted property is later replaced by a variable. If the variable contains spaces, there’s suddenly a problem. Of course, whoever added the variable should have checked that, but having quotes everywhere makes things more consistent and safer, and avoid having to think all the time whether there should be quotes here or not.

        1. 1

          Sure, in a shell language I assume you mean. Defensive programming is a mindset not everyone adopts, and the choices here would be suboptimal as defensive choices. You’re right in identifying another case of this.

      2. 4

        I wonder if the author also knows all the C precedence rules and yells if anyone uses unnecessary parenthesis.