in reply to Re: Optional quotes: to use or not to
in thread Optional quotes: to use or not to

Visually distinct from other stuff, syntax highlight treats quoted values differently -> easier to recognize if something looks strange.

Well, this depends on IDE you are using

  • Comment on Re^2: Optional quotes: to use or not to

Replies are listed 'Best First'.
Re^3: Optional quotes: to use or not to
by Monk::Thomas (Friar) on Jul 10, 2015 at 11:41 UTC
    Well..
    $example{time} = time;

    Does your IDE get that right? What exactly is 'right'?

      Mine does. Braced time is a string and other time is a sub. And even:

      grep {time} @somearray;
      Understood right and time is a sub.

        Sorry, wrong example. (I'm intentionally leaving strict off here. Enabling it would spoil the fun.) Is your IDE smart enough to catch the difference?
        #!/usr/bin/perl my %example; $example{foo} = say; print $example{foo}, "\n";
        ->> 'say'
        #!/usr/bin/perl use 5.010; my %example; $example{foo} = say; print $example{foo}, "\n";
        ->> '1'
Re^3: Optional quotes: to use or not to
by Monk::Thomas (Friar) on Jul 10, 2015 at 14:47 UTC

    I'm returning to this post because the other one's have strayed off. Sorry about that.

    What I originally meant to say is, that I like string values to be shown in exactly the same way wherever they are located. If I use quotes to denote them then this is guaranteed.

    You were asking about a team and that means it's possible the members are using different IDE's / editors. If the coding convention makes it easier to look over one's shoulder and see roughly the same patterns in syntax-highlighted code then that's a win in my book. (It doesn't really matter what the actual colors are, the pattern is important.)