tag:blogger.com,1999:blog-5135517.post7683399212273157192..comments2023-11-05T03:54:44.710-08:00Comments on Making it stick.: Dynamic Languages: Should the Tools Suck?Patrick Loganhttp://www.blogger.com/profile/02088461489050417591noreply@blogger.comBlogger26125tag:blogger.com,1999:blog-5135517.post-61898980083893200302008-02-08T18:07:00.000-08:002008-02-08T18:07:00.000-08:00"it requires a full integration test suite - where..."it requires a full integration test suite - where every possible interaction between the actual concrete objects is tested"<BR/><BR/>I dunno Chris. Are you writing this because you have first-hand knowledge of repeated, nasty problems due to refactoring incredibly general message selectors in large, dynamic-language systems? Or are you just reaching for any argument?<BR/><BR/>I cannot say I've ever pushed the boundaries on refactoring something like #add: to something like #plus: in a really large, production system. In fact I can tell you for sure, I have *never* done that. It simply has not come up for me. And I have been programming in Lisp since the early 1980s and in Smalltalk since 1987, among other significant experiences.<BR/><BR/>Am I worried? Not really, until you come up with something more realistic. Usually renaming message selectors are fairly anachronistic within a specific system, for a specific reason, and I can never remember having any significant problems. Never. That's just my experience. But if you are worried, then stay far, far away from dynamic languages, and I am sure you will continue to be as happy as ever.<BR/><BR/>"That's not to say static is better - it just has slightly less overhead in terms of the tests you need (at the expense of being constrained by the type system as some would argue)."<BR/><BR/>I would argue with the significance of that "slightly less" measurement. I've never found it to be significant, and I have written thousands and thousands of tests in both static and dynamic languages of various stripes. You?<BR/><BR/>Hey, like I said, if my argument does not float your boat, what the heck do I care? Float it somewhere else.Patrick Loganhttps://www.blogger.com/profile/02088461489050417591noreply@blogger.comtag:blogger.com,1999:blog-5135517.post-10710788240470366542008-02-08T13:53:00.000-08:002008-02-08T13:53:00.000-08:00One "problem" with this kind of refactoring in dyn...One "problem" with this kind of refactoring in dynamic languages is that it requires a full <I>integration</I> test suite - where every possible interaction between the actual concrete objects is tested. This negates the use of mock based unit-tests.<BR/><BR/>In a static language you can instead rely more on unit-tests using mocks (avoiding requiring integration tests for every permutation of concrete collaborators), as the static typing will ensure the interaction will still be valid with any concrete object of the same type as the mock. And obviously refactoring still works.<BR/><BR/>That's not to say static is better - it just has slightly less overhead in terms of the tests you need (at the expense of being constrained by the type system as some would argue).Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5135517.post-30881422634554267682008-01-29T00:18:00.000-08:002008-01-29T00:18:00.000-08:00"Smalltalk images are like Linux distributions in ..."Smalltalk images are like Linux distributions in this sense: people can make all kinds of them.<BR/><BR/>And so there are small ones, there are ones with different look-and-feels, there are developer-oriented ones, etc"<BR/><BR/>I would not compare the Squeak smalltalk image with a linux distro because there are a lot of good looking big and small linux distro's but there is no good looking, user friendly lean Squeak image. Apparently its too hard because everything in the standard image is too intertwined. There seem to be some initiatives to make Squeak look better but nothing so far has impressed me ... and I have already had a look at Leon's image and although it does look slightly better than the standard image (makes you wonder why they don't try anything on that default image) but it doesn't address any usability issues.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5135517.post-27895550793114328822008-01-28T07:09:00.000-08:002008-01-28T07:09:00.000-08:00"Patrick, I like the Smalltalk way too but I just ..."Patrick, I like the Smalltalk way too but I just have to say that Squeak is plain ugly, and the image is filled with crap (eToys, etc ...) you don't want."<BR/><BR/>Smalltalk images are like Linux distributions in this sense: people can make all kinds of them.<BR/><BR/>And so there are small ones, there are ones with different look-and-feels, there are developer-oriented ones, etc.<BR/><BR/>One posted previously in this comment thread may suit you...<BR/><BR/><A HREF="http://onsmalltalk.com/my-squeak-image/" REL="nofollow">http://onsmalltalk.com/my-squeak-image/</A>Patrick Loganhttps://www.blogger.com/profile/02088461489050417591noreply@blogger.comtag:blogger.com,1999:blog-5135517.post-37129686981511480222008-01-28T03:31:00.000-08:002008-01-28T03:31:00.000-08:00Patrick, I like the Smalltalk way too but I just h...Patrick, I like the Smalltalk way too but I just have to say that Squeak is plain ugly, and the image is filled with crap (eToys, etc ...) you don't want.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5135517.post-71507438606913297382008-01-27T04:38:00.000-08:002008-01-27T04:38:00.000-08:00What happens in Smalltalk projects where you grow ...What happens in Smalltalk projects where you grow larger? Where you want to divide a system up into components, and some of those components don't exist yet? How are interfaces between library and user code specified? Can such interfaces be browsed in the same way if the code can't be called?Pete Kirkhamhttps://www.blogger.com/profile/17321624014729731964noreply@blogger.comtag:blogger.com,1999:blog-5135517.post-23152338655563069872008-01-26T17:12:00.000-08:002008-01-26T17:12:00.000-08:00"Relying on scraping information from program exec..."Relying on scraping information from program execution is a very flimsy way of performing program analysis?"<BR/><BR/>Scraping?<BR/><BR/>Actually runtime wrapping in Smalltalk, Lisp, and other dynamic languages can be pretty useful for a lot of things. Sorry your language makes that difficult.Patrick Loganhttps://www.blogger.com/profile/02088461489050417591noreply@blogger.comtag:blogger.com,1999:blog-5135517.post-47070007103456174242008-01-26T09:32:00.000-08:002008-01-26T09:32:00.000-08:00"Fundamentally it is harder, your post has shown h..."Fundamentally it is harder, your post has shown how much harder rather than proving the opposite."<BR/><BR/>Perhaps harder for the tool implementor. Different, but I don't know if it is "harder". On balance, the parser, etc. for Smalltalk is a heck of a lot easier.<BR/><BR/>But that work has been done already by the tool implementor.<BR/><BR/>On the other hand static typing gets in the way of application developers day after day.<BR/><BR/>I prefer the dynamic approach. If you don't, oh well.Patrick Loganhttps://www.blogger.com/profile/02088461489050417591noreply@blogger.comtag:blogger.com,1999:blog-5135517.post-51224360128010512012008-01-26T08:31:00.000-08:002008-01-26T08:31:00.000-08:00"Is that what you're saying?"There are situations ..."Is that what you're saying?"<BR/><BR/>There are situations where the refactoring engine cannot tell statically. There are situations where it can. The runtime capability helps with the former. I've not found this to be a problem in practice at all.Patrick Loganhttps://www.blogger.com/profile/02088461489050417591noreply@blogger.comtag:blogger.com,1999:blog-5135517.post-37366143922775831162008-01-26T08:28:00.000-08:002008-01-26T08:28:00.000-08:00"Heck, even our own Mike Milinkovich was one of th..."Heck, even our own Mike Milinkovich was one of the original developers of the Envy/Smalltalk product which provided source code management for several Smalltalk implementations."<BR/><BR/>Hey, if you all prefer Java and Eclipse now to Smalltalk, then I won't hold that against you. Your still good guys.Patrick Loganhttps://www.blogger.com/profile/02088461489050417591noreply@blogger.comtag:blogger.com,1999:blog-5135517.post-80353589201969624532008-01-26T08:25:00.000-08:002008-01-26T08:25:00.000-08:00"This result from the smalltalk experiment..."Expe..."This result from the smalltalk experiment..."<BR/><BR/>Experiment? It's been working very well for a long, long time.Patrick Loganhttps://www.blogger.com/profile/02088461489050417591noreply@blogger.comtag:blogger.com,1999:blog-5135517.post-39635626182897185372008-01-26T08:24:00.000-08:002008-01-26T08:24:00.000-08:00"Many people have observed how static typing is re..."Many people have observed how static typing is really a set of automated tests expressed in a declarative way."<BR/><BR/>Go with it, if it works for you.Patrick Loganhttps://www.blogger.com/profile/02088461489050417591noreply@blogger.comtag:blogger.com,1999:blog-5135517.post-50244243153589094922008-01-26T07:00:00.000-08:002008-01-26T07:00:00.000-08:00An other thing about Eclipse (or IDEA for that mat...An other thing about Eclipse (or IDEA for that matter which IMHO is superior) refactoring support is that preserves the formatting of methods. If you do a refactoring in Smalltalk with RB it will always pretty print all the changed methods.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5135517.post-81441816390912554892008-01-26T04:46:00.000-08:002008-01-26T04:46:00.000-08:00What I just gathered from that is that it really i...What I just gathered from that is that it really is a nightmare to implement the most bsaic of refactorings in a dynamic language, and that smalltalk has done it with brute force requiring the entire programme to be executed. That is an inelegant solution due to lack of type information.<BR/><BR/>Fundementally it is harder, your post has shown how much harder rather than proving the opposite. That doesn't mean its impossible, it simply means the tools and requirements to make them work are going to take longer.Paul Keeblehttps://www.blogger.com/profile/01672124418792339749noreply@blogger.comtag:blogger.com,1999:blog-5135517.post-41241247564616429892008-01-26T02:33:00.000-08:002008-01-26T02:33:00.000-08:00Let me get this right: imagine I wrote this class ...Let me get this right: imagine I wrote this class "CurrencyValue" with a method "add: aCurrencyValue". I notice that the method should rather be called "plus: aCurrencyValue" because it's functional, not mutating.<BR/><BR/>So I say "rename add to plus". The documentation tells me that the browser will happily rename Collection#add:, too, because it's using great reflection tricks.<BR/><BR/>Is that what you're saying?<BR/><BR/>But in general, unless people look each other over the shoulder at work, these debates will go on and on and on...Matthiashttps://www.blogger.com/profile/16326405235666413306noreply@blogger.comtag:blogger.com,1999:blog-5135517.post-83543954174633842472008-01-26T01:37:00.000-08:002008-01-26T01:37:00.000-08:00thanks for responding to my example in your update...thanks for responding to my example in your update :)<BR/><BR/>> The major drawback to this type of refactoring is that the refactoring is only as good as your test suite. <BR/><BR/>this is an interesting drawback. Many people have observed how static typing is really a set of automated tests expressed in a declarative way. <BR/><BR/>This result from the smalltalk experiment confirms this from another angle.<BR/><BR/>Relying on scraping information from program execution is a very flimsy way of performing program analysis? For performance (JVM run-time optimization) its ok - you want to optimize for the particular program run, but you don't want to possibly make your program incorrect.<BR/><BR/>You seem to think that the problem is that the tools here 'suck' rather than it being a property of the underlying problem domain - static analysis of dynamic languages.<BR/><BR/>Btw, any of the guys who wrote the Smalltalk tools you are clinging are the architects of Eclipse:<BR/> http://www.eclipsezone.com/articles/beaton-interview/<BR/><BR/>e.g. this paragraph:<BR/><BR/>There seems to be a lot of history between Smalltalk and Eclipse though.<BR/><BR/>There sure is. A good chunk (probably most) of the original Eclipse developers are former Smalltalkers. In fact, many of them are from the same group that created IBM Smalltalk. John Duimovich, lead of the Eclipse Tools PMC, was the lead designer and implementor for the virtual machine under IBM Smalltalk. Steve Northover, the principle architect behind SWT is the same guy who brought us Smalltalk's Common Widgets which provide similar functionality. Heck, even our own Mike Milinkovich was one of the original developers of the Envy/Smalltalk product which provided source code management for several Smalltalk implementations.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5135517.post-68678280060912970152008-01-25T23:32:00.000-08:002008-01-25T23:32:00.000-08:00"Working incrementally helps you make only small c..."Working incrementally helps you make only small changes at a time, testing well points out just the few things you just broke, good coverage makes sure you find everything, and refactoring tools introspecting the code that your good tests cover help automate those changes and bring them up to a higher level of expression for you."<BR/><BR/>Sounds great to me for both static and dynamically typed languages/environments! One of the benefits of a statically-typed language is that the compiler handles a whole slew of unit tests that you don't even have to write.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5135517.post-4652691131290765642008-01-25T22:00:00.000-08:002008-01-25T22:00:00.000-08:00"Eclipse has much more functionality, and doesn't ..."Eclipse has much more functionality, and doesn't find senders/receivers that don't apply because it has the extra type information."<BR/><BR/>Well, one: have you seen the update to my post. The applicable methods problem is not a problem.<BR/><BR/>And two: I hate the Eclipse experience. Just not as pleasing as the Smalltalk UI. For me. YMMV.<BR/><BR/>Then three: using Eclipse means using a language that Eclipse supports. I'm using Smalltalk in this example, and it makes no sense to use a Java-based IDE for a Smalltalk system.<BR/><BR/>Even if that Java IDE were pleasing to me, which Eclipse is not.Patrick Loganhttps://www.blogger.com/profile/02088461489050417591noreply@blogger.comtag:blogger.com,1999:blog-5135517.post-47318240118958677802008-01-25T21:43:00.000-08:002008-01-25T21:43:00.000-08:00"Right on, but you don't even have the good stuff ..."Right on, but you don't even have the good stuff loaded, try my image..."<BR/><BR/>I do have color pretty printing. I'll try the rest too. ThanksPatrick Loganhttps://www.blogger.com/profile/02088461489050417591noreply@blogger.comtag:blogger.com,1999:blog-5135517.post-82439852684951249312008-01-25T21:42:00.000-08:002008-01-25T21:42:00.000-08:00"That's true for people burying their head in the ..."That's true for people burying their head in the sand. Eclipse's tool support/refactoring support blows the Squeak stuff out of the water."<BR/><BR/>Eclipse and I have agreed to leave each other alone. Nice to see it has good things and works for you though. I have no problem with that.Patrick Loganhttps://www.blogger.com/profile/02088461489050417591noreply@blogger.comtag:blogger.com,1999:blog-5135517.post-13091504450530059812008-01-25T20:48:00.000-08:002008-01-25T20:48:00.000-08:00"answer: you do not"Only if your tools suck. Shoul..."answer: you do not"<BR/><BR/>Only if your tools suck. Should we assume tools have to suck? Mine don't.Patrick Loganhttps://www.blogger.com/profile/02088461489050417591noreply@blogger.comtag:blogger.com,1999:blog-5135517.post-78096236228676989452008-01-25T20:47:00.000-08:002008-01-25T20:47:00.000-08:00Good thing I don't hope to convince you. But see t...Good thing I don't hope to convince you. But see the update to the post if you care.Patrick Loganhttps://www.blogger.com/profile/02088461489050417591noreply@blogger.comtag:blogger.com,1999:blog-5135517.post-28977748061917612632008-01-25T18:49:00.000-08:002008-01-25T18:49:00.000-08:00Right on, but you don't even have the good stuff l...Right on, but you don't even have the good stuff loaded, try my image...<BR/><BR/>http://onsmalltalk.com/my-squeak-image/<BR/><BR/>It's a fully loaded developer image with all the goodies like code completion, colored code, nicer windowing system and lots of good libraries loaded.<BR/><BR/>Squeak rocks, blog some more about it, I love peoples reactions to it.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5135517.post-71419246485448534302008-01-25T18:09:00.000-08:002008-01-25T18:09:00.000-08:00"Decades of better tools than you can find for Jav..."Decades of better tools than you can find for Java, C, Scala, you name your favorite statically typed language."<BR/><BR/>That's true for people burying their head in the sand. Eclipse's tool support/refactoring support blows the Squeak stuff out of the water. I say this as a diehard Smalltalk (specifically Squeak) fan. Spend some quality time in Squeak, then spend some quality time in Eclipse. Eclipse has much more functionality, and doesn't find senders/receivers that don't apply because it has the extra type information. <BR/><BR/>As for the emotional stuff, come on! None of this stuff really matters all that much. Just enjoy using what you use!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5135517.post-13530099639940642852008-01-25T17:23:00.000-08:002008-01-25T17:23:00.000-08:00"Can your static tools do that?"If the static lang..."Can your static tools do that?"<BR/><BR/>If the static language was image based, probably :-)Rich Seagraveshttps://www.blogger.com/profile/09862746972924105764noreply@blogger.com