News for hackers. Stuff that matters.
Re:It's probably time to stop recommending Clean Code (2020) by eurasiantiger on Saturday February 18, 2023 @03:43AM (#34845190)
Let’s say my site has a download image feature that embeds per-user digital licenses into downloaded images at download time. This might take some processing so there is a queue and an abstraction representing the downloaded file. There are also several endpoints serving different types of image files.

What shall I call the unit of code orchestrating these download processes, if not ImageDownloadManager?

Re:It's probably time to stop recommending Clean Code (2020) by carschno on Saturday February 18, 2023 @04:26AM (#34845412)
I think I would go with a class called Image, which provides a method called download().
Re:It's probably time to stop recommending Clean Code (2020) by eurasiantiger on Sunday February 19, 2023 @03:12AM (#34855566)
This class is now over 4000 lines long.
Re:It's probably time to stop recommending Clean Code (2020) by cnorthwood on Saturday February 18, 2023 @03:52AM (#34845236)
ImageDownloadPreparer?
Re:It's probably time to stop recommending Clean Code (2020) by eurasiantiger on Sunday February 19, 2023 @12:19PM (#34859596)
ImageDownloadManager also communicates with the frontend about its state, so it’s not a completely preparatory process.
Re:It's probably time to stop recommending Clean Code (2020) by ahartmetz on Saturday February 18, 2023 @05:08AM (#34845643)
ImageDownloadDispatcher, ImageDownloadScheduler, Image DownloadQueueManager... basically, the fix for "FooManager" names is to ask which aspect(s) of Foo the manager manages. Lifetime, storage, execution order (and according to which criteria), resource limits, uniqueness, exclusive access, efficient search, ...
Re:It's probably time to stop recommending Clean Code (2020) by eurasiantiger on Sunday February 19, 2023 @03:11AM (#34855563)
All of those hint of functionality that is not present here. The code is just managing image downloads, not dispatching them, scheduling them, or even touching the queue (which is handled on a higher level).

ImageDownloadManager manages image downloads. Why use a name that makes less sense?

Re:It's probably time to stop recommending Clean Code (2020) by pvorb on Sunday February 19, 2023 @04:47PM (#34862191)
How about ImageDownloader?