News for hackers. Stuff that matters.
Re:What to Do When Your Colleague Creates Spaghetti Code by mhomde on Friday September 16, 2016 @10:57AM (#12514426)
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 :)

Re:What to Do When Your Colleague Creates Spaghetti Code by douche on Friday September 16, 2016 @11:44AM (#12514770)
Holy 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.

Re:What to Do When Your Colleague Creates Spaghetti Code by mhomde on Saturday September 17, 2016 @07:15AM (#12520059)
Yeah... 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 :)

Re:What to Do When Your Colleague Creates Spaghetti Code by Silures on Friday September 16, 2016 @12:03PM (#12514947)
I 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.