Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Never use it and why pollute ur source with this?, It can make u toggle/collapse in some editor for sure but is not that important.
-
There is the opinion that #region just gives you a better feeling when writing bad code.
Like: oh, this method is 100 lines long. Maybe I should refactor it.... Or I wrap some of it in regions and dont have to see that shit code ever again.
Imo there is no reason to ever use region. -
@danielspaniol also, it just piss of people that using another text editor that didnt know how to deal with #region 😂
-
kjelle3538y@danielspaniol While doing game projects in school I mainly use the monogame framework. Region is a bless since it lets me hide big chunks of initializing code. Call it bad code, call it what you want. It helps me very much.
-
CWins48088yUsed it in the past. Its one more layer of structure , which can help to deal with the code or make it more complex. I prefer to make the classes themselves simpler. Cases were i often thought "hey, region would help my structure it" were often classes that I'm not really happy with.
-
I like it when I do game development with unity , but I never use it while developing UWP or WPF applications or Class libraries ...
-
thoxx19778your team rule is: when you need regions, your file/class is too large (we added StyleCop rules for such things - so it throws an info in VS when regions are used)
-
I really like them. Working on a huge project with some very large files that have some very large methods - regions are great for skipping over giant blocks you know you're not going to need to look at.
Also I like having related methods close to each other.
Related Rants
Fellow C# programmers, how often do you use #region in your projects and how important do you think it is?
I have found myself using it increasingly. It works great for me and I feel that I can structure my code better.
undefined
c#
question
#region