C # using declarations - more = good or bad?

edit typos

Hi,

This may be a fashionable question, but if it helps me follow the best practice, I don't care: P

Let's say I want to use classes and methods in the System.Data namespace ... as well as in the System.Data.SqlClient namespace.

Is it better to play a game or just a parent, i.e. ....

using System.Data
using System.Data.SqlClient

or simply...

using System.Data

More importantly, I believe whether it has any effect on the application - or is it just a matter of preference (the announcement of both the parent and the child keeps the rest of the code in a neat and tidy state, but this is to the detriment of the speed of the application, because stretching it in the entire parent namespace, and then in the child?)

Hope it's not too many waffles

+3
5

.

, ( ), 100 , smidge, ( , , , ).

, Z, X.Y.Z... , , .

( ), using, .

+9

Organize->Remove Usings, Visual Studio .

+8

-, . , CIL, . CIL .

- , . , , , , . , .

+2

Express what you have in mind and strive for concise, understandable codes - all that matters here. This does not affect the application, just for you, your colleagues and future future brains.

+2
source

Use whatever happens when you write your type name and press Ctrl + ., Enterin VS.

+1
source

Source: https://habr.com/ru/post/1763065/


All Articles