user-pic

byterock

  • About: Long time Perl guy, a few CPAN mods allot of work on DBD::Oracle and a few YAPC presentations
Subscribe to feed Recent Actions from byterock

  • mascip commented on Immutability with Moo(se)

    Hi byterock :-) Apparently DBI delivers the Statement object in an immutable way, then.

    Apparently my goal is not clear. I've added a Post Scriptum to my original post to clarify it. Let me know if that worked.

  • Toby Inkster commented on Immutability with Moo(se)

    DBI::st objects are not conceptually immutable. If you call, say fetchrow_array on one, you get back a different row each time. This implies that each call is changing the internal state of the object.

  • Toby Inkster commented on Immutability with Moo(se)

    DBI is actually an example of where mutable objects are perfectly sensible: as iterators.

    Immutable objects are great because they are easier to reason about, reduce the possibilities for action at a distance, and make testing simpler. But they are not the perfect fit for every problem. Sometimes you need to be prepared to forego the benefits of immutable objects, in favour of coming up with a class design that makes the most sense for the type of data and processes you're modelling.

  • mascip commented on Immutability with Moo(se)

    I don't have a clear opinion about whether iterators should be mutable or immutable. But I would like tools to help me get some level of immutability, without me needing to work on it too hard.

    It would be nice to get most of my attributes to be Sub::Trigger::Lock-ed without needing to write it every time (I could probably try to write a MooX module for that - I'd have to read the relevant Moo documentation). And I'd like to have some functions to test for immutability (I might try it at home).

    Some online people's opinion about whether iterators should be mutable or immutable:…
  • Yuki Kimoto commented on GitPrep 1.8 is released - Public key authentication support

    thanks, I fixed this.

Subscribe to feed Responses to Comments from byterock

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is run by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.