473,383 Members | 1,874 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Difference between [RunInstaller(true)] and [RunInstallerAttribute(true)]

I can't find any good information on the
relation/difference between
[RunInstaller(true)] and [RunInstallerAttribute(true)]
attributes in the code. Please advise.

--
Regards
Konrad Viltersten
----------------------------------------
May all spammers die an agonizing death;
have no burial places; their souls be
chased by demons in Gehenna from one room
to another for all eternity and beyond.
Sep 3 '08 #1
8 5646
K Viltersten <tm**@viltersten.comwrote:
I can't find any good information on the
relation/difference between
[RunInstaller(true)] and [RunInstallerAttribute(true)]
attributes in the code. Please advise.
Almost no difference at all. From the C# 3.0 spec, section 17.2:

<quote>
By convention, attribute classes are named with a suffix of Attribute.
An attribute-name of the form type-name may either include or omit this
suffix. If an attribute class is found both with and without this
suffix, an ambiguity is present, and a compile-time error results. If
the attribute-name is spelled such that its right-most identifier is a
verbatim identifier (§2.4.2), then only an attribute without a suffix
is matched, thus enabling such an ambiguity to be resolved.
</quote>

--
Jon Skeet - <sk***@pobox.com>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com
Sep 3 '08 #2
I can't find any good information on the
relation/difference between
[RunInstaller(true)] and [RunInstallerAttribute(true)]
attributes in the code. Please advise.
Almost no difference at all. From the C# 3.0 spec, section 17.2:

<quote>
By convention, attribute classes are named with a suffix of Attribute.
An attribute-name of the form type-name may either include or omit this
suffix. If an attribute class is found both with and without this
suffix, an ambiguity is present, and a compile-time error results. If
the attribute-name is spelled such that its right-most identifier is a
verbatim identifier (§2.4.2), then only an attribute without a suffix
is matched, thus enabling such an ambiguity to be resolved.
</quote>

Great info. Thanks!

For some reason VS2005 will suggest the name
sans the suffix when using autogenerated code.
i almost got punched today for using the
suffix while a colleague insisted on not to.

--
Regards
Konrad Viltersten
----------------------------------------
May all spammers die an agonizing death;
have no burial places; their souls be
chased by demons in Gehenna from one room
to another for all eternity and beyond.
Sep 3 '08 #3
K Viltersten <tm**@viltersten.comwrote:
Great info. Thanks!

For some reason VS2005 will suggest the name
sans the suffix when using autogenerated code.
i almost got punched today for using the
suffix while a colleague insisted on not to.
I think omitting the suffix is idiomatic - I certainly don't include it
myself.

--
Jon Skeet - <sk***@pobox.com>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com
Sep 3 '08 #4
K Viltersten wrote:
>I can't find any good information on the
relation/difference between
[RunInstaller(true)] and [RunInstallerAttribute(true)]
attributes in the code. Please advise.
For some reason VS2005 will suggest the name
sans the suffix when using autogenerated code.
i almost got punched today for using the
suffix while a colleague insisted on not to.
VS and your colleague are right. If you write
FoobarAttribute, then you will have all the maintainers
of your code searching for FoobarAttributeAttribute !

Arne

Sep 4 '08 #5
"Arne Vajhøj" <ar**@vajhoej.dkwrote in message
news:48***********************@news.sunsite.dk...
>For some reason VS2005 will suggest the name
sans the suffix when using autogenerated code.
i almost got punched today for using the
suffix while a colleague insisted on not to.

VS and your colleague are right. If you write
FoobarAttribute, then you will have all the maintainers
of your code searching for FoobarAttributeAttribute !
Oh yes, XmlAttributeAttribute certainly did teach us that sort of thing,
didn't it... :)
Sep 4 '08 #6
>>I can't find any good information on the
>>relation/difference between
[RunInstaller(true)] and [RunInstallerAttribute(true)]
attributes in the code. Please advise.
>For some reason VS2005 will suggest the name
sans the suffix when using autogenerated code.
i almost got punched today for using the
suffix while a colleague insisted on not to.

VS and your colleague are right. If you write
FoobarAttribute, then you will have all the maintainers
of your code searching for FoobarAttributeAttribute !
How can we explain that the code provided by
MS on in the help uses the suffix, then? Is
it a mistake? A special case? Please advise.

--
Regards
Konrad Viltersten
----------------------------------------
May all spammers die an agonizing death;
have no burial places; their souls be
chased by demons in Gehenna from one room
to another for all eternity and beyond.
Sep 4 '08 #7
"K Viltersten" <tm**@viltersten.comwrote in message
news:6i************@mid.individual.net...
How can we explain that the code provided by
MS on in the help uses the suffix, then? Is
it a mistake? A special case? Please advise.
It is _allowed_ to both provide and omit the suffix, so it's not a mistake.
On the other hand, Microsoft samples in MSDN have never been particularly
good as far as coding style is concerned - they often don't even follow
Microsoft's own style guide. Overall, vast majority of hand-written C# code
I've seen omits the suffix - after all, that was why it is allowed to do so
in the first place.
Sep 4 '08 #8
>How can we explain that the code provided by
>MS on in the help uses the suffix, then? Is
it a mistake? A special case? Please advise.

It is _allowed_ to both provide and omit the suffix, so it's not a
mistake. On the other hand, Microsoft samples in MSDN have never been
particularly good as far as coding style is concerned...
Got it. Thanks!

--
Regards
Konrad Viltersten
----------------------------------------
May all spammers die an agonizing death;
have no burial places; their souls be
chased by demons in Gehenna from one room
to another for all eternity and beyond.
Sep 4 '08 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

46
by: Scott Chapman | last post by:
There seems to be an inconsistency here: Python 2.3.2 (#1, Oct 3 2003, 19:04:58) on linux2 >>> 1 == True True >>> 3 == True False >>> if 1: print "true" ....
14
by: root | last post by:
Hi group, Apologies in advance if this has been asked somewhere before, but I haven't managed to get anything from the Google archives - I've been getting introductory guides to C++ all day...
9
by: sci | last post by:
I believe both ways to create an array of strings are correct. Is there any difference between these two? 1. char *MyString = {"First string", "Second string", ..."Tenth string"}; 2. char...
2
by: 23s | last post by:
My site's login page has a form w/ 2 textboxes and a submit button. If I'm in either of those textboxes (i.e., either one of the textboxes has focus), in any given browser, hitting "enter" on my...
59
by: Pierre Quentel | last post by:
Hi all, In some program I was testing if a variable was a boolean, with this test : if v in My script didn't work in some cases and I eventually found that for v = 0 the test returned True ...
40
by: nufuhsus | last post by:
Hello all, First let me appologise if this has been answered but I could not find an acurate answer to this interesting problem. If the following is true: C:\Python25\rg.py>python Python...
3
by: Riccardo Murri | last post by:
Hello, I have some code that stops when trying to find a graph in a list of similar graphs:: (Pydb) list 110 try: 111 canonical = self.base 112 except ValueError: 113 ...
11
by: Daniel Klein | last post by:
Given the functions: function first() { echo "first\n"; return true; } function second() { echo "second\n"; return true; }
21
by: Bill Cunningham | last post by:
I have create these 2 files. Called main.c and atr.c. They seem to work pretty well. I just wanted to submit them to see what if any errors others that know more might find. Thanks. atr.c ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.