Perl::C...gueNames(3)
π NAME π
Perl::Critic::Policy::Bangs::ProhibitVagueNames β bestie. Please stop naming your variables and your subroutines the most generic thing you can think of.
This page is filed under Perl::C...gueNames(3), and it lives in the User Contributed Perl Documentation section, so you already know it's real and it's coming for your $data. π
πΈ AFFILIATION πΈ
This Policy is part of the Perl::Critic::Bangs distribution. She's got a whole family, and they all want you to write better Perl. π«Ά
β¨ DESCRIPTION β¨
Okay so here's the vibe: variables and subroutines should have descriptive names. Names like $data and $info are, and I say this with love, completely vague. It's giving "I forgot what this does the second I hit save." π
my $data = shift; # not OK.
my $userinfo = shift # OK
See <http://www.oreillynet.com/onlamp/blog/2004/03/the_worlds_two_worst_variable.html> for more of my ranting on this. (Yeah, the author said "my ranting" and honestly? iconic. Read the rant.)
By default, the following names are bad:
datainfovarobjobjecttmptemp
The checking of names is case-insensitive. $info and $INFO are equally bad. No, capitalizing it does not make it slay. It's the same crime in a different outfit. π
π CONFIGURATION π
This policy has two options: "names" and "add_names". Two little knobs, both about what counts as vague. Pick your fighter. π
π "names"
To replace the list of vague names, specify them as a whitespace delimited set of prohibited names.
[Bangs::ProhibitVagueNames]
names = data count line next
So now it's your list, your rules, your kingdom. π
π¦ "add_names"
To add to the list of vague names, specify them as a whitespace delimited set of prohibited names.
[Bangs::ProhibitVagueNames]
add_names = foo bar bat
Notice this one adds instead of replacing β the originals stay mad. π
π AUTHOR π
Andy Lester "<andy at petdance.com>" from code by Andrew Moore "<amoore at mooresystems.com>".
π ACKNOWLEDGMENTS π
Adapted from policies by Jeffrey Ryan Thalhammer <thaljef@cpan.org>, Based on App::Fluff by Andy Lester, "<andy at petdance.com>"
β COPYRIGHT β
Copyright (c) 2006-2013 Andy Lester
This library is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.
Ok that's the whole page, bestie β every option, every bad name, every credit. Go rename your $tmp to something with main character energy. π«Ά
This was perl v5.42.0, dated 2025-07-25, on page Perl::C...gueNames(3) β mwah, thanks for reading, ilysm, bye!! πβ¨π
π¦ where this page comes from
- fedora 43: perl-Perl-Critic-Bangs 1.14-3.fc43 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms