P is for Practical | |
PerlMonks |
Re^4: Verbose Tk Codeby LanX (Saint) |
on Feb 28, 2021 at 20:07 UTC ( [id://11128916]=note: print w/replies, xml ) | Need Help?? |
Hi Discipulus thanks for the code links. > if you have a case where repetition is needed providing some %default is better tan nothing and suffices. The example in the OP had only one method, the point of with is to handle many different methods on the same object. with is available in many languages, tho Tk might be the wrong field for applying it. The other default options were optional, but it surprised me a lot that Tk needed it. Must be related to the TCL brige. > Why? Because I generally cut and paste my own code. Well, personally I prefer DRY over boilerplating, but YMMV. I looked into your code, and I see plenty of possibilities to improve readability. may I suggest:
instead of many instances of
same for other methods. Please note that you can
> Corion is right: TIMTOWTDI ... but YMMV :)
Cheers Rolf
updateimproved code for method-wrapper.
In Section
Seekers of Perl Wisdom
|
|