octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nested classes style question


From: Rik
Subject: Re: nested classes style question
Date: Fri, 17 Nov 2017 11:25:00 -0800

On 11/17/2017 09:00 AM, address@hidden wrote:
Subject:
nested classes style question
From:
"John W. Eaton" <address@hidden>
Date:
11/16/2017 10:13 AM
To:
Octave Maintainers List <address@hidden>
List-Post:
<mailto:address@hidden>
Content-Transfer-Encoding:
7bit
Precedence:
list
MIME-Version:
1.0
Message-ID:
<address@hidden>
Content-Type:
text/plain; charset=utf-8; format=flowed
Message:
1

Back in the day, I thought nested classes were cool.  I thought using them would help describe the structure of a program by saying "this object is clearly part of this other object".  Maybe that's true when the nested class is never used independently outside of the parent class.  But now they just seem to serve to clutter class declarations and cause a lot of extra overhead that doesn't add much clarity.

I'm thinking specifically of the scope and symbol_record classes that are nested inside the symbol_table class.  Would anyone object to moving the symbol_record and scope classes to separate files and declaring them outside of the symbol_table class?  As far as I can see, backward compatibility with the old symbol_table::scope or symbol_table::symbol_record can be handled with a couple of typedefs.

Comments or suggestions?

Being a late comer to object oriented programming, I found the nested classes as yet one more confusing construct of a confusing new paradigm.  I'm better these days with ordinary classes, but I still don't see much advantage to nested classes.  No objection here to removing them.

--Rik


reply via email to

[Prev in Thread] Current Thread [Next in Thread]