473,322 Members | 1,241 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,322 software developers and data experts.

Subclassing, Inheritance, RE subclass "constructor" and inherited members

// Referring to JavaScript the Definitive Guide: 9.5 through 9.5.2

// the base and sub classes are perfect. the following code
// is an example case, regarding WHY delete base members from
// a subclass AND what is wrong with the loop ONLY
// returning -prototype :/

// Ex 01:
print(subInstance.hasOwnProperty("baseMember")); // false
for (var p in SubClass){
print(p);
} // prototype
// Ex 02:
delete SubClass.prototype.baseMember; // not customizing, delete?
print(subInstance.hasOwnProperty("baseMember")); // false
for (var p in SubClass){
print(p);
} // prototype

// Why delete the members in subclass if I inherit them from
// baseclass? is it the same reason you might want to put constants
// & methods in the prototype? Is it to avoid duplication and memory
// hogging? e.g., I don't actually need to override the base members
// so should I really delete them from subclass?

// Why iterating over the properties in the subclass yield ONLY ->
// prototype? shouldn't I at least get all properties back defined in
// ALL classes (Ex 01) AND after deleting those inherited from base on
// sub, shouldn't I at least get those properties of sub (Ex 02)? Both
// Examples, have several members!

Aug 28 '07 #1
5 1278
Thomas 'PointedEars' Lahn said the following on 8/28/2007 5:27 PM:
vbgunz wrote:
>// Referring to JavaScript the Definitive Guide: 9.5 through 9.5.2

Argh! Shall we not remove that recommendation from the FAQ already?
If you give me a better viable alternative I will be glad to change it.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
FAQ Notes: http://www.jibbering.com/faq/faq_notes/faq_notes.html
ECMAScript Language Specification via FAQ2.6
Aug 28 '07 #2
In comp.lang.javascript message <h5*********************@giganews.com>,
Wed, 29 Aug 2007 01:12:09, Randy Webb <Hi************@aol.composted:
The last time that section came up it was pointed out that if the FAQ
doesn't list a book then people will post a kazillion times asking
"What book....." because there isn't one in the FAQ. That said, I do
agree with the assertion that the entry should be expanded to explain
that it isn't a "flawless" book but that it is the "least flawless" of
the books available.

So : you are the FAQ maintainer, and you should therefore expand it.

If you can bring yourself to update the published version of the FAQ
whenever you have new material, rather than waiting an indefinite time
to produce a highly-polished version, then there's no problem with the
content. Just make a significant change to the section (preferably just
before Bart posts it), and with "Altered YYYY-MM-DD", and, as you
yourself have recognised, you'll soon be told if you've got it wrong --
and in enough detail for the next version to be nearly right.

IMHO, there's not much point in recommending an out-of-print book.

However, O'Reilly are being somewhat despicable in asking £35.50 for a
book they sell at $49.99 - Bloomberg puts the pound at 2.021 USD at the
moment, so £24.75 would be about right. And my IE6 won't show the ToC
happily.

FAQ :
Delete the first two lines, and the 4th Edn links.
Move the reference to the Pocket book to the bottom of 3.1.
Now move the blog bit to the bottom.
Change paragraph "The Fifth Edition ..." to "One of the best books is -"
Change "By" to "by".
Correct the spelling.
Adjust the layout slightly to use fewer non-empty lines.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Delphi 3? Turnpike 6.05
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/&c., FAQqy topics & links;
<URL:http://www.bancoems.com/CompLangPascalDelphiMisc-MiniFAQ.htmclpdmFAQ;
<URL:http://www.borland.com/newsgroups/guide.htmlnews:borland.* Guidelines
Aug 30 '07 #3
Dr J R Stockton said the following on 8/30/2007 5:13 PM:
In comp.lang.javascript message <h5*********************@giganews.com>,
Wed, 29 Aug 2007 01:12:09, Randy Webb <Hi************@aol.composted:
>The last time that section came up it was pointed out that if the FAQ
doesn't list a book then people will post a kazillion times asking
"What book....." because there isn't one in the FAQ. That said, I do
agree with the assertion that the entry should be expanded to explain
that it isn't a "flawless" book but that it is the "least flawless" of
the books available.


So : you are the FAQ maintainer, and you should therefore expand it.
What is it about plain English that you can not comprehend? I won't
waste the time to try to explain it again.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Aug 31 '07 #4
In comp.lang.javascript message <mM*********************@giganews.com>,
Thu, 30 Aug 2007 21:20:35, Randy Webb <Hi************@aol.composted:
>Dr J R Stockton said the following on 8/30/2007 5:13 PM:
>In comp.lang.javascript message <h5*********************@giganews.com>,
Wed, 29 Aug 2007 01:12:09, Randy Webb <Hi************@aol.composted:
>>The last time that section came up it was pointed out that if the
FAQ
doesn't list a book then people will post a kazillion times asking
"What book....." because there isn't one in the FAQ. That said, I do
agree with the assertion that the entry should be expanded to explain
that it isn't a "flawless" book but that it is the "least flawless" of
the books available.
So : you are the FAQ maintainer, and you should therefore expand
it.

What is it about plain English that you can not comprehend? I won't
waste the time to try to explain it again.
You should spend your time in producing and publishing up-to-date FAQ
releases. You would then not be tempted to waste your time in self-
exculpatory posts.

I cannot understand any honourable explanation for your taking on the
maintenance of the group FAQ when you clearly have no intention of doing
the job in the customary and effective manner.

You should resign, or be deposed.

You could stand for re-appointment by the group, but we now know how
useless you are.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/- FAQish topics, acronyms, & links.
Plaintext, quoting : see <URL:http://www.usenet.org.uk/ukpost.html>
Do not Mail News to me. Before a reply, quote with ">" or "" (SoRFC1036)
Sep 1 '07 #5
Dr J R Stockton said the following on 9/1/2007 11:17 AM:
In comp.lang.javascript message <mM*********************@giganews.com>,
Thu, 30 Aug 2007 21:20:35, Randy Webb <Hi************@aol.composted:
>Dr J R Stockton said the following on 8/30/2007 5:13 PM:
>>In comp.lang.javascript message <h5*********************@giganews.com>,
Wed, 29 Aug 2007 01:12:09, Randy Webb <Hi************@aol.composted:

The last time that section came up it was pointed out that if the
FAQ
doesn't list a book then people will post a kazillion times asking
"What book....." because there isn't one in the FAQ. That said, I do
agree with the assertion that the entry should be expanded to explain
that it isn't a "flawless" book but that it is the "least flawless" of
the books available.
So : you are the FAQ maintainer, and you should therefore expand
it.
What is it about plain English that you can not comprehend? I won't
waste the time to try to explain it again.
I see that you ignored the question.
You should spend your time in producing and publishing up-to-date FAQ
releases. You would then not be tempted to waste your time in self-
exculpatory posts.
I will, after you answer the question.
I cannot understand any honourable explanation for your taking on the
maintenance of the group FAQ when you clearly have no intention of doing
the job in the customary and effective manner.
Of course, nothing I present to you would be considered "honorable" by
you so there isn't much point in me wasting my time trying - yet again -
to explain it to you. I have pointed you to the thread where I explained
that my time was limited for a while and even why it was limited. You
just didn't seem to be able to comprehend what you read.
You should resign, or be deposed.
If the group wants me to give it up, I will. Not a problem with it
either. I have offered to you, several times, a way to "solve the
problem" and to date you have not done anything about it but whine
incessantly about it because you don't want to do anything *but* whine
about it.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Sep 2 '07 #6

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

Similar topics

9
by: Pierre Senellart | last post by:
The C++ standard states (26.3.2.1), about std::valarray constructors: > explicit valarray(size_t); > > The array created by this constructor has a length equal to the value of > the argument....
2
by: srktnc | last post by:
When I run the program, I get a Debug Error saying "This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more...
3
by: hazz | last post by:
Is Activator.CreateInstance(t,BindingFlags.Public | BindingFlags.InvokeMethod | BindingFlags.CreateInstance, null, args, null) appropriate given the following; ...
7
by: hazz | last post by:
this is a repost with more concise code (well, for me) and better questions (I hope....) . given the following two classes, my intent is to use either Activator.CreateInstance or InvokeMember pass...
19
by: Martin Oddman | last post by:
Hi, I have a compiling problem. Please take a look at the code below. I have an application that is built upon three tiers: one data tier (Foo.DataManager), one business tier (Foo.Kernel) and...
4
by: Dan Stromberg | last post by:
Hi folks. I'm working on building some software, some of which is written in C++, for a researcher here at the University. I have an extensive background in C and python, but I haven't done...
8
by: Asfand Yar Qazi | last post by:
Hi, I have the following header file in my 'everything useful I think of in one place' library: ============= BEGIN CODE SNIPPET =========== /** All classes that derive from this obtain a...
9
by: Joseph Turian | last post by:
Consider this code snippet which doesn't compile: struct DebugOptions { }; class Debug { public: Debug(const DebugOptions options) { _options = options; } private:
1
by: Bart Simpson | last post by:
Can anyone explain the concept of "slicing" with respect to the "virtual constructor" idiom as explain at parashift ? From parashift: class Shape { public: virtual ~Shape() { } ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.