[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

FYI: what's OOP's jargons and complexities?

Petite Abeille

1/28/2005 11:30:00 PM

40 Answers

Trans

1/29/2005 5:51:00 AM

0

Nice. I look forward to the next installment.

Of course I had basically figured the jist of this out already, but
this post states it very nicely and quite clearly. I think alot of what
makes OOP popular is that people actually like a certain amount of
complexity --it gives them something to do and to "know". That's not
to say it doesn't have some merits --it does help code reuse a little,
but I don't know how well it really offsets the added hoops it creates.
I recently rewrote a program something like 15 times before I felt like
I got the "object model" right.

Thanks,
T.

Joao Pedrosa

1/29/2005 6:23:00 AM

0

Hi,

On Sat, 29 Jan 2005 14:55:51 +0900, Trans <transfire@gmail.com> wrote:
> Nice. I look forward to the next installment.
>
> Of course I had basically figured the jist of this out already, but
> this post states it very nicely and quite clearly. I think alot of what
> makes OOP popular is that people actually like a certain amount of
> complexity --it gives them something to do and to "know". That's not
> to say it doesn't have some merits --it does help code reuse a little,
> but I don't know how well it really offsets the added hoops it creates.
> I recently rewrote a program something like 15 times before I felt like
> I got the "object model" right.

I'm working with about 16k LoC of Ruby and I had to do some drastic
improvements to it and I think that the general OOness of it was
enough to keep it all working while I messed with it. I wouldn't
recommend doing it on production code that you need ready by the next
week, but it definitely helps when you are still in the development
process.

I feel like I can break Ruby code knowing that I will be able to fix
it. The only exception is the "end" keyword which if missing is
terrible, but if you kept the file small enough you can handle that,
even without the right tools.

It's a nice feeling to know that we can hack several scripts, merge
them, create new ones, mess with the old ones, etc, without everything
falling apart.

Basically, code should be inside modules. Don't "include AModule"
outside of a module, or you may hit some conflicts. Split your code
evenly among files. "Reopen" the same modules in different files, if
needed.

That said, I even used some Polymorphism, so OO in Ruby is really
useful. I found that I could avoid many copy/pastes by using OO
properly.

If I had to fight with Static Typing while doing so many changes to
the code, many "ideas" would be lost while I would be trying to make
it compile to verify the changes. It's really a different process. We
do get errors, but not in the Static Typing sense and there isn't a
debugger with breakpoints, only "p"s and "puts"s here and there. :-)

It's a different mindset. When I used Delphi, I would often get angry
at Delphi for making me repeat some unwanted steps prior to doing
something else, or when it would simply say "Insufficient Memory"
declaring end of the programming session for me.

I prefer Ruby. :-)

Cheers,
Joao


Mathieu Bouchard

1/29/2005 7:07:00 AM

0

Charles Miller

1/29/2005 9:49:00 AM

0

On 29/01/2005, at 10:30 AM, PA wrote:

> http://article.gmane.org/gmane.comp.python.gene...
Nice article. I'd love to see it written without all the inaccuracies
and obvious bias. :)

Charles

-- Contributing to the heat death of the Universe since 1975
cmiller@pastiche.org http://fishbowl.pa...



Trans

1/29/2005 10:07:00 AM

0

Hi Mathieu Bouchard,

First off I'm wondering if you read the referenced post?

I've been programming for over 20 years. I would not call myself a
great programmer, but I'm okay. I was first interoduced to OOP via VB
and then really hunkerd down with it in Ruby. So maybe 5 or so of OOP.
In the past I could just sit down and hammer out a pretty nice program.
But with OOP I find myself spending much more time on the "proper
model". OOP has made me an aweful programmer by comparision. Yea, so
great others can more easily use my code. That's nice. But it sure as
hell doesn't make my coding any simpler.

Take the simple example I just went through, where I had to figure our
how to best represent a encapsulation of "how to find a piece of
subtext" and the encapsulation of "what to create when you find that
thing", and there were various parts shared among them, so I wnated to
modularize, but it's tricky b/c modules don't include class level stuff
(without wrtting some meta-code to manually do it) and subclassing a
class that extends a module which extenda a module doesn't seem to fly
(I beleive that was the pattern) and not to metntion the well known
DynamicModuleInclusion problem (inlcuding a module in a module poist
instantiation), well needless to say it took quite sometime to find
something "artisian" --and I won't even do into the same old same old
with trying to get access to an object far up the hierarchy fromthe
bottom (always fun to pass a self down four levels ;-)

Now my problems aside, consider all those OOP design patterns. All very
cool I think, but a whole lot more complexity. OOP is NOT simple.
Otherwise it wouldn't be so difficult to teach. I don't believe
teaching how to use any set of language constructs is neccessarily
hard. Kids program in Logo! Becoming an expert is hard, _especailly in
a hard thing_.

I don't find this comment intereting:

> One should map patterns of thought to patterns of
> mechanisms in the most convenient way possible. Clinging
> to recipebooks and phrasebooks and taking guidelines as
> if they were hard rules, those are things that make verbose
> and clunky programs, OOP or not.

I respectively disagree. I think OOP itself can often make that more
difficult.

T.

gabriele renzi

1/29/2005 10:15:00 AM

0

Trans ha scritto:
> Nice. I look forward to the next installment.
>
> Of course I had basically figured the jist of this out already, but
> this post states it very nicely and quite clearly.

notice that the post is also a flamebait, crossposted to
comp.lang.perl.misc, comp.lang.python, comp.lang.lisp, comp.lang.scheme,
comp.lang.c, full of dumb stuff like this:
public class test {
public static void main(String[] args) {
String a = new String("a string");
String b = new String("another one");
StringBuffer c = new StringBuffer(40);
c.append(a); c.append(b);
System.out.println(c.toString());
}
}

presented as "pure OOP language".

I, as a dumb java programmer would write:
public class test {
public static void main(String[] args) {
String c = new String("a string" + " another one");
System.out.println(c);
}
}

but obviously in a pure oo language such as ruby you won't need this.

Petite Abeille

1/29/2005 1:10:00 PM

0


On Jan 29, 2005, at 06:55, Trans wrote:

> Nice. I look forward to the next installment.

Ditto :)

> Of course I had basically figured the jist of this out already, but
> this post states it very nicely and quite clearly. I think alot of what
> makes OOP popular is that people actually like a certain amount of
> complexity --it gives them something to do and to "know".

Hmmm... I rather see OOP as providing a sense of structure and
organization. In other words, a consistent way to "package"
functionalities. If this is beneficial or not is largely in the eyes of
the beholder.

Cheers

--
PA, Onnay Equitursay
http://alt.text...



Petite Abeille

1/29/2005 1:15:00 PM

0


On Jan 29, 2005, at 10:49, Charles Miller wrote:

> Nice article. I'd love to see it written without all the inaccuracies
> and obvious bias. :)

Think of it as a "opinion piece". Plus, "inaccuracies" and "bias" are
underrated.

In any case, perhaps this is an opportunity for you to to expend on:

http://fishbowl.pastiche.org/2005/01/17/language_o...

Cheers

--
PA, Onnay Equitursay
http://alt.text...



Petite Abeille

1/29/2005 1:49:00 PM

0


On Jan 29, 2005, at 06:55, Trans wrote:

> Nice. I look forward to the next installment.

"The next Xah-lee post contest"

http://article.gmane.org/gmane.comp.python.gene...

Cheers

--
PA, Onnay Equitursay
http://alt.text...



James Britt

1/29/2005 2:24:00 PM

0

Charles Miller wrote:
> On 29/01/2005, at 10:30 AM, PA wrote:
>
>> http://article.gmane.org/gmane.comp.python.gene...
>
> Nice article. I'd love to see it written without all the inaccuracies
> and obvious bias. :)

Nicely put.

When I got to part that asserted, "in such dedicated languages like
Java, everything in the language are 'Classes'," little trolls started
dancing in my head.



James