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
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
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;
}
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
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. ;-)
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
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