Cheetah
Cheetah

Reputation: 14379

What are references for in Visual Studios?

I understand that this is bringing in an extra libraries that are pre-compiled by Microsoft but, for instance, is there a disadvantage of just adding every library under the sun? I can also see that is, by default, adds the most used libraries to any project.

Does it actually do anything to the output binary when my application is compiled, because I was under the impression that most of these libraries are part of the .NET framework anyways?

So other than custom libraries, what is the point?

Upvotes: 1

Views: 63

Answers (1)

Hans Passant
Hans Passant

Reputation: 941317

There's nothing that stops you from doing this. The compiler is going to be bogged down by having to load all the declarations from the metadata of all of these assemblies but that shouldn't take more than a handful of seconds on a slow disk. Pretty sure identifier lookup is amortized O(1) so it should not noticeably slow down the actual compilation. Namespace names in the .NET framework were carefully picked to never cause a collision. The output assembly will only have a list of the references that actually get used in the code.

The only objection against it is, well, it is not elegant. Your team mates will whisper behind your back. Whomever is picked to maintain your project some day will start looking for another job the instant he sees your project. Being considered sloppy is the worst kind of label for a programmer, a reputation that's very hard to live down.

Upvotes: 2

Related Questions