What are the most common features in Visual Studio / C #?

For me, No.1 should be code folding.

#region xxx #endregion 

Suddenly, people find excuse for having large classes (files) because they can "organize" them beautifully. Once I saw a half-page class with 3,000 lines. I was speechless and they looked like "what problem"?

No.2 is a partial class. This is a really nice feature, especially when you work with generated code. However, some people use it to β€œbreak down” a class into several parts. What for? Because this class is so large and popular that it is always locked in the original control. Instead of splitting the class into several smaller classes, they create several files, such as my_Class1.cs, your_Class1.cs, etc., so that people can work with Class1 at the same time.

I would like to include "Copy & Paste", but this is not a Visual Studio bug ...

+6
c # visual-studio
source share
4 answers

Next to the #region blocks, I would say that there is an ASP.NET IDataSource implementation ( SqlDataSource , LinqDataSource ) that force (allow) to write access to the code data directly to your aspx pages. I would not use this even for a really small demo application, but nowhere in the documentation of these classes it was mentioned that for a well-designed application you should not use these classes.

+2
source share

I think the most abused feature will be to use the default templates as is. Many of the templates include "partial" as well as regions and include / use operators that are not required by the code inside the class.

After that I will have to agree with the #region blocks; however, these CANs may be useful if they are executed correctly. Usually, although they are used as a means to organize classes that are larger than they probably should be.

0
source share

Ignoring the warnings

0
source share

Graphic editor for WebForms. Spoiled by so many potentially good developers in drag and drop monkeys.

0
source share

All Articles