On Saturday, 25 August 2012 at 20:37:27 UTC, timotheecour wrote:
Is there a "best practices" page on this site to use as
reference for those FAQ, that AFAIK are not in the docs:
* when to use class vs struct
(eg
http://stackoverflow.com/questions/11058906/struct-vs-class-for-writing-d-wrappers-around-foreign-languages)
General rule I follow (don't know if this is common): use
`struct` unless you are using pointers a lot: that's a sign you
need classes.
* what's the standard signature for opEquals ()
(ef
http://forum.dlang.org/thread/ewhhutwupqxbepqyz...@forum.dlang.org#post-mailman.1402.1345925314.31962.digitalmars-d:40puremagic.com)
* same for toString(), this(), etc.
IDK
* to use or not to use @property
@property is semantically a fake field. Thus, use it to get an
attribute that doesn't have side effects (except for setters) and
runs in constant time.
etc..
I understand it's on a case by case but I would hope there are
certain rules one can follow in 99% cases.
My 0.02 dollars,
NMS