At 23:36 2017-02-15, mbsoftwaresolutions@mbsoftwaresolutions.com wrote:
On 2017-02-14 17:29, Gene Wirchenko wrote:
At 01:54 2017-02-14, Dave Crozier DaveC@Flexipol.co.uk wrote:
Mike, It is extremely hands in certain circumstances and can save you loads of extra programming work. However like yourself I tend to forget about it (as opposed to never knowing about it!!) and only after the event do I realise I could have made life easier for myself!!
I might have used it the odd time, but dodefault() does it for me.
but this use of the Scope Resolution operator allowed me to jump 2 levels in the OOP hierarchy, Gene. DODEFAULT(x,y) would have ran the method 1 above, and that's not what I needed. Like I said, at first, it didn't seem very OOP to me, but revisiting it, I suppose it is.
It is not very OOP. I do not know enough about your case to judge whether I would do that, too, but I rather doubt it. It has the smell of a kludge, but sometimes, kludges are necessary.
Sincerely,
Gene Wirchenko
On 2017-02-16 12:52, Gene Wirchenko wrote:
but this use of the Scope Resolution operator allowed me to jump 2 levels in the OOP hierarchy, Gene. DODEFAULT(x,y) would have ran the method 1 above, and that's not what I needed. Like I said, at first, it didn't seem very OOP to me, but revisiting it, I suppose it is.
It is not very OOP. I do not know enough about your case tojudge whether I would do that, too, but I rather doubt it. It has the smell of a kludge, but sometimes, kludges are necessary.
That's EXACTLY what I thought when I saw it over a decade ago. Looks very non-OOP and kludgey. But you're right about sometimes it's necessary, and I can honestly say this implementation I just made saved a lot of coding, and it wasn't too obfuscated.
... the Scope Resolution operator ...is not very OOP. It has the smell of a kludge...
why? javascript** is super oopy/functional and you can 'resolve' right back to the god-object - and 'extend' it!
** I am on record as saying it is the very worst language ever - but I acknowledge I've been trampled in the rush to make it ubiquitous.
why? javascript** is super oopy/functional and you can 'resolve' right back to the god-object - and 'extend' it!
Javascript is prototype-based, and OO is one of the styles of programming it can support. In its raw form it *is* a terrible language IMO, although ECMAScript 6 and transpilers like Typescript are starting to help.
One of the most fun things I've learned about OOP and MVC as I've worked through a couple of languages is that everyone thinks it's a pretty good idea, but no one exactly agrees on what "it" is :) So, in some languages the "parent class" that an instance is based upon may be an object in itself, which can have it's own class-level ("scoped") behaviors and PEMs. So, for a contrived example, you may have an instance of an Invoice that has specific information about its recipients, status, line items, charges and totals, and an Invoice class object that can be queried about all invoices for company X, or a total outstanding value. Sometimes, a scope resolution operator is needed to distinguish between the invoice.total for the instance and the Invoice::total for class. It's OOPy, but a little different than what VFP calls OOP. (Which is different from Java, Python, PHP, Ruby, DotNet, etc.)
The most valuable thing I learned about JavaScript (from the O'Reilly "JavaScript: The Good Parts" by Doug Crockford, a very, very short book) is that JS is not OOP. It is object-based, everything can be an object, but it only has prototype inheritance of properties
On Tue, Feb 21, 2017 at 4:56 AM, AndyHC andy@hawthorncottage.com wrote:
... the Scope Resolution operator ...is not very OOP. It has the smell of a kludge...
why? javascript** is super oopy/functional and you can 'resolve' right back to the god-object - and 'extend' it!
** I am on record as saying it is the very worst language ever - but I acknowledge I've been trampled in the rush to make it ubiquitous.
On 2017-02-21 13:39, Ted Roche wrote:
<snipped> The most valuable thing I learned about JavaScript (from the O'Reilly "JavaScript: The Good Parts" by Doug Crockford, a very, very short book) is that JS is not OOP. It is object-based, everything can be an object, but it only has prototype inheritance of properties
Isn't that how VB6 was? Interface inheritance only? Been almost 20 years so it's a gray memory.