Am 06.11.2011 19:06, schrieb Sean Corfield: > On Sunday, November 6, 2011, Dennis Haupt <d.haup...@googlemail.com > <mailto:d.haup...@googlemail.com>> wrote: >> this is a double edged sword. you *do* get it right *if* you think it >> through, but reality is often more complex than you assume. if you >> suddenly see that you forgot to handle special case x, you are >> punished harder than in <random statically typed oo language>. > > I'll go a little further than Colin and say "IME"... > > As a veteran of C++ and Java with time spent in Groovy, Scala and more > recently Clojure - and a decade of dynamic scripting languages for the > web - I've generally found OO languages, especially with strong type > systems, punish my design missteps much more harshly.
let me guess: you had some classes that were used more than they should have been because they were the best match and introducing a better one would have taken more time - and since they could do so much, they were just used at more and more places and in the end, they became god classes which infested everything? > >> in oo, you can do a few "emergency hacks" before everything becomes >> unmaintainable. in clojure, i could not do this without committing >> maintenance suicide immediately. for each case that popped up >> surprisingly, i had to do a bit of refactoring. > > I think this might be a combination of the novelty of the pure > functional approach and your comfort level with OO. You're probably > prepared to accept a certain amount of hackery in OO that makes you > immediately uncomfortable in Clojure. it does in every functional language. with mutable states, i can "hide" that one additional parameter for the one special case that would otherwise ruin my design by using a secret static threadlocal or whatever else does the job. this is a pact with the devil that will backfire when a certain threshold is reached, but it *is* faster than doing a small refactoring every time. if everything i'm supposed to use are immutable parameters and one return value, these hacks are out of the question. I actually think that's a benefit > of Clojure: it encourages doing it right. i'm pretty pragmatic here: sometimes doing it wrong now and doing a big refactoring later is the better way. > >> that whole "dynamically typed" thing is creeping me out. > > I've gone back and forth with type systems over the decades and these > days I'm firmly in the dynamic camp. Part of my PhD research in the 80's > was around type inference in dynamic functional languages (partly for > performance but mostly about correctness since that was my supervisor's > big thing). Working code was clearly working code, but the inferred > types were often more generic than anyone working in a statically typed > language would have picked - which meant more opportunities for reuse > and more flexibility. > > I can definitely understand your feelings on this topic but I think as > you stick with it you'll get more comfortable with the thinking vs doing > approach, and writing truly generic code will mean fewer special cases > and less refactoring. So don't be discouraged! can you give an example of truly generic code vs not so generic code? > > Oh, while I've got your attention, could you turn off the PGP signature > for this mailing list? The UPPERCASE HEADINGS and big blocks of > signature text make your posts really hard to read, especially when > you're replying and quoting heavily in a thread. I'm writing this on my > iPhone where the PGP stuff is particularly unpleasant to work around! done > > Thanx, > Sean > > > -- > Sean A Corfield -- (904) 302-SEAN > An Architect's View -- http://corfield.org/ > World Singles, LLC. -- http://worldsingles.com/ > > "Perfection is the enemy of the good." > -- Gustave Flaubert, French realist novelist (1821-1880) > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en