tag:blogger.com,1999:blog-15136575.post116013659188004465..comments2023-10-17T12:00:16.772+01:00Comments on Code rant: No to #region!Mike Hadlowhttp://www.blogger.com/profile/16441901713967254504noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-15136575.post-23616636756669926332008-07-11T09:26:00.000+01:002008-07-11T09:26:00.000+01:00I completely agree. If you need regions to organiz...I completely agree. If you need regions to organize your code; there's something wrong with it.Michael Lidgrenhttps://www.blogger.com/profile/09785819068202416495noreply@blogger.comtag:blogger.com,1999:blog-15136575.post-64811498394319598412008-07-08T08:57:00.000+01:002008-07-08T08:57:00.000+01:00Hi GrumpYoungMan,Great comment :) I don't agree wi...Hi GrumpYoungMan,<BR/><BR/>Great comment :) I don't agree with you though.<BR/><BR/>It's not a lame excuse, it's something I've seen in code that I've had to pick up. And that's not just once either. OK, so you can blame the programmer that's now moved on, but it would be much simpler if the code was nicely factored in the first place rather than simply being divided up with non-executing region directives. Surely if you can split something up with regions you are also capable of refactoring your code into meaningful methods and classes?Mike Hadlowhttps://www.blogger.com/profile/16441901713967254504noreply@blogger.comtag:blogger.com,1999:blog-15136575.post-54395039614370476962008-07-07T19:30:00.000+01:002008-07-07T19:30:00.000+01:00"They're like comments, they don't execute so it's..."They're like comments, they don't execute so it's easy to have regions which tell you something completely wrong." <BR/><BR/>I detest this perennial lame excuse by programmers. Newsflash: it's our job to update the comments as well as the code.<BR/><BR/>If comments (or region labels) are found that are out of date, that's a black mark against the programmer who failed to update them. Enough black marks results in disciplinary action. End of story.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-15136575.post-73210213164888980112008-04-28T13:18:00.000+01:002008-04-28T13:18:00.000+01:00Respectfully, I disagree. Ctrl+M+L is your friend...Respectfully, I disagree. Ctrl+M+L is your friend. Like anything it's something that can be abused as much as used. I like to use regions to split a class into:<BR/><BR/>- Fields<BR/>- ctors<BR/>- Private methods<BR/>- Public methods<BR/>- Properties<BR/><BR/>It's also a good way of gently enforcing a coding standard within a group.Anonymousnoreply@blogger.com