Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^6: Batch file renaming - on identical name, keep only most recent file, based on dates

by haukex (Bishop)
on Nov 06, 2019 at 18:15 UTC ( #11108392=note: print w/replies, xml ) Need Help??


in reply to Re^5: Batch file renaming - on identical name, keep only most recent file, based on dates
in thread Batch file renaming - on identical name, keep only most recent file, based on dates

I'll just say what I've said several times before to others: Instead of making assumptions (including the assumption that the wisdom seeker knows to rigorously test code) and throwing code out there that will (silently!) break when the assumptions aren't met, there are several alternatives, IMHO better ones:

  • Clearly documenting the assumptions.
  • Coding defensively, i.e. the code dies if the assumptions aren't met.
  • Applying Postel's law and accepting a wider range of inputs. (E.g. accept single digits in every field of the datetime.)
  • Asking the wisdom seeker for clarification.
  • Comment on Re^6: Batch file renaming - on identical name, keep only most recent file, based on dates

Replies are listed 'Best First'.
Re^7: Batch file renaming - on identical name, keep only most recent file, based on dates
by Lotus1 (Vicar) on Nov 06, 2019 at 18:48 UTC

    Those are all good points. Thanks.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11108392]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2021-12-05 18:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (31 votes). Check out past polls.

    Notices?