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

This is funny because no one uses the factory pattern in other languages


Reminds me of the old FactoryFactoryFactory joke [1]

[1] https://gist.github.com/nkbt/4691b1ae3e78a6141aea


> "This thing comes with documentation, right?"

This is the most painful part for me. If you're trying to understand some code written in Gratuitous Object Astronautics style, it's almost universally assumed you're fully aware of why the product contains hammer factory factory factories, how factories work, and how get an actual hammer to swing.

The Gratuitous Object Astronautics culture is so accustomed to all the nonfunctional boilerplate that skilled, self-gratifying, astronauts never need to document their cleverness. This leaves casual tourists in the dark, which is a problem in any organization.


Also reminds me of the self-effacing response to nomenclature criticism in Java:

https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...


You'd be surprised to see how many WhateverFactory classes there are in the current python project I'm working on... sigh.


Using FactoryBoy for testing?


Well, to a first approximation, no, nobody uses the factory pattern in other languages.

Once in a long while you see one in C# or C++. But the people making fun of Java aren't comparing it with C# and C++.


I used C/C++ for years, and I just don't believe that the world+dog quit creational design patterns. It was just now very easy to find a database connection pool for C++ that is exactly a connection factory. Would you mind clarifying your comment that almost nobody uses factory patterns in other languages with some sense of exactness as to what is and what isn't a factory?


Sadly I've seen it used in Scala




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

Search: