-
Notifications
You must be signed in to change notification settings - Fork 0
/
params.json
1 lines (1 loc) · 4.17 KB
/
params.json
1
{"name":"anti-region-legion.org","tagline":"Because it's time to #endregions","body":"The Anti-`#region` Legion\r\n=========================\r\n\r\nThe Anti-`#region` Legion is a community for people that believe that the `C#` [`#region`](http://msdn.microsoft.com/en-us/library/9a1ybwek%28v=vs.110%29.aspx) is a unfortunate part of the language. \r\n\r\nIf you just love your regions The Anti-`#region` Legion is probably not for you. But it is suggested that you read [Richard Banks post on some of the issues with regions](http://www.richard-banks.org/2011/02/anti-region-campaign.html). \r\n\r\n\r\nHow do I join the Legion?\r\n-------------------------\r\n\r\nYou can [join by starring this repository](https://github.com/Anti-region-Legion/Anti-region-Legion.github.io) (if you have a github account), or join in the conversation on social media such as Twitter using hashtag `#endregions`. You are also encouraged to [suggest your own ideas to this site on the _issues_ page](https://github.com/Anti-region-Legion/Anti-region-Legion.github.io/issues).\r\n\r\nWhat does an upstanding member of the Legion do?\r\n------------------------------------------------\r\n\r\nJoin us in practicing and preaching good code practices, such as using the following ways to deal with grouping and organization of expanding code (rather than regions):\r\n\r\n1. *Partial class* - a useful methodology of moving dependency items (such as properties or methods) without refactoring a code-base with a rippling change\r\n2. *Extract methods* - improve the JIT's ability to optimize performance by allowing it to not load sections of code if the branch hasn't been or can never be exercised by extracting methods out of the contents of large block statements (if/else,for/while,anonymous delegates,etc)\r\n3. *Single responsibility* - reduce complexity of classes by encapsulating the responsibility for aspects of functionality to designated layers and objects\r\n\r\nI Just Want to Get Rid of All Regions in My Code Now!\r\n-----------------------------------------------------\r\n\r\nOk, here are a couple of quite simple ways to do that. One command line and one from within Visual Studio.\r\n\r\n*Command line* - run this PowerShell command in your toplevel source folder(s) (c# class files only):\r\n\r\n dir -recurse -filter *.cs $src | foreach ($_) {\r\n $file = $_.fullname\r\n echo $file\r\n (get-content $file) | where {$_ -notmatch \"^.*\\#(end)?region.*$\" } | out-file $file\r\n }\r\n\r\nYou can read more on [Richard Dingwall's blog](http://richarddingwall.name/2010/08/12/powershell-to-recursively-strip-c-regions-from-files/). \r\n\r\n*Visual Studio*:\r\nPress `ctrl` + `shift` + `H` to \"Replace in Files\" and as \"Find options\" \"Use Regular Expressions\". Then search for `^[ \\t]*\\#(region|endregion).*\\n` and replace it with nothing/empty string. \r\n\r\n\r\nSee [more details in this stackoverflow answer](http://stackoverflow.com/a/13382749/587279).\r\n\r\nMy Team Won't let me Delete the Regions!?\r\n-----------------------------------------\r\n\r\nPoor you. If you just want to see the code within collapsed regions you can use `ctrl` + `M`, `ctrl` + `L` to toggles between expand and collapse all sections. \r\n\r\nThere is even a [Visual Studio extension that does this and more automatically](http://visualstudiogallery.msdn.microsoft.com/0ca60d35-1e02-43b7-bf59-ac7deb9afbca). \r\n\r\n\r\nHistory\r\n-------\r\n\r\nThe idea for the anti-`#region` legion started from a [twitter conversation](https://twitter.com/jrusbatch/status/392473615557746688) which again was started from [Microsoft declining to remove `#region`s from c#](https://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2678342-region-directive-considered-harmful-was-get-rid). \r\n\r\nHow can I show my anti-`#region` legion membership?\r\n---------------------------------------------------\r\n\r\nBe creative! Make a sticker, tag your computer with `#endregions` or buy a [t-shirt](http://www.cafepress.com/cp/customize/product2.aspx?number=1005536199). \r\n\r\n\r\n**Join the anti-`#region` Legion today!**\r\n\r\n","google":"UA-46042487-1","note":"Don't delete this file! It's used internally to help with page regeneration."}