Hey,
würdet ihr lieber das hier schreiben:
oder das hier:
Ich finde irgendwie beides doof. Aber eins muss es ja sein Nur welches? Was ist wichtiger:
a) Schnelleres Schreiben/Abändern (2.Variante)
b) keine unnötigen Doppel-Zuweisungen (1.Variante)
PS: Wer c) sagt ist nicht lustig
würdet ihr lieber das hier schreiben:
Code:
public Hexagon(int x, int y) {
this.x = x;
this.y = y;
this.diameter = 20;
this.color = Color.white;
buildPolygon();
}
public Hexagon(int x, int y, int diameter, Color color) {
this.x = x;
this.y = y;
this.diameter = diameter;
this.color = color;
buildPolygon();
}
oder das hier:
Code:
public Hexagon(int x, int y) {
this.x = x;
this.y = y;
this.diameter = 20;
this.color = Color.white;
buildPolygon();
}
public Hexagon(int x, int y, int diameter, Color color) {
this(x,y);
this.diameter = diameter;
this.color = color;
}
Ich finde irgendwie beides doof. Aber eins muss es ja sein Nur welches? Was ist wichtiger:
a) Schnelleres Schreiben/Abändern (2.Variante)
b) keine unnötigen Doppel-Zuweisungen (1.Variante)
PS: Wer c) sagt ist nicht lustig