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

Re: What's the easiest and/or simplest part of Linux Kernel?



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.

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. 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.

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.

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.

None of which has anything to do with the simplest part of the Linux
kernel for a newbie to try to drown in.

--
Joel Rees





Reply to: