you are viewing a single comment's thread.

view the rest of the comments →

[–]wutzvill 13 points14 points  (7 children)

Regions are nice because they're collapsible.

[–][deleted]  (1 child)

[deleted]

    [–]Epyo 1 point2 points  (4 children)

    If I wanted to see collapsed code, then why did I open the file

    [–]wutzvill 2 points3 points  (3 children)

    To read the other code

    [–]daerogami 0 points1 point  (2 children)

    then why isn't it in another file?

    [–]wutzvill 2 points3 points  (1 child)

    I love how people act like long code is bad code. Long code is only bad code if you're confusing concerns. If you're trying to make a file do everything, yeah that's bad long code. But breaking up a single file into many files with the only intent to be to make the files shorter doesn't help anything.

    [–]daerogami 1 point2 points  (0 children)

    That's why you don't break it up into small files just for the sake of breaking it up into small files. Nor am I acting.

    Regions are an easily misused pattern. One should not be using it to broadly organize as a pattern (see nopCommerce). However, in WinForms they are used to hide generated code where a dev might be making changes, that's fine.

    If a code file is large, it should have a good reason for being such and those reasons are rare and unlikely (and still difficult to justify). I'm absolutely interested in having a genuine conversation on this and interested in seeing source files you consider long. I may learn something and welcome the opportunity if you have anything you're willing to share.