3 ms·
Well that's one harmful pattern, but by no means the only one, you also have "The Blob". I once worked on a project where the code in general was pretty good bu
by mhomde 10y ago
Well that's one harmful pattern, but by no means the only one, you also have "The Blob". I once worked on a project where the code in general was pretty good but the programmers had seemingly no knowledge of design patterns at all. Code was contained in these giant classes, they actually used partial files with underscores in the naming to segment it, ugh.
Took quite some effort to disentangle that. As with most things no extreme is good, neither Blobs nor Poltergeists :)
- douche 10y agoHoly hell, partial classes. I'm not convinced that, outside of WinForms designer-generated control definitions, there is ever a legitimate reason to use them. I just tore apart one of those kinds of monstrosities last week, where the person who originally wrote it, went so far as to do C-style name prefixing on the methods, i.e. Foo_DoThing(), Bar_DoOtherThing(), Foo_DoOtherThing(), but left it all in one honking monster class instead of splitting it out.
- Silures 10y agoI agree. Partial classes are for supplementing machine-generated code: winforms designer files, generated entity framework classes etc. That is, wherever the IDE would overwrite any edits you made. I'm currently refactoring a 3 partial class monster usercontrol: 238 lines, 2370 lines, and 4526 lines. Fun.
- mhomde 10y agoYeah... they're really handy for separating generated code from user code... but having to segment classes with them is a rather foul code smell :) Haha, wow, that's another way to go I guess. It never ceases to amaze me how inexperienced programmers can brute force problems with the limited tools they possess :)