<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">2014/1/22 Sean P. DeNigris <span dir="ltr"><<a href="mailto:sean@clipperadams.com" target="_blank">sean@clipperadams.com</a>></span><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Juan Vuletich-4 wrote<br>
> I don't like pooldictionaries. They look like "hidden globals" to me,<br>
> and they are as bad as regular globals. Maybe there were good reasons<br>
> for them 30 years ago, but I don't see any today, except for<br>
> compatibility.<br>
<br>
I agree that they should be avoided if possible, but they seem useful e.g.<br>
for NativeBoost in Pharo. There are many C constants, and you'd like to<br>
refer to them directly so you can copy/paste from documentation, and so that<br>
you don't have to context switch as much when writing C calls. With shared<br>
pools, you can import them into the namespace of all classes that directly<br>
access the library.<br>
<br></blockquote><div><br></div><div>But then, what difference with class variables?<br></div><div>class vars also are global, just with a bit more restrictive visibility (subclasses)...<br><br></div><div>Usage of such globals for well known constants (like a C macro) is not that problematic.<br>
</div><div>Of course, it's possible to replace such shared pool by message send:<br>Character cr rather than CR.</div><div>But note that you replace a global (CR) by another global (Character).<br></div><div>OK reducing the number of globals is already something...<br>
</div><div>Also, motherness is not always that trivial, is it Text centered or TextAttribute centered?<br></div><div><br></div><div>Sure, some small optimization difference still exist:<br></div><div>- is a new instance created or a constant shared?<br>
</div><div>- is a message sent or not (note that Squeak 4.5 now send a message to access the #value of a global)<br></div><div>That indeed might have influenced decisions in the 70s.<br></div><div><br></div><div>Usage as a shared mutable state is more problematic<br>
It's hardly possible to avoid such states (like a registry of opened files for example)<br>in this case, yes, it's better to restrict access (encapsulate) with a class var.<br></div><div>But I think Pharo already cleaned out the ugliest examples in TextConstants, no?<br>
<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
-----<br>
Cheers,<br>
Sean<br>
--<br>
View this message in context: <a href="http://forum.world.st/Philosophy-Do-we-need-pool-dictionaries-tp4701469p4738435.html" target="_blank">http://forum.world.st/Philosophy-Do-we-need-pool-dictionaries-tp4701469p4738435.html</a><br>
Sent from the Cuis Smalltalk mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
Cuis mailing list<br>
<a href="mailto:Cuis@jvuletich.org">Cuis@jvuletich.org</a><br>
<a href="http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org" target="_blank">http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org</a><br>
</blockquote></div><br></div></div>