Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the most abused features in Visual Studio / C#? [closed]

For me, No.1 has to be code folding.

#region xxx
#endregion

All of sudden, people find an excuse to have big classes(files) because they can "organize" them nicely. I once saw a half-page-long class with 3,000 lines. I was speechless and they were like "what's the problem"?

No.2 is partial class. It's actually a nice feature especially when you work with generated code. However, some people use it to "break down" a class to multiple pieces. Why? Because that class is so big and popular that it's always locked in the source control. Instead of breaking down the class into different smaller classes, they create multiple files like my_Class1.cs, your_Class1.cs etc so that people can work on Class1 at the same time.

I would like to include "Copy&Paste" but it's not Visual Studio's fault...

like image 571
treehouse Avatar asked May 18 '09 13:05

treehouse


1 Answers

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

like image 119
Ronald Wildenberg Avatar answered Oct 18 '22 06:10

Ronald Wildenberg