Opened 5 years ago

Last modified 4 years ago

#769 new enhancement

disallow variables that differ only in sigils

Reported by: szabgab Owned by:
Priority: major Milestone:
Component: editor Version: 0.50
Keywords: usability Cc:

Description

In beginner mode disallow $x if @x is already in use.

Idea from gaal in a comment
http://blog.woobling.org/2009/11/restricted-perl.html

Before implementing, please check if there is no Perl::Critic rule for this!

Change History (2)

comment:1 Changed 4 years ago by zenogantner

  • Keywords usability added

#413 suggests it is better not having a beginner mode.

And this is such a case: There is actually nothing wrong with having $x and @x in Perl.
Why "punish" a beginner that already knows this?

comment:2 Changed 4 years ago by szabgab

At one point the beginner mode will be integrated with Perl critic and it will be just a set of configuration that is stricter than many seasones Perl developers would want to work. They will be able to turn off/change the individual options.

This is the same with a lot of other cases where valid Perl code can trip beginners.

if($x = /reg/) {
}

being another one.

In addition if someone already knows that there can be both @x and $x they should also already know that it is not nice to use them as they make the code harder to maintain.

Note: See TracTickets for help on using tickets.