Re: NSPoint
Re: NSPoint
- Subject: Re: NSPoint
- From: Georg Tuparev <email@hidden>
- Date: Sun, 2 Mar 2003 11:31:41 +0100
1. Because it is very bad design practice to surround static data
structures with objects. It is like 95% of all text books giving class
inheritance examples like Mammal->Cat->Tiger. Then the students are
let into the real life and start creating separate classes for each of
the 4 500 000 or so species. As absurd as it may sound there are many
frameworks/applications out there based on this insane design
principle. Over 50% of all Talignet classes and the Java exception
handling are prominent examples ...
2. Because it is slow and inefficient. Imagine you are writing a
protein modeling program with millions of vectors (chemical bonds) and
billions of points (electron density clouds). If each vector and dot is
an object, you will need gigabytes of ram just to run the program.
gt
On Sunday, Mar 2, 2003, at 07:54 Europe/Amsterdam,
email@hidden wrote:
Why has NSPoint and various other data types been defined as structs
rather than classes? Is there any good reason for not encapsulating
data like this (how much should be the extent of data encapsulation)?
-- georg --
"More Trees, less Bushes!"
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: | |
| >NSPoint (From: email@hidden) |