Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I was confronted with a problem, so I thought I would use Java. Now I have a problem factory.


When all you have is a HammerFactoryImpl, every problem looks like an INailIter


Why restrict things to Hammer and Nails - you need to abstract that a bit further.

Why not IDirectedForceApplier and IDirectedForceRecipientIter :-)

Maybe they should introduce a "Name not sufficently abstract" syntax error into the Java compiler! :-)


Of course the currently trending answer would be to use monads. Preferably implemented in Go.


I remember a colleague who wrote Common Lisp in the style of Occam - with concurrent process and communication channels. His code actually looked a lot like some Go code I've seen - hardly surprising I guess given the common ancestry to CSP.


Btw., CSP in Hoare's Book is a Lisp...

http://www.usingcsp.com/cspbook.pdf

Page vi:

> The proposed implementations are unusual in that they use a very simple purely functional subset of the well-known programming language LISP. This will afford additional excitement to those who have access to a LISP implementation on which to exercise and demonstrate their designs.


Hum... Haskell monads are very concrete when compared to the Java factories. They represent abstract stuff, but always a single well defined abstract concept. They do not make the code more generic.

Maybe you can replace those with lenses, or applicatives in general. People do overuse those.


java.classes.factories.problem.module


You made me laugh out loud. Hahaha. Genius. Don't get me wrong, I love Java, but some of its patterns make me wish I was programming C++.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: