June 14, 2003
"Andy Friesen" <andy@ikagames.com> wrote in message bcfu95$10g9$1@digitaldaemon.com
> DRS wrote:
>> "Ilya Minkov" <webmaster@midiclub.de.vu> wrote in message bcdnsu$1ule$1@digitaldaemon.com
>>
>> [...]
>>
>>
>>>Records *can* be considered "lightweight object". Look at the left part of the table, it says C:YES, C++:YES, Java: NO (IIRC). And guess what's the only thing next to the objects is which C supports?
>>
>>
>> Pascal records do not encapsulate both data and code; they do not have methods.  They therefore are not objects in any meaningful sense.  The deprecated "object" type is an object in the OO sense but inferior to the current "class" type.
>
> Neither do C structs, but they obviously qualify.

Why obviously?

-- 

 A: Top-posters.
 Q: What is the most annoying thing on Usenet?


June 14, 2003
>> Neither do C structs, but they obviously qualify.
>
> Why obviously?

Because C is listed as having "lightweight objects" in the comparision chart while not having any higher-level object-alike primitives than structs and unions.


June 15, 2003
Fabian Giesen wrote:

> Because C is listed as having "lightweight objects" in the comparision chart while not having any higher-level object-alike primitives than structs and unions.

I'll pur the counter-argument: This is another error in the table, like C++ modules <gdr>

-- 
AlisdairM
Team Thai Kingdom
June 15, 2003
"Alisdair Meredith" <alisdair.meredith@uk.renaultf1.com> wrote in message 3EEC8705.4E9D68D6@uk.renaultf1.com
> Fabian Giesen wrote:
>
>> Because C is listed as having "lightweight objects" in the comparision chart while not having any higher-level object-alike primitives than structs and unions.
>
> I'll pur the counter-argument: This is another error in the table, like C++ modules <gdr>

I'd agree.  What is a "lightweight" object anyway?  At the minimum an object must provide encapsulation, polymorphism and inheritance, otherwise you might as well say that Visual Basic's "class" is an object!

-- 

 A: Top-posters.
 Q: What is the most annoying thing on Usenet?


June 15, 2003
"DRS" <drs@removethis.ihug.com.au> wrote in message news:bcig8b$2b5$1@digitaldaemon.com...
> "Alisdair Meredith" <alisdair.meredith@uk.renaultf1.com> wrote in message 3EEC8705.4E9D68D6@uk.renaultf1.com
> > Fabian Giesen wrote:
> >
> >> Because C is listed as having "lightweight objects" in the comparision chart while not having any higher-level object-alike primitives than structs and unions.
> >
> > I'll pur the counter-argument: This is another error in the table, like C++ modules <gdr>
>
> I'd agree.  What is a "lightweight" object anyway?  At the minimum an
object
> must provide encapsulation, polymorphism and inheritance, otherwise you might as well say that Visual Basic's "class" is an object!

I assume that by light-weight objects they were referring to stack-based OOP like C, C++, C# and Delphi (with object) offer.

sm


June 15, 2003
DRS wrote:
> I'd agree.  What is a "lightweight" object anyway?  At the minimum an object
> must provide encapsulation, polymorphism and inheritance, otherwise you
> might as well say that Visual Basic's "class" is an object!

Nope. I believe that you very often need a simple agregate, which has only a handful of fields and involves as little overhead as possible. That means:
 - fast handling on stack, as well as by pointer or reference. Obviuosly polymorphic objects incur more overhead, because the space which they need cannot be determined at compile-time, making stack copy allocation impossible.
 - no VTable pointer -- since this would be a significant overhead for agregates consisting of only 2 or 3 fields.

this obviously kills polymorphism to 100%, and inheritance stops making much sense in this context either.

But look at the source of DMD itself: i believe most of the "objects" there are lightweights, and as such are only a way to better organize the code operating on usual C structs. These have an extremely wide use in C++ projects, especially in those highly focused on performace.

-i.

June 16, 2003
"Ilya Minkov" <webmaster@midiclub.de.vu> wrote in message bcimlj$7js$1@digitaldaemon.com
> DRS wrote:
>> I'd agree.  What is a "lightweight" object anyway?  At the minimum an object must provide encapsulation, polymorphism and inheritance, otherwise you might as well say that Visual Basic's "class" is an object!
>
> Nope. I believe that you very often need a simple agregate, which has only a handful of fields and involves as little overhead as possible.

Whatever they are they're manifestly not objects.

-- 

 A: Top-posters.
 Q: What is the most annoying thing on Usenet?


June 18, 2003
"DRS" <drs@removethis.ihug.com.au> wrote in message news:bckrp7$24ov$1@digitaldaemon.com...
> "Ilya Minkov" <webmaster@midiclub.de.vu> wrote in message bcimlj$7js$1@digitaldaemon.com
> > DRS wrote:
> >> I'd agree.  What is a "lightweight" object anyway?  At the minimum an object must provide encapsulation, polymorphism and inheritance, otherwise you might as well say that Visual Basic's "class" is an
object!
> >
> > Nope. I believe that you very often need a simple agregate, which has only a handful of fields and involves as little overhead as possible.
>
> Whatever they are they're manifestly not objects.

I disagree.  It's basically an object without virtual functions.  You can still do a LOT of OO that way.  You still gain many of the OO "benefits"... encapsulation, inheritance, data hiding (not in C); just not polymorphism.

More than half of the classes I write are these kind of lightweight classes.

I do like to package datatypes with the code that works on them.  However I'm not 100% sold that OO-style syntax is a good idea, as many times it's unclear which class should be promoted to "this" status, if a function works with several different class parameters.

Sean

>  A: Top-posters.
>  Q: What is the most annoying thing on Usenet?

Isn't this a FAQ?  You get the answers before you ask the questions.

Sean


September 06, 2005
In article <bc2bgf$nft$1@digitaldaemon.com>, DRS says...
>
>"Ilya Minkov" <midiclub@8ung.at> wrote in message bc290l$ks1$1@digitaldaemon.com
>> DRS wrote:
>>> "Ilya Minkov" <midiclub@8ung.at> wrote in message
>>>>Who found function overloading in Delphi? I believe it's not possible.
>>
>> Yeah, yeah, i know already. It just wasn't yet there as i learned Delphi, and i have not made a step past 3.0 -- and this feature was added in 4.0.
>
>D8 will be out around the end of the year.  You have a lot of catching up to
>do!
>hey waz up you are welling to have a friend.

>-- 
>
> A: Top-posters.
> Q: What is the most annoying thing on Usenet?
>
>


1 2 3 4 5 6 7 8 9
Next ›   Last »