Perl::...Blocks(3pm)
π Perl::Critic::Policy::ControlStructures::ProhibitUntilBlocks π
okay so bestie, this one's a Perl::Critic policy page β from the Perl::...Blocks(3pm) manual, which is literally just the truncated name of the policy itself. slay. let's get into it β¨
β¨ NAME β¨
Perl::Critic::Policy::ControlStructures::ProhibitUntilBlocks β the policy that says: write "while(! $condition)" instead of "until($condition)".
like, that's the whole vibe. no cap. π«Ά
πΈ AFFILIATION πΈ
This Policy is part of the core Perl::Critic distribution. it comes pre-installed with the whole thing, iconic behavior honestly π
π DESCRIPTION π
so Conway β yes, that Conway β discourages using until because it leads to double-negatives that are hard to understand. and likeβ¦ he's right, bestie. double negatives are giving "not not un-true" energy and nobody has the brain cells for that on a Tuesday π
instead, you reverse the logic and use while. flip it. periodt.
until($condition) { do_something() } #not ok
until(! $no_flag) { do_something() } #really bad
while( ! $condition) { do_something() } #ok
look at that second one. look at it. until(! $no_flag)?? that's #really bad, bestie, the manpage said it, not me π
heads up: this Policy only covers the block-form ofuntil. for the postfix variety, go see"ProhibitPostfixControls".
iykyk π¦
π§ CONFIGURATION π§
This Policy is not configurable except for the standard options. that's it. that's the section. no levers to pull, no knobs to turn, just the standard options and vibes π
β SEE ALSO β
Perl::Critic::Policy::ControlStructures::ProhibitPostfixControlsβ the postfix-flavored sibling. go say hi π
π AUTHOR π
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com> β thank you for your service, king π«‘π
π₯ COPYRIGHT π₯
Copyright (c) 2005-2011 Imaginative Software Systems. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module.
like, legally iconic. π
okay that's the whole page, you ate that, go forth and never write until again πβ¨
signing off from the perl v5.42.0 manual, dated 2024-10-23, Perl::...Blocks(3pm) β mwah π
π¦ where this page comes from
- opensuse-leap 16.0: perl-Perl-Critic 1.156.0-bp160.1.1 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms