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

A programmer had a problem. He thought to himself: "I know, I'll solve this with threads!"

has Now problems. two he



Then he thought he'd use Java. Now he has a ProblemFactory.


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


This one always bugs me because it says "two" but this output couldn't be produced with fewer than 3 threads.


Fair point if you read it literally and assume each thread is a problem. But I assume, as it's a variation of the regex joke, 'using threads' is seen as a singular thing. Perhaps it should say 'threading?'


Fuck threadsing


Best one.


lmfao




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: