On 8/29/13, Jerry Stuckle <jstuc...@attglobal.net> wrote:
> On 8/29/2013 12:45 AM, Joel Rees wrote:
>> (I really don't have time to do this.)
>>
>> On Thu, Aug 29, 2013 at 12:17 PM,
>>> [Somebody replied to somebody, arguing that C can't do objects.]
>>
>> The syntax does become obtuse, unfun, cluttered, etc., but it can be
>> done.
>>
>
> I didn't say C can't do objects.  I said it can't do Object Oriented
> Programming.  Two entirely different things.
>
>> (To get the neurons connecting, think about early objective-C, when
>> the "object" stuff was done with a special purpose pre-processor.
>>
>> Shoot. Don't forget that C++ itself was once a pre-processor for C.)
>
> That's like saying C is a preprocessor for assembler.  Sure, the
> original C++ tools were preprocessors.  However, they were preprocessors
> which provided the tools necessary to do OOP.

Good start.

>> Admittedly, the "object" syntax becomes a separate syntax and language
>> from the C part when you do OOP in unadorned C. You have to leave the
>> basic operators (+-*/%, etc.) out of the object-oriented language and
>> syntax. (Which is part of the reason it becomes unfun.)
>>
>
> Please show how you can do inheritance and polymorphism in C.

Not so good finish. Looking at the above, we could say "use an
old/original preprocessor"? Or do that preprocessors work by hand?

> And why
> do you need to leave the basic operators out?  They are inherent to both
> languages.
>
>> You have to use #include skillfully, and you have to explicitly put
>> function pointers in structures. It kind of turns things upside down,
>> a bit, and a little inside-out. It'll make even seasoned C programmers
>> seasick. And the syntax is not as flexible as C++.
>>
>
> Again, please show how to do inheritance and polymorphism in C.

As above ...

>> Which is all why C++ was written as a separate language.
>>
>> But it can be done.
>
> Once again, please show how to do inheritance and polymorphism in C.

Next you'll be saying you can't do functional or modular programming
in machine code...

>> By the way, mathematically speaking, objects are machines.
>
> Maybe mathematically speaking, but we're talking programming here.  In
> programming, variables have state.  Functions have behavior.  Objects
> have both state and behavior.

Mathematically, we make ... declarations or assertions :)

0A This byte of ram we shall call a variable.
0B This byte of ram we shall call a pointer.
0C This byte of ram shall be the program start instruction.

It is not only reasonable, but useful to some people learning, to say
that "a programming object ... is like a machine".

So let me "fix" the statement:
"Mathematically speaking, objects are machines; programmatically
speaking, objects are like machines."

That wasn't so hard was it?

Lets be flexible in our understanding of each other, when doing so
causes no problem,
Zenaan


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/CAOsGNSQpQbrXeBfUS=s10zwwbchdpn2ebcxcaxklizha34-...@mail.gmail.com

Reply via email to