please please please add THIS aswell as SELF
BlitzMax Forums/BlitzMax Programming/please please please add THIS aswell as SELF
I can't tell you how many times I have written this.field inside a method. It is doing my nut, I am so used to typing this.field in many other languages.
Please please please please please can 'this' be added as an optional alternative to 'self'.
Well you shouldn't be going self.field or this.field, there is no need. Inside a method, just go 'field'. Unless you're naming your arguments to a method the same as your fields and if you're doing that, don't and you'll be OK.
Aaron
What Aaron said. Both self/this are only supposed to be used when passing an object on to another method as an arguement!
Ok well my point still stands :) I simply prefer this to self.
also, if self=list.first()
I've been using Self.blah inside methods to keep it as clear as possible what's going on.
Tom, give it up :). Use some other method. Maybe underscore your member/private fields (They should all be private really) so it's easy to understand and a lot less typing :)
Aaron
Why? Self. takes a split second to type :)
And an underscore even less, 1/5th the time :)
I'm glad you guys (and gals?) are talking about this `self` stuff, at least, I was beginning to wonder if it was needed inside a method or not. Cheers.
I guess it doesn't make things any slower to add the self. part?
Aaronk: I give _ a go, what I found was that I need to look at the keyboard when I type shift & - (too many typos), where as I don't typing Self :)
Self.Cya!
Tom :)
Hahaha! Fair enough! ;)