<div dir="ltr">An ADA developer how wrote code running on the Boeing planes said that he did not wanted freedom, he wanted a tool to have correctness. Now, no one is using Ruby to control plane, I hope so, but we all want our web sites to stay up and be correct in manipulating data. So I do not think that "<span style="font-size:12.8px">you can pretty much do whatever you feel is appropriate</span>" is a good idea.</div><div class="gmail_extra"><br><div class="gmail_quote">On 10 September 2015 at 11:05, Stephen Best <span dir="ltr"><<a href="mailto:bestie@gmail.com" target="_blank">bestie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I believe Camille Baldock made an excellent point in one of her talks a while back (was it the memory leak one?) where string allocation was causing significant performance issues, this was easily solved by mutating strings instead.<br><br>I'm looking forward to string mutability being off by default but I think the great thing about Ruby is that you can pretty much do whatever you feel is appropriate.<div><div class="h5"><br><div class="gmail_extra"><div><div><div dir="ltr"><br></div></div></div>
<br><div class="gmail_quote">On 10 September 2015 at 10:53, Riccardo Tacconi <span dir="ltr"><<a href="mailto:rtacconi@gmail.com" target="_blank">rtacconi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Yes I can recommend Tom's post to understand how to build immutable data structures in Ruby. The problem is that Ruby is mainly an imperative programming language and you will have harder time to use it in a more functional way then directly using languages like Haskell. With Rails you will have even harder time because it is a framework design to change the state of shared objects. But it is possible and hard to figure out in the beginning because you are trying to use immutability in a place where mutability is everywhere (and JC explained that very well).<div><br></div><div>You were talking about Java Strings, I would add that strings should be immutable, and Ruby should not allow the usage of mutable strings. Mutable strings do not give any advantage and introduce only problems.</div></div><div class="gmail_extra"><div><div><br><div class="gmail_quote">On 10 September 2015 at 10:39, Tom Stuart <span dir="ltr"><<a href="mailto:tom@codon.com" target="_blank">tom@codon.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 10 Sep 2015, at 10:34, Stephen Best <<a href="mailto:bestie@gmail.com" target="_blank">bestie@gmail.com</a>> wrote:<br>
> In every example I've seen immutability has certainly required more effort, but I don't think this always correlates with more complexity.<br>
<br>
</span>This reminds me (belatedly) of a bit I wrote last year, on implementing immutable trees: <a href="http://codon.com/notes-on-counting-tree-nodes#immutable-trees" rel="noreferrer" target="_blank">http://codon.com/notes-on-counting-tree-nodes#immutable-trees</a><br>
<br>
I wrote that in an attempt to demonstrate how immutability can be useful — in that particular case, by making a data structure correct by construction, rather than having to write extra code to deal with malformed trees and so on. So I think that’s a decent example of how “more effort” (to implement the operations without mutation) leads to “[less] complexity” (because the resulting code is ultimately simpler to work with).<br>
<br>
Cheers,<br>
-Tom<br>
<div><div>_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org" target="_blank">Chat@lists.lrug.org</a><br>
Archives: <a href="http://lists.lrug.org/pipermail/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/pipermail/chat-lrug.org</a><br>
Manage your subscription: <a href="http://lists.lrug.org/options.cgi/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/options.cgi/chat-lrug.org</a><br>
List info: <a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div></div></div><span><font color="#888888">-- <br><div><div dir="ltr">Riccardo Tacconi<br><br><a href="http://github.com/rtacconi" target="_blank">http://github.com/rtacconi</a><br><a href="http://twitter.com/rtacconi" target="_blank">http://twitter.com/rtacconi</a></div></div>
</font></span></div>
<br>_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org" target="_blank">Chat@lists.lrug.org</a><br>
Archives: <a href="http://lists.lrug.org/pipermail/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/pipermail/chat-lrug.org</a><br>
Manage your subscription: <a href="http://lists.lrug.org/options.cgi/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/options.cgi/chat-lrug.org</a><br>
List info: <a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
<br></blockquote></div><br></div></div></div></div>
<br>_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a><br>
Archives: <a href="http://lists.lrug.org/pipermail/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/pipermail/chat-lrug.org</a><br>
Manage your subscription: <a href="http://lists.lrug.org/options.cgi/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/options.cgi/chat-lrug.org</a><br>
List info: <a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Riccardo Tacconi<br><br><a href="http://github.com/rtacconi" target="_blank">http://github.com/rtacconi</a><br><a href="http://twitter.com/rtacconi" target="_blank">http://twitter.com/rtacconi</a></div></div>
</div>