Follow up:

When I go to maintain this thing in five days or five
years and I have one of those "what the h*** is IO.d.Bool
suppose to mean?" moments, I created the follow subs to make the code more readable/maintainable.

And mind you I can always look up what IO.d.Bool means
in my own IO documentation, but this makes it human readable.
Saving a lot of time.  Plus, since I program in Top Down,
I call all three of these all over the place in this program:


sub DirectoryExists( Str $DirPath --> Bool ) { return "$DirPath".IO.d.Bool; } # $Full DirPath format is `H:\MyDocsBackup`

sub DriveExists( Str $DriveLetter --> Bool ) { return "$DriveLetter".IO.e.Bool; } # $Drive Letter format is `A:\`

sub FileExists( Str $FilePath --> Bool ) { return "$FilePath".IO.f.Bool; } # $File Path format is `H:\IAmBackup`


   if not  "%Options<DriveLetter>".IO.e.Bool {..}

versus

   if not  DriveExists( %Options<DriveLetter> ) {...}

And it is instantly understandable at a glance.  Put
a little extra effort up front and downstream is a
lot easier.

Also, I adore using `not` in place of False and not equal
as it is more human readable.

:-)

-T

We will let the optimizer take care of any of
my unneeded coercing.

Reply via email to