Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #22971 > unrolled thread
| Started by | Turtle Wizard <elvishNOSPAM.healer@gmail.com> |
|---|---|
| First post | 2013-03-19 22:26 +0100 |
| Last post | 2013-03-24 14:16 +0000 |
| Articles | 20 on this page of 82 — 17 participants |
Back to article view | Back to comp.lang.java.programmer
Final Fantasy 2 based game source code Turtle Wizard <elvishNOSPAM.healer@gmail.com> - 2013-03-19 22:26 +0100
Re: Final Fantasy 2 based game source code Lew <lewbloch@gmail.com> - 2013-03-19 18:49 -0700
Re: Final Fantasy 2 based game source code Fredrik Jonson <fredrik@jonson.org> - 2013-03-20 07:18 +0000
Re: Final Fantasy 2 based game source code "Qu0ll" <Qu0llSixFour@gmail.com> - 2013-03-20 20:28 +1100
Re: Final Fantasy 2 based game source code Fredrik Jonson <fredrik@jonson.org> - 2013-03-20 13:34 +0000
Re: Final Fantasy 2 based game source code Lew <lewbloch@gmail.com> - 2013-03-20 12:07 -0700
Re: Final Fantasy 2 based game source code Arne Vajhøj <arne@vajhoej.dk> - 2013-03-20 20:26 -0400
Re: Final Fantasy 2 based game source code "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2013-03-21 08:11 +0000
Re: Final Fantasy 2 based game source code "Qu0ll" <Qu0llSixFour@gmail.com> - 2013-03-21 20:58 +1100
Re: Final Fantasy 2 based game source code Lew <lewbloch@gmail.com> - 2013-03-21 12:29 -0700
Re: Final Fantasy 2 based game source code lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-21 20:34 +0000
Re: Final Fantasy 2 based game source code Arne Vajhøj <arne@vajhoej.dk> - 2013-03-21 17:56 -0400
Re: Final Fantasy 2 based game source code Lew <lewbloch@gmail.com> - 2013-03-21 15:24 -0700
Re: Final Fantasy 2 based game source code lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-22 09:18 +0000
Re: Final Fantasy 2 based game source code Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-03-22 07:15 -0300
Re: Final Fantasy 2 based game source code lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-22 13:54 +0000
Re: Final Fantasy 2 based game source code Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2013-03-22 10:25 -0700
Re: Final Fantasy 2 based game source code lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-22 18:14 +0000
Re: Final Fantasy 2 based game source code Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2013-03-22 13:22 -0700
Re: Final Fantasy 2 based game source code lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-22 20:26 +0000
Re: Final Fantasy 2 based game source code Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2013-03-22 13:32 -0700
Re: Final Fantasy 2 based game source code lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-22 21:39 +0000
Re: Final Fantasy 2 based game source code "Qu0ll" <Qu0llSixFour@gmail.com> - 2013-03-23 08:50 +1100
Re: Final Fantasy 2 based game source code Lars Enderin <lars.enderin@telia.com> - 2013-03-22 23:26 +0100
Re: Final Fantasy 2 based game source code "Qu0ll" <Qu0llSixFour@gmail.com> - 2013-03-23 09:39 +1100
Re: Final Fantasy 2 based game source code Arne Vajhøj <arne@vajhoej.dk> - 2013-03-22 20:15 -0400
Re: Final Fantasy 2 based game source code Arne Vajhøj <arne@vajhoej.dk> - 2013-03-22 20:12 -0400
Re: Final Fantasy 2 based game source code Arne Vajhøj <arne@vajhoej.dk> - 2013-03-22 20:08 -0400
Re: Final Fantasy 2 based game source code "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2013-03-23 10:59 +0000
Re: Final Fantasy 2 based game source code Martin Gregorie <martin@address-in-sig.invalid> - 2013-03-23 15:33 +0000
Re: Final Fantasy 2 based game source code Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2013-03-22 10:19 -0500
Re: Final Fantasy 2 based game source code lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-22 16:57 +0000
Re: Final Fantasy 2 based game source code Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2013-03-22 14:07 -0500
Re: Final Fantasy 2 based game source code lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-22 20:09 +0000
Re: Final Fantasy 2 based game source code Arne Vajhøj <arne@vajhoej.dk> - 2013-03-22 20:31 -0400
Re: Final Fantasy 2 based game source code lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-23 08:54 +0000
Re: Final Fantasy 2 based game source code Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2013-03-23 23:01 -0500
Re: Final Fantasy 2 based game source code lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-24 10:04 +0000
Re: Final Fantasy 2 based game source code Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-03-24 17:07 -0300
Re: Final Fantasy 2 based game source code lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-25 09:19 +0000
Re: Final Fantasy 2 based game source code lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-25 09:26 +0000
Re: Final Fantasy 2 based game source code Arne Vajhøj <arne@vajhoej.dk> - 2013-03-22 20:49 -0400
Re: Final Fantasy 2 based game source code "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2013-03-23 11:12 +0000
Re: Final Fantasy 2 based game source code lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-23 15:24 +0000
Re: Final Fantasy 2 based game source code Martin Gregorie <martin@address-in-sig.invalid> - 2013-03-23 16:21 +0000
Re: Final Fantasy 2 based game source code lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-23 17:10 +0000
Re: Final Fantasy 2 based game source code Martin Gregorie <martin@address-in-sig.invalid> - 2013-03-23 18:27 +0000
Re: Final Fantasy 2 based game source code lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-23 18:51 +0000
Re: Final Fantasy 2 based game source code Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-03-23 22:00 -0300
Re: Final Fantasy 2 based game source code Arne Vajhøj <arne@vajhoej.dk> - 2013-03-22 20:19 -0400
Re: Final Fantasy 2 based game source code "Qu0ll" <Qu0llSixFour@gmail.com> - 2013-03-21 14:12 +1100
Re: Final Fantasy 2 based game source code lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-21 09:06 +0000
Re: Final Fantasy 2 based game source code "Qu0ll" <Qu0llSixFour@gmail.com> - 2013-03-21 20:57 +1100
Re: Final Fantasy 2 based game source code lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-21 10:42 +0000
Re: Final Fantasy 2 based game source code "Qu0ll" <Qu0llSixFour@gmail.com> - 2013-03-21 22:11 +1100
Re: Final Fantasy 2 based game source code lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-21 11:53 +0000
Re: Final Fantasy 2 based game source code Arne Vajhøj <arne@vajhoej.dk> - 2013-03-21 17:58 -0400
Re: Final Fantasy 2 based game source code lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-20 13:51 +0000
Re: Final Fantasy 2 based game source code Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2013-03-20 09:28 -0500
Re: Final Fantasy 2 based game source code lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-20 15:03 +0000
Re: Final Fantasy 2 based game source code Arne Vajhøj <arne@vajhoej.dk> - 2013-03-20 20:32 -0400
Re: Final Fantasy 2 based game source code Joerg Meier <joergmmeier@arcor.de> - 2013-03-20 17:52 +0100
Re: Final Fantasy 2 based game source code lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-20 17:43 +0000
Re: Final Fantasy 2 based game source code "Qu0ll" <Qu0llSixFour@gmail.com> - 2013-03-21 10:01 +1100
Re: Final Fantasy 2 based game source code lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-21 08:35 +0000
Re: Final Fantasy 2 based game source code Arne Vajhøj <arne@vajhoej.dk> - 2013-03-20 20:35 -0400
Re: Final Fantasy 2 based game source code Arne Vajhøj <arne@vajhoej.dk> - 2013-03-20 20:18 -0400
Re: Final Fantasy 2 based game source code Jim Janney <jjanney@shell.xmission.com> - 2013-03-22 18:00 -0600
Re: Final Fantasy 2 based game source code "Qu0ll" <Qu0llSixFour@gmail.com> - 2013-03-23 11:08 +1100
Re: Final Fantasy 2 based game source code Arne Vajhøj <arne@vajhoej.dk> - 2013-03-22 20:26 -0400
Re: Final Fantasy 2 based game source code Joerg Meier <joergmmeier@arcor.de> - 2013-03-20 12:41 +0100
Re: Final Fantasy 2 based game source code paul.cager@gmail.com - 2013-03-20 05:59 -0700
Re: Final Fantasy 2 based game source code Joerg Meier <joergmmeier@arcor.de> - 2013-03-20 17:49 +0100
Re: Final Fantasy 2 based game source code Lars Enderin <lars.enderin@telia.com> - 2013-03-20 20:33 +0100
Re: Final Fantasy 2 based game source code Joerg Meier <joergmmeier@arcor.de> - 2013-03-20 23:15 +0100
Re: Final Fantasy 2 based game source code Lars Enderin <lars.enderin@telia.com> - 2013-03-21 00:11 +0100
Re: Final Fantasy 2 based game source code Joerg Meier <joergmmeier@arcor.de> - 2013-03-21 00:27 +0100
Re: Final Fantasy 2 based game source code Arne Vajhøj <arne@vajhoej.dk> - 2013-03-20 20:39 -0400
Re: Final Fantasy 2 based game source code Gene Wirchenko <genew@telus.net> - 2013-03-21 10:01 -0700
Re: Final Fantasy 2 based game source code Arne Vajhøj <arne@vajhoej.dk> - 2013-03-21 17:39 -0400
Re: Final Fantasy 2 based game source code Joerg Meier <joergmmeier@arcor.de> - 2013-03-22 01:21 +0100
Re: Final Fantasy 2 based game source code bubble <bubble@soft29.vub.ac.be> - 2013-03-24 14:16 +0000
Page 2 of 5 — ← Prev page 1 [2] 3 4 5 Next page →
| From | Daniel Pitts <newsgroup.nospam@virtualinfinity.net> |
|---|---|
| Date | 2013-03-22 13:32 -0700 |
| Message-ID | <ud33t.185892$Nq4.183067@newsfe21.iad> |
| In reply to | #23071 |
On 3/22/13 1:26 PM, lipska the kat wrote: > On 22/03/13 20:22, Daniel Pitts wrote: >> On 3/22/13 11:14 AM, lipska the kat wrote: >>> On 22/03/13 17:25, Daniel Pitts wrote: >>>> On 3/22/13 6:54 AM, lipska the kat wrote: >>>>> On 22/03/13 10:15, Arved Sandstrom wrote: >>>>>> On 03/22/2013 06:18 AM, lipska the kat wrote: >>>>>>> On 21/03/13 19:29, Lew wrote: >>> >>> [snip] >>> >>>> What, to you, is the definition of Object Oriented Programming? >>> >>> I've responded up thread, why don't you read that before jumping in gob >>> first. >> "Up thread" has no reference to the definition of Object Oriented >> Programming. You provide what you consider a counter-example, but that >> doesn't make a definition. >> >> How about you answer the question still on the table. >> >> What is your definition of Object Oriented Programming? > > Programming is what you do to your washing machine. > I suggest you stick to that if you can't find the relevant text Ad hominem attacks won't win arguments here. You know nothing of my background or capabilities. Don't presume to. > I'm not about to repeat myself. Copy and paste isn't exactly repeating, but what ever. I did find your discussion (on a different fork of the thread) of what you say is a "Key Concept" of OO, but no definition. Information hiding is a technique used in OO design. It is not a requirement, nor definition of OO programming. You still have not defined OO.
[toc] | [prev] | [next] | [standalone]
| From | lipska the kat <"nospam at neversurrender dot co dot uk"> |
|---|---|
| Date | 2013-03-22 21:39 +0000 |
| Message-ID | <1O-dnfQyg_rnUtHMnZ2dnUVZ8vCdnZ2d@bt.com> |
| In reply to | #23072 |
On 22/03/13 20:32, Daniel Pitts wrote: > On 3/22/13 1:26 PM, lipska the kat wrote: >> On 22/03/13 20:22, Daniel Pitts wrote: >>> On 3/22/13 11:14 AM, lipska the kat wrote: >>>> On 22/03/13 17:25, Daniel Pitts wrote: >>>>> On 3/22/13 6:54 AM, lipska the kat wrote: >>>>>> On 22/03/13 10:15, Arved Sandstrom wrote: >>>>>>> On 03/22/2013 06:18 AM, lipska the kat wrote: >>>>>>>> On 21/03/13 19:29, Lew wrote: [snip] >> Programming is what you do to your washing machine. >> I suggest you stick to that if you can't find the relevant text > Ad hominem attacks won't win arguments here. You know nothing of my > background or capabilities. And I care even less quite frankly. > Information hiding is a technique used in OO design. It is not a > requirement, I never said it was, I said information hiding aids and supports encapsulation, don't put words into my mouth. Besides information hiding is not a technique it is a paradigm, a distinct concept that has a particular meaning when discussing encapsulation. Encapsulation without information hiding is meaningless, Encapsulation in Object Oriented Software Engineering employs information hiding to provide a safe interface to Object state. This means that the implementation of that state can change without impacting existing clients. In this way it, OOSE, can help with maintenance, if we can control access to state we can be more sure that our systems are correct and that nobody can bypass our control and manipulate state in a way we never intended. nor definition of OO programming. You still have not > defined OO. Encapsulation, Inheritance and Polymorphism. lmgtfy.com/?q=Object+Oriented+Programming lipska -- Lipska the Kat©: Troll hunter, sandbox destroyer and farscape dreamer of Aeryn Sun
[toc] | [prev] | [next] | [standalone]
| From | "Qu0ll" <Qu0llSixFour@gmail.com> |
|---|---|
| Date | 2013-03-23 08:50 +1100 |
| Message-ID | <UsKdnX72dqrwT9HMnZ2dnUVZ_i2dnZ2d@westnet.com.au> |
| In reply to | #23072 |
"Daniel Pitts" wrote in message news:ud33t.185892$Nq4.183067@newsfe21.iad... > Ad hominem attacks won't win arguments here. You know nothing of my > background or capabilities. Don't presume to. Haven't you worked it out yet that lipska the kat == Paul? This thread is going to be just another of those which drags on for months with said troll arguing for the sake of arguing and the original topic completely forgotten. -- And loving it, -Qu0ll (Rare, not extinct) _________________________________________________ Qu0llSixFour@gmail.com [Replace the "SixFour" with numbers to email me]
[toc] | [prev] | [next] | [standalone]
| From | Lars Enderin <lars.enderin@telia.com> |
|---|---|
| Date | 2013-03-22 23:26 +0100 |
| Message-ID | <514CDA8C.4020804@telia.com> |
| In reply to | #23074 |
2013-03-22 22:50, Qu0ll skrev: > "Daniel Pitts" wrote in message > news:ud33t.185892$Nq4.183067@newsfe21.iad... > >> Ad hominem attacks won't win arguments here. You know nothing of my >> background or capabilities. Don't presume to. > > Haven't you worked it out yet that lipska the kat == Paul? > No way lipska could be Paul Derbyshire. -- Lars Enderin
[toc] | [prev] | [next] | [standalone]
| From | "Qu0ll" <Qu0llSixFour@gmail.com> |
|---|---|
| Date | 2013-03-23 09:39 +1100 |
| Message-ID | <2qGdncaqvIRxQNHMnZ2dnUVZ_oudnZ2d@westnet.com.au> |
| In reply to | #23075 |
"Lars Enderin" wrote in message news:514CDA8C.4020804@telia.com... >> Haven't you worked it out yet that lipska the kat == Paul? >> > > No way lipska could be Paul Derbyshire. Hmm perhaps not, who was that other troll, News Maestro? Looking eerily similar. Don't expect this thread to end anytime soon. -- And loving it, -Qu0ll (Rare, not extinct) _________________________________________________ Qu0llSixFour@gmail.com [Replace the "SixFour" with numbers to email me]
[toc] | [prev] | [next] | [standalone]
| From | Arne Vajhøj <arne@vajhoej.dk> |
|---|---|
| Date | 2013-03-22 20:15 -0400 |
| Message-ID | <514cf411$0$32114$14726298@news.sunsite.dk> |
| In reply to | #23075 |
On 3/22/2013 6:26 PM, Lars Enderin wrote: > 2013-03-22 22:50, Qu0ll skrev: >> "Daniel Pitts" wrote in message >> news:ud33t.185892$Nq4.183067@newsfe21.iad... >> >>> Ad hominem attacks won't win arguments here. You know nothing of my >>> background or capabilities. Don't presume to. >> >> Haven't you worked it out yet that lipska the kat == Paul? > > No way lipska could be Paul Derbyshire. Maybe he is - maybe he is not. Does it matter whether it is him or somebody similar? I don't think so. Arne
[toc] | [prev] | [next] | [standalone]
| From | Arne Vajhøj <arne@vajhoej.dk> |
|---|---|
| Date | 2013-03-22 20:12 -0400 |
| Message-ID | <514cf380$0$32114$14726298@news.sunsite.dk> |
| In reply to | #23067 |
On 3/22/2013 1:25 PM, Daniel Pitts wrote: > On 3/22/13 6:54 AM, lipska the kat wrote: >> On 22/03/13 10:15, Arved Sandstrom wrote: >>> On 03/22/2013 06: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. >>>> >> >> [snip] >> >>>> >>> It doesn't have to be implemented the way you did it, >> >> Not sure what your point is here. I did it this way as it's the nearest >> I can get to encapsulating a stack in C. >> >> If the criteria for calling something OO is something that >> >> <cite> >> collect[s] behaviors into types with attributes, and operate[s] >> on objects of those types >> </cite> >> >> Then my C code is OO ... except we both know that is isn't. >> > It sure looked OO to me. > > A program can be OO without having the language support OO inherently. > You're snippet is a perfect example of that. Yes. ISA's are practically never OO, so OO can be done using PP language constructs only. And in fact the first C++ compilers (cfront) did not generate object code - it generated C code. Arne
[toc] | [prev] | [next] | [standalone]
| From | Arne Vajhøj <arne@vajhoej.dk> |
|---|---|
| Date | 2013-03-22 20:08 -0400 |
| Message-ID | <514cf299$0$32107$14726298@news.sunsite.dk> |
| In reply to | #23060 |
On 3/22/2013 9:54 AM, lipska the kat wrote: > On 22/03/13 10:15, Arved Sandstrom wrote: >> On 03/22/2013 06: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. >>> > > [snip] > >>> >> It doesn't have to be implemented the way you did it, > > Not sure what your point is here. I did it this way as it's the nearest > I can get to encapsulating a stack in C. > > If the criteria for calling something OO is something that > > <cite> > collect[s] behaviors into types with attributes, and operate[s] > on objects of those types > </cite> > > Then my C code is OO ... except we both know that is isn't. No - we don't. It is possible to write OO code in C. And you code example is pretty OO'ish. The fact that the C language is not designed for OOP does not make it impossible to write OO code - it just make it a little bit harder. Arne
[toc] | [prev] | [next] | [standalone]
| From | "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> |
|---|---|
| Date | 2013-03-23 10:59 +0000 |
| Message-ID | <Je6dnfwnqdF4F9DMnZ2dnUVZ8j-dnZ2d@bt.com> |
| In reply to | #23079 |
Arne Vajhøj wrote:
> It is possible to write OO code in C.
>
> And you code example is pretty OO'ish.
>
> The fact that the C language is not designed for OOP does
> not make it impossible to write OO code - it just make
> it a little bit harder.
And such techniques are (or have been) used to write C in OO style in the "real
world".
I first came across the technique in the mid/late 1980s in the source for the
"fig" drawing tool. It struck me as an elegant and powerful way of structuring
code although I knew nothing of OO at the time (but, looking back, I can see
that my own code -- pre-"fig" -- was already edging towards what I would later
call "OO").
-- chris
[toc] | [prev] | [next] | [standalone]
| From | Martin Gregorie <martin@address-in-sig.invalid> |
|---|---|
| Date | 2013-03-23 15:33 +0000 |
| Message-ID | <kikhvk$iuj$1@localhost.localdomain> |
| In reply to | #23091 |
On Sat, 23 Mar 2013 10:59:09 +0000, Chris Uppal wrote:
> Arne Vajhøj wrote:
>
>> It is possible to write OO code in C.
>>
>> And you code example is pretty OO'ish.
>>
>> The fact that the C language is not designed for OOP does not make it
>> impossible to write OO code - it just make it a little bit harder.
>
> And such techniques are (or have been) used to write C in OO style in
> the "real world".
>
> I first came across the technique in the mid/late 1980s in the source
> for the "fig" drawing tool. It struck me as an elegant and powerful way
> of structuring code although I knew nothing of OO at the time (but,
> looking back, I can see that my own code -- pre-"fig" -- was already
> edging towards what I would later call "OO").
>
Same here, including an almost total lack of OO knowledge.
I was using typedefs to instantiate attributes, but the only code linkage
I used was to define a 'pseudo-object' by encapsulating the typedef and
functions in a separate separate source file with its associated header
file and every such combination also included new() and free() functions
to create/initialise and destroy the typedef instances.
This approach provided most of the benefits of true OO. I discovered,
after I learnt Java, that converting any of my C 'pseudo-object' source
files into a Java class was a simple, straight-forward task.
--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |
[toc] | [prev] | [next] | [standalone]
| From | Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> |
|---|---|
| Date | 2013-03-22 10:19 -0500 |
| Message-ID | <kihsn4$1st$1@dont-email.me> |
| In reply to | #23056 |
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
(<http://mxr.mozilla.org/comm-central/source/mailnews/mime/src/>). 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
[toc] | [prev] | [next] | [standalone]
| From | lipska the kat <"nospam at neversurrender dot co dot uk"> |
|---|---|
| Date | 2013-03-22 16:57 +0000 |
| Message-ID | <_JGdndJSO5_5ENHMnZ2dnUVZ7tWdnZ2d@bt.com> |
| In reply to | #23062 |
On 22/03/13 15:19, Joshua Cranmer 🐧 wrote: > 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] >> 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, All very interesting I'm sure. However I've been thinking about Arveds question "I don't know what more you think object-oriented is, at the basic level" One of the key ideas behind OO is the concept of information hiding. We hide the state of an Object and restrict the available interactions on that state by publishing a contract. Simply put, the contract is the set of methods that clients can call. I see this as absolutely fundamental to the idea of an Object. My C code did not exhibit this property, anyone can directly manipulate the state (the pointer to pointer to struct node) bypassing the published interface of push() pop() and top(). My example does however meet the following criteria "... to collect behaviors into types with attributes, and operate on objects of those types. To write OO code I need an OO language. Of course that's not to say that just because you use an OO language your code is OO and that you can't approximate OO in a non OO language ... of course ultimately you may argue that everything that can be done can be done in assembler, well OK, you write your next business system in assembler, I'll use Java. Would you like to bet who would finish first If I want to write a heap manager I'll use AT&T GAS, if I want to write a device driver I'll use C, if I want to write OO I'll use Java. The bottom line is that an Object Oriented language like Java provides me with the tools to write code that exhibits the three main properties desirable of Object Oriented Software Encapsulation (supported by information hiding), inheritance and polymorphism. Anything that doesn't exhibit these properties isn't OO IMHO That is why I believe that the statement "Object oriented means to collect behaviors into types with attributes, and operate on objects of those types" doesn't even begin to cover what "Object oriented means" Incidentally, Philosophically I believe that OO is a state of mind, but that's another story. lipska -- Lipska the Kat©: Troll hunter, sandbox destroyer and farscape dreamer of Aeryn Sun
[toc] | [prev] | [next] | [standalone]
| From | Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> |
|---|---|
| Date | 2013-03-22 14:07 -0500 |
| Message-ID | <kiia2i$qsf$1@dont-email.me> |
| In reply to | #23064 |
On 3/22/2013 11:57 AM, lipska the kat wrote: > "I don't know what more you think object-oriented is, at the basic level" > > One of the key ideas behind OO is the concept of information hiding. We > hide the state of an Object and restrict the available interactions on > that state by publishing a contract. Simply put, the contract is the set > of methods that clients can call. I see this as absolutely fundamental > to the idea of an Object. My C code did not exhibit this property, > anyone can directly manipulate the state (the pointer to pointer to > struct node) bypassing the published interface of push() pop() and > top(). My example does however meet the following criteria If you don't elaborate the struct in a header file, then people can't bypass the interface. Your complaint boils down to "C doesn't provide access control, so it can't be OOP"--by that logic, languages like JavaScript, Ruby, or Python can't be object-oriented. What I consider the core of OOP to be is the ability to specify an abstract interface. allow multiple independent implementations of that interface, and the ability to inherit implementation. The C code does fit under that paradigm, but I will concede that C is not a good language for implementing the OOP paradigm, which is why it's generally not considered to be an "Object-oriented language." -- Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald E. Knuth
[toc] | [prev] | [next] | [standalone]
| From | lipska the kat <"nospam at neversurrender dot co dot uk"> |
|---|---|
| Date | 2013-03-22 20:09 +0000 |
| Message-ID | <co2dnYr3BfgZJ9HMnZ2dnUVZ8gKdnZ2d@bt.com> |
| In reply to | #23066 |
On 22/03/13 19:07, Joshua Cranmer 🐧 wrote: > On 3/22/2013 11:57 AM, lipska the kat wrote: >> "I don't know what more you think object-oriented is, at the basic level" >> >> One of the key ideas behind OO is the concept of information hiding. We >> hide the state of an Object and restrict the available interactions on >> that state by publishing a contract. Simply put, the contract is the set >> of methods that clients can call. I see this as absolutely fundamental >> to the idea of an Object. My C code did not exhibit this property, >> anyone can directly manipulate the state (the pointer to pointer to >> struct node) bypassing the published interface of push() pop() and >> top(). My example does however meet the following criteria > > If you don't elaborate the struct in a header file, then people can't > bypass the interface. Your complaintboils down to "C doesn't provide > access control, so it can't be OOP" It wasn't a complaint it was an observation, I'm surprised you don't see that, I had you marked down as among the more intelligent members of this group. I don't know where you get the idea that I'm in any way 'complaining' about C in fact I consider it the ultimate language. A little less reading between the lines might not go amiss. >--by that logic, languages like > JavaScript, Ruby, or Python can't be object-oriented. Well that's a very good point. I made a similar observation in a Python group, I think you may even have read it. It wasn't dismissed out of hand so make of that what you will. > What I consider the core of OOP to be is the ability to specify an > abstract interface. All interfaces are abstract in Java so in the context of a discussion in a Java group I don't see the point. > allow multiple independent implementations of that > interface, For this to be meaningful it requires Polymorphism >and the ability to inherit implementation. Inheritance > The C code does > fit under that paradigm, I don't see it I'm afraid > but I will concede that C is not a good > language for implementing the OOP paradigm, which is why it's generally > not considered to be an "Object-oriented language." Java is implemented in C but that's missing the point. Java is in effect an abstraction over C and C pointers, as are most languages up to a point <snicker>. This doesn't alter the fact that my C code is not Object Oriented lipska -- Lipska the Kat©: Troll hunter, sandbox destroyer and farscape dreamer of Aeryn Sun
[toc] | [prev] | [next] | [standalone]
| From | Arne Vajhøj <arne@vajhoej.dk> |
|---|---|
| Date | 2013-03-22 20:31 -0400 |
| Message-ID | <514cf7c6$0$32109$14726298@news.sunsite.dk> |
| In reply to | #23069 |
On 3/22/2013 4:09 PM, lipska the kat wrote: > On 22/03/13 19:07, Joshua Cranmer 🐧 wrote: >> On 3/22/2013 11:57 AM, lipska the kat wrote: >>> "I don't know what more you think object-oriented is, at the basic >>> level" >>> >>> One of the key ideas behind OO is the concept of information hiding. We >>> hide the state of an Object and restrict the available interactions on >>> that state by publishing a contract. Simply put, the contract is the set >>> of methods that clients can call. I see this as absolutely fundamental >>> to the idea of an Object. My C code did not exhibit this property, >>> anyone can directly manipulate the state (the pointer to pointer to >>> struct node) bypassing the published interface of push() pop() and >>> top(). My example does however meet the following criteria >> >> If you don't elaborate the struct in a header file, then people can't >> bypass the interface. Your complaintboils down to "C doesn't provide >> access control, so it can't be OOP" > > It wasn't a complaint it was an observation, Whether it is a wrong complaint or a wrong observation does not really matter much. >> The C code does >> fit under that paradigm, > > I don't see it I'm afraid That you do not know how to do OO in C does not mean that it can not be done. >> but I will concede that C is not a good >> language for implementing the OOP paradigm, which is why it's generally >> not considered to be an "Object-oriented language." > > Java is implemented in C but that's missing the point. > Java is in effect an abstraction over C and C pointers, as are most > languages up to a point <snicker>. > > This doesn't alter the fact that my C code is not Object Oriented No. But Joshua's may be. Arne
[toc] | [prev] | [next] | [standalone]
| From | lipska the kat <"nospam at neversurrender dot co dot uk"> |
|---|---|
| Date | 2013-03-23 08:54 +0000 |
| Message-ID | <8sednUlA2Zo08NDMnZ2dnUVZ8rSdnZ2d@bt.com> |
| In reply to | #23085 |
On 23/03/13 00:31, Arne Vajhøj wrote: > On 3/22/2013 4:09 PM, lipska the kat wrote: >> On 22/03/13 19:07, Joshua Cranmer 🐧 wrote: >>> On 3/22/2013 11:57 AM, lipska the kat wrote: >>>> "I don't know what more you think object-oriented is, at the basic [snip] >> >> It wasn't a complaint it was an observation, > > Whether it is a wrong complaint or a wrong observation does > not really matter much. I'm struggling here. Struggling to understand how you and others have maneuvered this thread into one where I'm *criticizing* C for not being OO. If one uses pseudo-code one is accused of not writing compilable code. So I didn't use it. I was using the stack example in C as an example of some code that met Bloch's original assertion but was not OO. That's all. That's my opinion. It was an *example* it could just as easily be written in FooBar language, it's not hard to understand is it? It's disappointing that once again, what could have become an interesting discussion has been hijacked by your apparent need to contribute to every thread and turn it to your own agenda. But be aware, your constant sniping while an irritant is not going to stop me posting to cljp. In fact it only makes me more determined than ever. So who's the troll ? lipska -- Lipska the Kat©: Troll hunter, sandbox destroyer and farscape dreamer of Aeryn Sun
[toc] | [prev] | [next] | [standalone]
| From | Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> |
|---|---|
| Date | 2013-03-23 23:01 -0500 |
| Message-ID | <kiltmg$ku2$1@dont-email.me> |
| In reply to | #23069 |
On 3/22/2013 3:09 PM, lipska the kat wrote:
> On 22/03/13 19:07, Joshua Cranmer 🐧 wrote:
>> What I consider the core of OOP to be is the ability to specify an
>> abstract interface.
>
> All interfaces are abstract in Java so in the context of a discussion in
> a Java group I don't see the point.
We're discussing an abstract programming concept so by the term
"abstract interface" here I meant to refer to the theoretical concept
rather than the Java specific term. Although it turns out that Java's
interfaces map very nicely to abstract interfaces and vice versa.
>> The C code does
>> fit under that paradigm,
>
> I don't see it I'm afraid
Per my definition, it boils down to three things: abstraction,
polymorphism, and inheritance. Function pointers I hope we can both
agree satisfy polymorphism. Inheritance of implementation comes about by
having something like this:
int SuperStack_pop(Stack *s) {
int rv = Stack_pop(s);
/* do something else */
return rv;
}
Not as elegant as Java, but it works.
For the abstraction paradigm, note that it is possible to provide two
different implementations of stack methods that use the same interface.
You could use a sentinel stack, a circularly-linked list stack, or a
regular no-sentinel stack. You could get even more creative if you
abused the ability to type-pun in C and made the top node pointer do
something else. If it were a plain void *pImpl member (as is more common
in C OOP libraries) that the "class" could allocate at well, then
there's no limit to how many different implementations.
> This doesn't alter the fact that my C code is not Object Oriented
I would say you're thinking about it in the wrong terms. Programming
paradigms are nothing more than philosophies to structure code, so you
could easily write declarative, imperative, functional, and
object-oriented code all in the same language, and even the same code.
This is why I dislike calling languages "functional", "object-oriented",
etc.: it obscures the fact that these terms have really fuzzy boundaries
when applied to real-world languages and that what you have at best is a
spectrum that really refers to how easy it is to do something.
--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth
[toc] | [prev] | [next] | [standalone]
| From | lipska the kat <"nospam at neversurrender dot co dot uk"> |
|---|---|
| Date | 2013-03-24 10:04 +0000 |
| Message-ID | <CqudnXDCRoNRUtPMnZ2dnUVZ7tKdnZ2d@bt.com> |
| In reply to | #23100 |
On 24/03/13 04:01, Joshua Cranmer 🐧 wrote:
> On 3/22/2013 3:09 PM, lipska the kat wrote:
>> On 22/03/13 19:07, Joshua Cranmer 🐧 wrote:
>>> What I consider the core of OOP to be is the ability to specify an
>>> abstract interface.
>>
>> All interfaces are abstract in Java so in the context of a discussion in
>> a Java group I don't see the point.
>
> We're discussing an abstract programming concept so by the term
> "abstract interface" here I meant to refer to the theoretical concept
> rather than the Java specific term. Although it turns out that Java's
> interfaces map very nicely to abstract interfaces and vice versa.
Fair point ... I wasn't trying to pick a fight, I just got a bit
distracted (well that's my excuse anyway) :-)
>>> The C code does
>>> fit under that paradigm,
>>
>> I don't see it I'm afraid
>
> Per my definition, it boils down to three things: abstraction,
> polymorphism, and inheritance. Function pointers I hope we can both
> agree satisfy polymorphism. Inheritance of implementation comes about by
> having something like this:
>
> int SuperStack_pop(Stack *s) {
> int rv = Stack_pop(s);
> /* do something else */
> return rv;
> }
>
> Not as elegant as Java, but it works.
Well I see this as more of an abstract data type, you pass a pointer to
a stack and what is returned is an int ... and that's all you know from
the 'outside', you're not 'extending' stack, rather you are creating a
new component that aggregates Stack, although I admit the distinction is
a little blurred.
It's been many years since I've written *production strength* C code and
I'm winging it a bit here but I see inheritance (abstractly) as
Struct stack{
...
}
stack *stack = malloc(sizeof(struct stack));
Stack **superStack = &stack;
This allows you to implement behavior that *extends* stack by giving you
the ability to manipulate a Stack without altering the underlying
implementation. You can add 'methods' to let you extract an int from the
middle of the stack without breaking the abstraction of Stack by virtue
of the fact that you don't move the stack pointer. Stackwise, the only
time the stack pointer moves is when you push and pop.
with **superStack you can pass ** to a function and alter the
existential stack as it exists in the calling context which you can't do
when you pass *, so you can push and pop as normal but you can also do
elementAt by advancing ** to point at the element required. This
*extends* Stack because it allows the original stack to be modified
_from within the called context_ and also allows additional methods to
be implemented without impacting the extended abstraction (stack).
phew, I think that's right ...
Of course there are usually better/other ways of doing everything. You
may argue that your solution allows you to manipulate a stack in any way
you want by all manner of pointer giggery-pokery, well you are probably
right but abstraction is all about helping our limited mental capacity
to deal with complex problems and the idiom works for me.
> For the abstraction paradigm, note that it is possible to provide two
> different implementations of stack methods that use the same interface.
> You could use a sentinel stack, a circularly-linked list stack, or a
> regular no-sentinel stack. You could get even more creative if you
> abused the ability to type-pun in C and made the top node pointer do
> something else. If it were a plain void *pImpl member (as is more common
> in C OOP libraries) that the "class" could allocate at well, then
> there's no limit to how many different implementations.
>
>> This doesn't alter the fact that my C code is not Object Oriented
>
> I would say you're thinking about it in the wrong terms. Programming
> paradigms are nothing more than philosophies to structure code.
Wow, and I thought it was just me. The fact that science and philosophy
are so inextricably linked came as a surprise to me at first but they
are. You are absolutely right and philosophically I see OO as an
holistic approach to software engineering. Something is either OO or it
isn't. The fact that you can write code that 'looks like' OO in C or
Pascal or CPM or Dr Logo or FooBar language come to that is irrelevant
to me. Philosophically I see OO as a state of mind. the 20'000 ft view
of an OO system is of a number of semi-autonomous Objects existing in an
abstraction of our reality that pass messages between themselves to
implement a human concept. And I make no distinction here, Every single
concept that has ever been conceived by the computer age sentient beings
that inhabit this planet is a human concept, there are no exclusions. I
think that a language that is OO should provide the tools to implement
these abstractions in a way that removes the 'difficult bits' If I want
to think about memory addresses I'll use C or asm, If I want to do OO
I'll use Java, as you say, language choice can be simply about "how easy
it is to do something". At best my C stack is an incomplete OO
implementation. This is why I don't see it as OO, something that is
incompletely Object Oriented can't be Object Oriented.
Than you for a very enjoyable discussion
lipska
--
Lipska the Kat©: Troll hunter, sandbox destroyer
and farscape dreamer of Aeryn Sun
[toc] | [prev] | [next] | [standalone]
| From | Arved Sandstrom <asandstrom2@eastlink.ca> |
|---|---|
| Date | 2013-03-24 17:07 -0300 |
| Message-ID | <Y1J3t.57778$8d.17743@newsfe14.iad> |
| In reply to | #23101 |
On 03/24/2013 07:04 AM, lipska the kat wrote: > On 24/03/13 04:01, Joshua Cranmer 🐧 wrote: [ SNIP ] >> >> I would say you're thinking about it in the wrong terms. Programming >> paradigms are nothing more than philosophies to structure code. > > Wow, and I thought it was just me. The fact that science and philosophy > are so inextricably linked came as a surprise to me at first but they > are. You are absolutely right and philosophically I see OO as an > holistic approach to software engineering. Something is either OO or it > isn't. The fact that you can write code that 'looks like' OO in C or > Pascal or CPM or Dr Logo or FooBar language come to that is irrelevant > to me. Philosophically I see OO as a state of mind. the 20'000 ft view > of an OO system is of a number of semi-autonomous Objects existing in an > abstraction of our reality that pass messages between themselves to > implement a human concept. And I make no distinction here, Every single > concept that has ever been conceived by the computer age sentient beings > that inhabit this planet is a human concept, there are no exclusions. I > think that a language that is OO should provide the tools to implement > these abstractions in a way that removes the 'difficult bits' If I want > to think about memory addresses I'll use C or asm, If I want to do OO > I'll use Java, as you say, language choice can be simply about "how easy > it is to do something". At best my C stack is an incomplete OO > implementation. This is why I don't see it as OO, something that is > incompletely Object Oriented can't be Object Oriented. > > Than you for a very enjoyable discussion > > lipska > Interesting discussion, a couple of observations. First, to me if something "looks like" OO then it really is, because I can't think of any sensible use of the word "resemble" in this context other than taking it to mean: "I examined the code and found it to be OO code". How does something look like OO and not be OO? Maybe if you failed to examine thoroughly, is all. As for any black and white definition of what is, and what isn't, OO, it doesn't exist. Read the section on fundamental features & concepts in http://en.wikipedia.org/wiki/Object-oriented_programming. For example, although this would surprise a lot of OO programmers, the class concept is not even close to being a core requirement for OO, and as you can see from that article the number of generally agreed fundamental features is small. So I wouldn't use the term "incomplete" at all unless one or more of those 3 (or maybe 4) fundamental features is missing. AHS
[toc] | [prev] | [next] | [standalone]
| From | lipska the kat <"nospam at neversurrender dot co dot uk"> |
|---|---|
| Date | 2013-03-25 09:19 +0000 |
| Message-ID | <76Gdne3ZbNY4i83MnZ2dnUVZ8i-dnZ2d@bt.com> |
| In reply to | #23103 |
On 24/03/13 20:07, Arved Sandstrom wrote: > On 03/24/2013 07:04 AM, lipska the kat wrote: >> On 24/03/13 04:01, Joshua Cranmer 🐧 wrote: > [ SNIP ] [snip] >> Than you for a very enjoyable discussion >> >> lipska >> > Interesting discussion, a couple of observations. > > First, to me if something "looks like" OO then it really is, because I > can't think of any sensible use of the word "resemble" in this context > other than taking it to mean: "I examined the code and found it to be OO > code". How does something look like OO and not be OO? Maybe if you > failed to examine thoroughly, is all. > > As for any black and white definition of what is, and what isn't, OO, it > doesn't exist. Read the section on fundamental features & concepts in > http://en.wikipedia.org/wiki/Object-oriented_programming. For example, > although this would surprise a lot of OO programmers, the class concept > is not even close to being a core requirement for OO, and as you can see > from that article the number of generally agreed fundamental features is > small. > > So I wouldn't use the term "incomplete" at all unless one or more of > those 3 (or maybe 4) fundamental features is missing. Well, fortunately, just at the moment, George Orwell's thought police don't exist in this part of the world and we are in the happy positions of being able to think what we want ;-) I agree with you that there doesn't seem to be any widely agreed on definition of Object Oriented. This doesn't stop me having my own view of the paradigm, in fact it encourages it, it also encourages you and others to have your own view which can obviously be different to mine. IMHO this is an example of why Software Engineering is not yet a classical 'engineering' discipline. I would be delighted to sit any examination and undertake any assignment to achieve a professional qualification in software engineering but I think that is some years away yet. A first in Computer Science is unfortunately not enough :-) My example in C was designed to show why I believe the original assertion that... "Object oriented means to collect behaviors into types with attributes, and operate on objects of those types" ... is incomplete at best. It was not intended as a criticism of C's 'Object Orientedness' as some responders have incorrectly assumed but as a validation of my criticism, something which is de-rigueur in any academic style discussion apparently. If I was forced to come up with a definition of OO it would be something along the lines of ---------- The encapsulation of human concepts into semi autonomous components that publish cohesive black box interfaces to the outside world and perform useful work by passing messages amongst themselves. ---------- I suppose I'd better define some words to defend against the inevitable nit-picking. Encapsulation means to wrap up state and operations on that state using aspects of the information hiding paradigm to protect the internal state of a component from unintended outside interference. Cohesive means that the operations exposed by a component on it's state 'belong together' Black Box means that internal state and the implementation of actions on that state are invisible to the outside world. Interface means any technique used to present an interface to the outside world including but not limited to classes, interfaces, server endpoints, proxy servers, satellites, alien technologies and the supreme being who or whatever that or it may be. messages means ... well you get the picture. You are of course at liberty to disagree but that doesn't make you right :-)) lipska -- Lipska the Kat©: Troll hunter, sandbox destroyer and farscape dreamer of Aeryn Sun
[toc] | [prev] | [next] | [standalone]
Page 2 of 5 — ← Prev page 1 [2] 3 4 5 Next page →
Back to top | Article view | comp.lang.java.programmer
csiph-web