Can anyone explain to me WHY I must constantly forget and relearn that:
is functionally equivalent tomy $sth = $dbh->prepare("SELECT * FROM Something"); $sth->execute(); if($sth->err()){ die $sth->errstr(); }
???my $sth = $dbh->prepare("SELECT * FROM Something"); $sth->execute(); if($dbh->err()){ die $dbh->errstr(); }
Because every couple of years I will become frustrated with typing out the error check on the various statement handles.
And then look into how I can make that easier.
And RE-LEARN that I could have been checking the database handle and just copy/pasting that over and over.
So frustrating, a real smack-to-the-forehead kind of moment.
And I think it ties in with why I write code the way I do. I WRITE IT OUT. I take the time to format and indent and line up the code because I have learned 6-months-in-the-future-me will really appreciate it and I don't want him cussing at me, retroactively.
Just needed to vent a little bit, please return to your regularly scheduled activities.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Forgetfulness and 6-months-from-now-you
by hippo (Bishop) on Jan 12, 2018 at 11:29 UTC | |
by oakbox (Chaplain) on Jan 15, 2018 at 11:04 UTC | |
by afoken (Chancellor) on Jan 16, 2018 at 20:43 UTC |
Back to
Meditations