CARVIEW |
November 27, 2004
Populate your AssemblyInfo
All too often, I download sample code with AssemblyInfo files that look like this:
// // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. // [assembly: AssemblyTitle("")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.*")]
So, basically, you're compiling into an assembly DLL or EXE with nothing but crappy, default metadata and versioning.
Please don't do this.
If you're going to the effort of making your code publically available, take an additional 60 seconds to fill out the AssemblyInfo.
My only regret with assembly attributes is that they really should have included URL and email attributes by default. Instead we have to define custom attributes to get that..
This also comes up all the time at work, too. Developers don't seem to "get" AssemblyInfo, for whatever reason.
Jeff Atwood on November 28, 2004 01:55 AMIt's the same in the 'old style' Win32 world with the version resource - either people don't put one in or they have a default MFC AppWizard provided one and they never update it. It's a very useful way of validating post-deployment configuration, either programmatically or by hand!!
Stuart Dootson on November 28, 2004 04:47 AMIMHO, I think it's more appropriate to leave it bank, specifically the company, e-mail address, and any other information which identifies the program's purpose or identifies the author. If you want that stuff in there, then you can put it in. But most of the code that can be downloaded isn't intended to be dropped into a production application without any modification. And as soon as you make a modification to it all of the information becomes obsolete anyway so they've saved you the effort of actually deleting everything they would have typed anyway.
Even on the occasion that the code is intended to be used unmodified, whoever incorporates the code into their application should take responsibility for it. Because if some guy at NASA uses my code, I don't want them calling me when the shuttle crashes. Leaving the old author's name in especially if it's a common name like "Greg Miller" will only cause confusion when the author can't be found or is mistaken for someone else.
Greg Miller on November 29, 2004 12:12 PM> I think it's more appropriate to leave it blank, specifically the company, e-mail address, and any other information which identifies the program's purpose or identifies the author
Well, if your goal is to make the code more anonymous, then sure.
>Because if some guy at NASA uses my code, I don't want them calling me when the shuttle crashes. Leaving the old author's name in especially if it's a common name like "Greg Miller" will only cause confusion when the author can't be found or is mistaken for someone else.
I dunno, I think of this as Fowler does:
https://www.artima.com/intv/principles4.html
Knowing who originally wrote the code is always helpful, and the appropriate place for that is in the assembly attributes. Weak ownership should be encouraged, but not abused (as you're describing).
Jeff Atwood on November 29, 2004 04:41 PMContent (c) 2009 Jeff Atwood. Logo image used with permission of the author. (c) 1993 Steven C. McConnell. All Rights Reserved. |