|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Using "Me"I use DevExpress CodeRush/Refactor Pro etc and I notice this suite advises against using the "Me" qualifier, claiming it is redundant. My concept was that full qualification of an object method was a good idea (in any project)? e.g: Dim SomeObject as MyProject.Workflow.GreatObject as opposed to Dim SomeObject as GreatObject. And in refering to SomeObject* I usually refer to it in a WinForm project as Me.SomeObject. Hope I am making this clear. Seems more readable, however, is there a performance hit :( *VS2008 VB.Net SP1 with Sql Server 2008 SP1 Thanks for any advice Harry Full qualification makes the code harder to read... IMO this is mostly a
matter of frequency. If this is an exceptionnal usage using the full qualified name is enough. If you keep using the same things over and over then importing the namespace is likely better. Using Me is a bit like importing a namespace but still using the fully qualified name. You can check the IL but it should generate the same code... In some products you can choose wether or not a rule is to be applied (using Me is not my personal preference but the main point is to be convinced yourself about the rules you follow, not to blindly apply them).... -- Patrice "Harry Strybos" <harrystry***@optusnet.com.au> a écrit dans le message de groupe de discussion : uUEaZSh#JHA.5***@TK2MSFTNGP04.phx.gbl...Show quoteHide quote > Hi all > > I use DevExpress CodeRush/Refactor Pro etc and I notice this suite advises > against using the "Me" qualifier, claiming it is redundant. > > My concept was that full qualification of an object method was a good idea > (in any project)? e.g: > > Dim SomeObject as MyProject.Workflow.GreatObject as opposed to Dim > SomeObject as GreatObject. > > And in refering to SomeObject* I usually refer to it in a WinForm project > as Me.SomeObject. > > Hope I am making this clear. Seems more readable, however, is there a > performance hit :( > > *VS2008 VB.Net SP1 with Sql Server 2008 SP1 > > Thanks for any advice > > Harry > Harry,
Yes "And", It is also complaining that it is done in the by designer generated code. In my opinion, does it says something about DevExpress Just my opinion, Cor Show quoteHide quote "Harry Strybos" <harrystry***@optusnet.com.au> wrote in message news:uUEaZSh%23JHA.5040@TK2MSFTNGP04.phx.gbl... > Hi all > > I use DevExpress CodeRush/Refactor Pro etc and I notice this suite advises > against using the "Me" qualifier, claiming it is redundant. > > My concept was that full qualification of an object method was a good idea > (in any project)? e.g: > > Dim SomeObject as MyProject.Workflow.GreatObject as opposed to Dim > SomeObject as GreatObject. > > And in refering to SomeObject* I usually refer to it in a WinForm project > as Me.SomeObject. > > Hope I am making this clear. Seems more readable, however, is there a > performance hit :( > > *VS2008 VB.Net SP1 with Sql Server 2008 SP1 > > Thanks for any advice > > Harry > Hello Cor Ligthert[MVP],
> It is also complaining that it is done in the by designer generated This certainly has been the case in the past... I see fewer of these with > code. every build. DevExpress welcome any and all bug reports and suggestions in their Support Center ( http://www.devexpress.com/sc/ ) I'm curious which version of Coderush you are using Cor? Latest official version being 9.1.5 with an early Alpha available for 9.2.0 Hello Harry,
> I use DevExpress CodeRush/Refactor Pro etc and I notice this suite CodeIssues are suggestions.... Not all of which are based on speed, but some > advises against using the "Me" qualifier, claiming it is redundant. > > My concept was that full qualification of an object method was a good > idea (in any project)? e.g: on readability grounds. What is percieved as more or less readable is a personal choice however Each *CodeIssue* can be turned off independantly on a per solution, project or permanent basis. I personally see "Me" or "this" (in C#) as a "naming" code smell. It suggests that you are having to qualify something which maybe does not need to be. Again this is a personal choice. Might I ask which version of Coderush you are working with ?
Show quote
Hide quote
"Rory Becker" <rorybecker@newsgroup.nospam> wrote in message I am using 9.1.5 My general comment on CodeRush is that it is brilliant. news:3af10347319eb8cbc8586c4ffcfd@news.microsoft.com... > Hello Harry, > >> I use DevExpress CodeRush/Refactor Pro etc and I notice this suite >> advises against using the "Me" qualifier, claiming it is redundant. >> >> My concept was that full qualification of an object method was a good >> idea (in any project)? e.g: > > CodeIssues are suggestions.... Not all of which are based on speed, but > some on readability grounds. > > What is percieved as more or less readable is a personal choice however > > Each *CodeIssue* can be turned off independantly on a per solution, > project or permanent basis. > > I personally see "Me" or "this" (in C#) as a "naming" code smell. It > suggests that you are having to qualify something which maybe does not > need to be. > > Again this is a personal choice. > > Might I ask which version of Coderush you are working with ? > > Just was curious about the "Me" suggestion.
Show quote
Hide quote
"Harry Strybos" <harrystry***@optusnet.com.au> wrote in message I use Me all the time but only for the Intellisence that it offers.news:uUEaZSh%23JHA.5040@TK2MSFTNGP04.phx.gbl... > Hi all > > I use DevExpress CodeRush/Refactor Pro etc and I notice this suite advises > against using the "Me" qualifier, claiming it is redundant. > > My concept was that full qualification of an object method was a good idea > (in any project)? e.g: > > Dim SomeObject as MyProject.Workflow.GreatObject as opposed to Dim > SomeObject as GreatObject. > > And in refering to SomeObject* I usually refer to it in a WinForm project > as Me.SomeObject. > > Hope I am making this clear. Seems more readable, however, is there a > performance hit :( > > *VS2008 VB.Net SP1 with Sql Server 2008 SP1 > > Thanks for any advice > > Harry > LS There is no practical difference when naming collissions aren't an issue.
The IL will wind up the same either way. It's simply a matter of preference. If you are the only Harry in the room, I can say "Harry", if not, I'll need to be more specific, but either way I'll get the right "Harry". -Scott Show quoteHide quote "Harry Strybos" <harrystry***@optusnet.com.au> wrote in message news:uUEaZSh%23JHA.5040@TK2MSFTNGP04.phx.gbl... > Hi all > > I use DevExpress CodeRush/Refactor Pro etc and I notice this suite advises > against using the "Me" qualifier, claiming it is redundant. > > My concept was that full qualification of an object method was a good idea > (in any project)? e.g: > > Dim SomeObject as MyProject.Workflow.GreatObject as opposed to Dim > SomeObject as GreatObject. > > And in refering to SomeObject* I usually refer to it in a WinForm project > as Me.SomeObject. > > Hope I am making this clear. Seems more readable, however, is there a > performance hit :( > > *VS2008 VB.Net SP1 with Sql Server 2008 SP1 > > Thanks for any advice > > Harry >
Show quote
Hide quote
"Harry Strybos" <harrystry***@optusnet.com.au> wrote in message Class SomeClassnews:uUEaZSh#JHA.5040@TK2MSFTNGP04.phx.gbl... > Hi all > > I use DevExpress CodeRush/Refactor Pro etc and I notice this suite advises > against using the "Me" qualifier, claiming it is redundant. > > My concept was that full qualification of an object method was a good idea > (in any project)? e.g: > > Dim SomeObject as MyProject.Workflow.GreatObject as opposed to Dim > SomeObject as GreatObject. > > And in refering to SomeObject* I usually refer to it in a WinForm project > as Me.SomeObject. > > Hope I am making this clear. Seems more readable, however, is there a > performance hit :( > > *VS2008 VB.Net SP1 with Sql Server 2008 SP1 > > Thanks for any advice > > Harry > Private myVar As Integer = 0 Public Sub New(ByVal myVar As Integer) Me.myVar = myVar End Sub End Class In the above case, you HAVE to specify Me.myVar in order to set it in the constructor. I also agree that when it's not needed, it's more or less a calling convention. Personally, I only use Me for calling properties and when local variables conflict with other members of the class. HTH, Mythran That's less of an explanation of "Me" vs. the merits of fully qualifying a
type member that confilicts with another member that is also in scope. Show quoteHide quote "Mythran" <Mythran@community.nospam> wrote in message news:8C63514D-3ACC-4981-B5A4-4F5E6C493197@microsoft.com... > > "Harry Strybos" <harrystry***@optusnet.com.au> wrote in message > news:uUEaZSh#JHA.5040@TK2MSFTNGP04.phx.gbl... >> Hi all >> >> I use DevExpress CodeRush/Refactor Pro etc and I notice this suite >> advises against using the "Me" qualifier, claiming it is redundant. >> >> My concept was that full qualification of an object method was a good >> idea (in any project)? e.g: >> >> Dim SomeObject as MyProject.Workflow.GreatObject as opposed to Dim >> SomeObject as GreatObject. >> >> And in refering to SomeObject* I usually refer to it in a WinForm project >> as Me.SomeObject. >> >> Hope I am making this clear. Seems more readable, however, is there a >> performance hit :( >> >> *VS2008 VB.Net SP1 with Sql Server 2008 SP1 >> >> Thanks for any advice >> >> Harry >> > > Class SomeClass > Private myVar As Integer = 0 > Public Sub New(ByVal myVar As Integer) > Me.myVar = myVar > End Sub > End Class > > In the above case, you HAVE to specify Me.myVar in order to set it in the > constructor. I also agree that when it's not needed, it's more or less a > calling convention. Personally, I only use Me for calling properties and > when local variables conflict with other members of the class. > > HTH, > Mythran > > It could also be cited as an example of using "Me" to disguise poor choice
of variable names. Show quoteHide quote "Scott M." <s-mar@nospam.nospam> wrote in message news:e0F6jGp$JHA.4984@TK2MSFTNGP05.phx.gbl... > That's less of an explanation of "Me" vs. the merits of fully qualifying a > type member that confilicts with another member that is also in scope. > > > "Mythran" <Mythran@community.nospam> wrote in message > news:8C63514D-3ACC-4981-B5A4-4F5E6C493197@microsoft.com... >> >> "Harry Strybos" <harrystry***@optusnet.com.au> wrote in message >> news:uUEaZSh#JHA.5040@TK2MSFTNGP04.phx.gbl... >>> Hi all >>> >>> I use DevExpress CodeRush/Refactor Pro etc and I notice this suite >>> advises against using the "Me" qualifier, claiming it is redundant. >>> >>> My concept was that full qualification of an object method was a good >>> idea (in any project)? e.g: >>> >>> Dim SomeObject as MyProject.Workflow.GreatObject as opposed to Dim >>> SomeObject as GreatObject. >>> >>> And in refering to SomeObject* I usually refer to it in a WinForm >>> project as Me.SomeObject. >>> >>> Hope I am making this clear. Seems more readable, however, is there a >>> performance hit :( >>> >>> *VS2008 VB.Net SP1 with Sql Server 2008 SP1 >>> >>> Thanks for any advice >>> >>> Harry >>> >> >> Class SomeClass >> Private myVar As Integer = 0 >> Public Sub New(ByVal myVar As Integer) >> Me.myVar = myVar >> End Sub >> End Class >> >> In the above case, you HAVE to specify Me.myVar in order to set it in the >> constructor. I also agree that when it's not needed, it's more or less a >> calling convention. Personally, I only use Me for calling properties and >> when local variables conflict with other members of the class. >> >> HTH, >> Mythran >> >> > >
Show quote
Hide quote
"Harry Strybos" <harrystry***@optusnet.com.au> wrote in message Thanks for all your advice. I was actually more interested in whether there news:uUEaZSh%23JHA.5040@TK2MSFTNGP04.phx.gbl... > Hi all > > I use DevExpress CodeRush/Refactor Pro etc and I notice this suite advises > against using the "Me" qualifier, claiming it is redundant. > > My concept was that full qualification of an object method was a good idea > (in any project)? e.g: > > Dim SomeObject as MyProject.Workflow.GreatObject as opposed to Dim > SomeObject as GreatObject. > > And in refering to SomeObject* I usually refer to it in a WinForm project > as Me.SomeObject. > > Hope I am making this clear. Seems more readable, however, is there a > performance hit :( > > *VS2008 VB.Net SP1 with Sql Server 2008 SP1 > > Thanks for any advice > > Harry was an increase in complier efficiency, as opposed to readability. Guess none of you guys have Microsoft Mind Reader 1.0 installed :) Harry <harryNoSpam@ffapaysmart.com.au> wrote:
> Thanks for all your advice. I was actually more interested in whether there Depends upon what you mean by compiler efficiency. If you mean> was an increase in complier efficiency, as opposed to readability. Guess > none of you guys have Microsoft Mind Reader 1.0 installed :) efficiency of the resulting compiled code, then no, there's no increase in efficiency. If you mean does it compile faster, being a mind reader won't help. It'll depend upon how the tokenizer works -- J.B. Moreno As I indicated in my last message, there is no practical difference between
fully qualifying a member with "Me" or not. The compiles IL is the same either way. -Scott Show quoteHide quote "J.B. Moreno" <pl***@newsreaders.com> wrote in message news:040720091218099453%planB@newsreaders.com... > Harry <harryNoSpam@ffapaysmart.com.au> wrote: > >> Thanks for all your advice. I was actually more interested in whether >> there >> was an increase in complier efficiency, as opposed to readability. Guess >> none of you guys have Microsoft Mind Reader 1.0 installed :) > > Depends upon what you mean by compiler efficiency. If you mean > efficiency of the resulting compiled code, then no, there's no increase > in efficiency. > > If you mean does it compile faster, being a mind reader won't help. > It'll depend upon how the tokenizer works > > -- > J.B. Moreno Scott M. <s-mar@nospam.nospam> wrote:
> As I indicated in my last message, there is no practical difference between Uhm, I pretty much said this when I said there's no increase in> fully qualifying a member with "Me" or not. The compiles IL is the same > either way. efficiency in the compiled output. If you need an expansion of that, then here: It's pretty much guaranteed that the two will compile to the same IL and not just do so in some particular instance -- not mathematically, but based upon how you'd have to implement it to get that as the result. And in order to do otherwise, you'd have to know that you were dealing with the hidden instance parameter, but instead of using the normal method of accessing it, you'd create a new variable, assign it the value of the instance parameter, and then use that to access instance values. And the speed of compilation still depends upon how the tokenizer works, but I'd be extremely surprised if one was significantly faster than the other. Show quoteHide quote > "J.B. Moreno" <pl***@newsreaders.com> wrote in message > news:040720091218099453%planB@newsreaders.com... > > Harry <harryNoSpam@ffapaysmart.com.au> wrote: > > > >> Thanks for all your advice. I was actually more interested in whether > >> there > >> was an increase in complier efficiency, as opposed to readability. Guess > >> none of you guys have Microsoft Mind Reader 1.0 installed :) > > > > Depends upon what you mean by compiler efficiency. If you mean > > efficiency of the resulting compiled code, then no, there's no increase > > in efficiency. > > > > If you mean does it compile faster, being a mind reader won't help. > > It'll depend upon how the tokenizer works > > > > -- > > J.B. Moreno > > -- J.B. Moreno
Using WPF with a "normal" windows app
Unable to connect to the remote server How to reference class properties using MyClass("PropertyName") VB Net/Com Interoperability/Late Binding [XPost] - Visual Studio 2008 - Instruct IDE Not To Generate Adapter Client Server app using winsock setting a timeout for web service response NNTP Session Variables in asp.net cancelling a backgroundworker |
|||||||||||||||||||||||