Re: Anti-OOP... stupid?

2012-02-15 Thread foobar
On Tuesday, 14 February 2012 at 22:45:28 UTC, H. S. Teoh wrote: On Tue, Feb 14, 2012 at 11:00:43PM +0100, Zero wrote: Hello! I've recently started to work with D, and I'll start a bigger project soon, using it. For a few days I've been thinking about the approach I'll take here, and since I

Re: Anti-OOP... stupid?

2012-02-15 Thread Vijay Nayar
Many reasons why non-OOP methodology creates problems come from how scoping works in a language. In C, there's one global name-space, so declaring functions anywhere can lead to major problems: unexpected dependencies, unclear sequence of execution, aberrant mutations, name-space conflicts,

Re: Anti-OOP... stupid?

2012-02-15 Thread Timon Gehr
On 02/15/2012 03:30 PM, foobar wrote: ... 1. D templates are an enhanced version of C++ templates which are a poor design. The problem stems IMO not from issues with OOP but rather with the horrible idea of C++-like templates. Other languages have *much* better solutions which integrate better.

Re: Anti-OOP... stupid?

2012-02-15 Thread bearophile
foobar: 1. D templates are an enhanced version of C++ templates which are a poor design. The problem stems IMO not from issues with OOP but rather with the horrible idea of C++-like templates. Other languages have *much* better solutions which integrate better. C++ is one of the most

Re: Anti-OOP... stupid?

2012-02-15 Thread foobar
On Wednesday, 15 February 2012 at 15:35:37 UTC, bearophile wrote: foobar: 1. D templates are an enhanced version of C++ templates which are a poor design. The problem stems IMO not from issues with OOP but rather with the horrible idea of C++-like templates. Other languages have *much*

Re: Anti-OOP... stupid?

2012-02-15 Thread foobar
On Wednesday, 15 February 2012 at 15:35:53 UTC, Timon Gehr wrote: On 02/15/2012 03:30 PM, foobar wrote: ... 1. D templates are an enhanced version of C++ templates which are a poor design. The problem stems IMO not from issues with OOP but rather with the horrible idea of C++-like templates.

Re: Anti-OOP... stupid?

2012-02-15 Thread Timon Gehr
On 02/15/2012 09:17 PM, foobar wrote: On Wednesday, 15 February 2012 at 15:35:53 UTC, Timon Gehr wrote: On 02/15/2012 03:30 PM, foobar wrote: ... 1. D templates are an enhanced version of C++ templates which are a poor design. The problem stems IMO not from issues with OOP but rather with the

Re: Anti-OOP... stupid?

2012-02-15 Thread foobar
On Wednesday, 15 February 2012 at 20:55:47 UTC, Timon Gehr wrote: snip Lisp/scheme macros come to mind :) =D. I actually thought about explicitly excluding those to get a more meaningful answer. Using runtime code modification is cheating. There are certainly ways to dynamically dispatch,

Anti-OOP... stupid?

2012-02-14 Thread Zero
Hello! I've recently started to work with D, and I'll start a bigger project soon, using it. For a few days I've been thinking about the approach I'll take here, and since I don't /have/ to use full OOP in D, I was wondering... how crazy is it to not use full OP nowadays? Naturally one

Re: Anti-OOP... stupid?

2012-02-14 Thread deadalnix
IMO, what would be stupid is that everything has to be object oriented. You have problems where OOP is good, and other where it isn't. Use the tool that fit what you want to accomplish. Screwdriver are great, but are useless when you are dealing with a nail. On Tuesday, 14 February 2012

Re: Anti-OOP... stupid?

2012-02-14 Thread H. S. Teoh
On Tue, Feb 14, 2012 at 11:00:43PM +0100, Zero wrote: Hello! I've recently started to work with D, and I'll start a bigger project soon, using it. For a few days I've been thinking about the approach I'll take here, and since I don't /have/ to use full OOP in D, I was wondering... how crazy

Re: Anti-OOP... stupid?

2012-02-14 Thread Timon Gehr
On 02/14/2012 11:06 PM, deadalnix wrote: IMO, what would be stupid is that everything has to be object oriented. You have problems where OOP is good, and other where it isn't. Use the tool that fit what you want to accomplish. Screwdriver are great, but are useless when you are dealing with a

Re: Anti-OOP... stupid?

2012-02-14 Thread Timon Gehr
On 02/14/2012 11:00 PM, Zero wrote: Hello! I've recently started to work with D, and I'll start a bigger project soon, using it. For a few days I've been thinking about the approach I'll take here, and since I don't /have/ to use full OOP in D, I was wondering... how crazy is it to not use full

Re: Anti-OOP... stupid?

2012-02-14 Thread H. S. Teoh
On Tue, Feb 14, 2012 at 11:47:52PM +0100, Timon Gehr wrote: [...] It does not hurt at all if your code base is more flexible than necessary. [...] This needs to be taken in moderation, though. I've had to work with code that was unnecessarily flexible. (I.e., over-engineered.) So flexible, in

Re: Anti-OOP... stupid?

2012-02-14 Thread James Miller
On 15 February 2012 12:12, H. S. Teoh hst...@quickfur.ath.cx wrote: On Tue, Feb 14, 2012 at 11:47:52PM +0100, Timon Gehr wrote: [...] It does not hurt at all if your code base is more flexible than necessary. [...] This needs to be taken in moderation, though. I've had to work with code

Re: Anti-OOP... stupid?

2012-02-14 Thread Timon Gehr
On 02/15/2012 12:12 AM, H. S. Teoh wrote: On Tue, Feb 14, 2012 at 11:47:52PM +0100, Timon Gehr wrote: [...] It does not hurt at all if your code base is more flexible than necessary. [...] This needs to be taken in moderation, though. I've had to work with code that was unnecessarily

Re: Anti-OOP... stupid?

2012-02-14 Thread bearophile
H. S. Teoh: I mean, if you take OO to the extreme, that would require excluding all those evil procedural constructs like if statements and for loops, and write everything in terms of invoking object methods... like this monstrosity: class MyClass { void myMethod() {

Re: Anti-OOP... stupid?

2012-02-14 Thread H. S. Teoh
On Tue, Feb 14, 2012 at 06:42:02PM -0500, bearophile wrote: H. S. Teoh: I mean, if you take OO to the extreme, that would require excluding all those evil procedural constructs like if statements and for loops, and write everything in terms of invoking object methods... like this