Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!137.226.231.214.MISMATCH!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail From: =?UTF-8?B?Sm9zaHVhIENyYW5tZXIg8J+Qpw==?= Newsgroups: comp.lang.java.programmer Subject: Re: Final Fantasy 2 based game source code Date: Fri, 22 Mar 2013 10:19:49 -0500 Organization: A noiseless patient Spider Lines: 54 Message-ID: References: <171686ae-5239-4502-9ef3-65a68e8a1a1d@googlegroups.com> <514a53c7$0$32110$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Fri, 22 Mar 2013 15:17:56 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="d4f756ecbcafbdef0d455e61327651f3"; logging-data="1949"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/pY3GRoZd9oyak7g46f/gztrlHtrfvdV4=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Thunderbird/20.0 In-Reply-To: Cancel-Lock: sha1:CGaHxb8MEFRz1/BirudjBNXBCI8= Xref: csiph.com comp.lang.java.programmer:23062 On 3/22/2013 4:18 AM, lipska the kat wrote: > On 21/03/13 19:29, Lew wrote: >> Arne Vajhøj wrote: >>> Lew wrote: >>>> Fredrik Jonson wrote: > > [snip] > >> Not colorful, technical. >> >>> "antithesis of object oriented" >> >> Object oriented means to collect behaviors into types with attributes, >> and operate >> on objects of those types. > > This is a very poor description of OO. > > In C I can do something like > > struct node{ > int value; > struct node *next; > }; > > struct stack{ > struct node **sp; > void (*push)(int i); > int (*pop)(); > int (*top)(); > }; > > void foo(){ > struct stack *notOO = malloc(sizeof(struct stack)); > } > > According to you then this is Object Oriented ... interesting > interpretation. It is object-oriented, just very messy since C doesn't support the OOP paradigm very well. For more examples of object-oriented programming in C, you could look at the GObject libraries, or feast your eyes on libmime (). They both support all the salient features of OOP: implementation hiding (to a degree), polymorphic message dispatch, centralization of behaviors in types, overriding, and even advanced features akin to C++ RTTI or (a subset of) Java's reflection. It just makes your eyes boil due to relying on an abundance of magic macros and function pointers. -- Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald E. Knuth