in reply to Language design: direct attribute access and postponed mutators (Perl Vs Python)
is very common "pythonic" code. Doing something like object->{attribute}=10 is not only very uncommon in Perl but also heavily frowned upon.object.attribute = 10
I'm not sure where you get this "very uncommon in Perl" from. Unless you're using one of the Moo* object builders (or Class::Accessor), this is how you set vales.
Also, DBI does that as well (but uses tie) behind the curtain.
Depending on the size of your team and the rate of change of the code (and abstraction), this is bad practice, but Perl has gone a long time without doing the Java-style explicit setters and getters.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Language design: direct attribute access and postponed mutators (Perl Vs Python)
by LanX (Saint) on Sep 15, 2019 at 22:03 UTC | |
by Corion (Patriarch) on Sep 16, 2019 at 07:45 UTC | |
by LanX (Saint) on Sep 16, 2019 at 16:15 UTC | |
|
Re^2: Language design: direct attribute access and postponed mutators (Perl Vs Python)
by RonW (Parson) on Sep 16, 2019 at 20:33 UTC |