Naked dot - accessing object fields through unqualified "." [C1]

Marek Kozieł develop4lasu at gmail.com
Wed Apr 1 16:05:38 PDT 2009


2009/4/1  <alexandre.makarenko at free.fr>:
> Hi Marek,
> could you comment this please
>
> Read:
>     class Bar {
>          public String     name;
>          public Bar          right;
>     }
>
>     class Root {
>          public Bar     right;
>          public Bar     left;
>
>          public Root(Bar right, Bar left) {
>               this.left = this.// left is set here
>               right = right;
>          }
>
>     }
>
>
> alex
>

Hi.
This was measured that if you split expresion into more lines operator
should be placed at start:

Operator(s) (during splitting exprestion into two lines) should be
placed in a new line, like:
String s = "could you comment this please " //
   + "\n\nRead:";

This is easier to read, bacause it shows directly that previous line
need to be checked to understand this one.
What's more, operator placed in the end of the line can be over the screen.

So, this line:
   this.left = this.// left is set here
is consider to be bad style.

-- 
Pozdrowionka. / Regards.
Lasu aka Marek Kozieł

http://lasu2string.blogspot.com/



More information about the coin-dev mailing list