When I looked at the generated code of an aspx page, one thing struck me. Every class reference is printed every time instead of applying the “using” method at the top of the code file.
Is there a reason for doing this?
If there’s no difference in the two methods then why not use “using” for simplicity?
System.Data.DataSet theSet = new DataSet();
vs
using System.Data;
DataSet theSet = new DataSet();
Because for generated code, simplicity of reading is not a priority.
Simplicity of writing is an issue, however: If types are always specified with their fully qualified name, the likelihood of a name conflict decreases. Imagine that you have two libraries that provide TextBox controls, and you add both of them to your web form.
as compared to