tag:blogger.com,1999:blog-8288194986820249216.post5778419089905830252..comments2024-03-22T05:09:17.789-07:00Comments on Abstract Heresies: HowWhy (not) to write Factorial in Java.Joe Marshallhttp://www.blogger.com/profile/03233353484280456977noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-8288194986820249216.post-43641139736279677482011-02-04T16:35:02.073-08:002011-02-04T16:35:02.073-08:00Thanks for linking to scmutils. It's full of d...Thanks for linking to scmutils. It's full of delicious features.Arcane Sentimenthttps://www.blogger.com/profile/04144052171693893368noreply@blogger.comtag:blogger.com,1999:blog-8288194986820249216.post-12266529151840826392011-01-30T18:34:54.040-08:002011-01-30T18:34:54.040-08:00The Development Chaos Theory article is largely co...The Development Chaos Theory article is largely concerned with factories. Factories are used all the time in Scheme and nobody ever complains because both the use and definitions are easy and natural:<br /><br />USE:<br />((*factorial-function-factory*) 5)<br /><br />POSSIBLE DEF:<br />(fluid-let (*factorial-function-factory*<br /> (lambda (n) ....))<br /><br />How *factorial-function-factory* got defined should not matter to the code depending on it. It's there. I promise. (Guice gives absolutely no more guarantees that it's defined and it is the best in class dynamic variable err, dependency injection framework for Java).<br /><br />The Development Chaos Theory article is of course ridiculous for treating fact as a function that needs to be so abstracted, but without dynamic variables, this really is a necessary pattern in Java in many real world cases.Jason Wilsonhttps://www.blogger.com/profile/03095166606444968520noreply@blogger.comtag:blogger.com,1999:blog-8288194986820249216.post-2650357421328748852011-01-29T20:17:08.884-08:002011-01-29T20:17:08.884-08:00His point is that Java has created a culture where...His point is that Java has created a culture where developers over-generalize (violating the <i>en vogue</i> You Ain't Gonna Need It principle) and create frameworks rather than customized solutions. You turned it on its side and asked "why should developers <i>ever</i> have to do this junk" and made it a criticism of the Java language. But in doing so, you take code decorated with "don't do this" and then point to it as an example of Java's failings.<br /><br />You say "but what about the 1% of people who need all that extra nonsense?", but remember Mr. Woody's point is that developers should create bespoke solutions providing only the power necessary to solve the problem at hand rather than large general frameworks.<br /><br />Your point that Java requires significant boilerplate in order to say what needs to be said is valid, if not particularly novel. Even so, using code which was written in an intentionally convoluted way to criticize Java's convolution is like using the winner of the Obfuscated C Code contest to demonstrate that C is difficult to read.Nathanhttps://www.blogger.com/profile/09875316335816494943noreply@blogger.comtag:blogger.com,1999:blog-8288194986820249216.post-15824837250417784182011-01-29T16:18:49.333-08:002011-01-29T16:18:49.333-08:00As a Java dev I'm looking at Groovy for simila...As a Java dev I'm looking at Groovy for similar reasons. Java is verbose, way too verbose in areas that should be concise. The lack of operator overrides mean that (except for String concatenation) explicit method calls need to be used, complicating the use of classes like BigInteger. Design Patterns can also be great but can easily be used to excess, a tendency that is exacerbated by the complexity of common stuff like JDBC and EJBs.Unknownhttps://www.blogger.com/profile/02334444138117915241noreply@blogger.comtag:blogger.com,1999:blog-8288194986820249216.post-23737238078339799122011-01-29T05:54:44.827-08:002011-01-29T05:54:44.827-08:00"Larger conceptual changes, like adding a Fac..."Larger conceptual changes, like adding a Factory object or a dynamically pluggable implementation, cannot be abstracted out."<br /><br />These are both design patterns. Are you saying that we shouldn't develop using design patterns?<br /><br />You can't argue against Factory objects using Factorial as an example. That's like arguing against using Windows when you're using Notepad as an example.Jevonhttps://www.blogger.com/profile/08443579312529087120noreply@blogger.comtag:blogger.com,1999:blog-8288194986820249216.post-12115709147939069672011-01-28T23:47:43.929-08:002011-01-28T23:47:43.929-08:00Haskell type classes give a consistent interface t...Haskell type classes give a consistent interface to different kinds of numbers (among other things). Would that do here?Paul Stecklerhttps://www.blogger.com/profile/13416750891822431224noreply@blogger.comtag:blogger.com,1999:blog-8288194986820249216.post-47767393569901792302011-01-28T22:31:23.708-08:002011-01-28T22:31:23.708-08:00Oh my.Oh my.Anonymousnoreply@blogger.com