Re: Class Order Style

2017-02-24 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-02-20 14:47, Jolly James wrote: How to sort the members of a class? like: 1. properties then 2. private 3. methods 4. ctors ... and so on. are there any recommendations? In my opinion: 1. Manifest constants (enum) 2. Static variables 3. Instance variables 4. Constructors 5. Properti

Re: Class Order Style

2017-02-22 Thread Jolly James via Digitalmars-d-learn
On Tuesday, 21 February 2017 at 23:06:23 UTC, Jonathan M Davis wrote: On Tuesday, February 21, 2017 22:41:40 Lenny Lowood via Digitalmars-d-learn wrote: [...] It's completely a stylistic preference. There are a number of different ways to order your member variables and functions, and there

Re: Class Order Style

2017-02-21 Thread Seb via Digitalmars-d-learn
On Monday, 20 February 2017 at 13:47:07 UTC, Jolly James wrote: How to sort the members of a class? like: 1. properties then 2. private 3. methods 4. ctors ... and so on. are there any recommendations? And what is better? class A { private: int a; int b; public: int c; int d; }

Re: Class Order Style

2017-02-21 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, February 21, 2017 22:41:40 Lenny Lowood via Digitalmars-d-learn wrote: > On Monday, 20 February 2017 at 18:02:20 UTC, Jolly James wrote: > > On Monday, 20 February 2017 at 13:50:26 UTC, ketmar wrote: > >> just add ddoc documentation to 'em, and then it doesn't matter > >> in which orde

Re: Class Order Style

2017-02-21 Thread Lenny Lowood via Digitalmars-d-learn
On Monday, 20 February 2017 at 18:02:20 UTC, Jolly James wrote: On Monday, 20 February 2017 at 13:50:26 UTC, ketmar wrote: just add ddoc documentation to 'em, and then it doesn't matter in which order they are declared: people will generate documentation to find out how to use your code. ;-)

Re: Class Order Style

2017-02-20 Thread Jolly James via Digitalmars-d-learn
On Monday, 20 February 2017 at 13:50:26 UTC, ketmar wrote: just add ddoc documentation to 'em, and then it doesn't matter in which order they are declared: people will generate documentation to find out how to use your code. ;-) ah okay, thx But what about this? class A { private: int a

Re: Class Order Style

2017-02-20 Thread ketmar via Digitalmars-d-learn
Jolly James wrote: How to sort the members of a class? like: 1. properties then 2. private 3. methods 4. ctors ... and so on. are there any recommendations? And what is better? just add ddoc documentation to 'em, and then it doesn't matter in which order they are declared: people will gener