Logo

Programming-Idioms

History of Idiom 5 > diff from v11 to v12

Edit summary for version 12 by :

Version 11

2015-08-22, 09:38:11

Version 12

2015-08-22, 22:54:02

Idiom #5 Create a 2D Point data structure

Declare a container type for two floating-point numbers x and y

Idiom #5 Create a 2D Point data structure

Declare a container type for two floating-point numbers x and y

Code
class Point {
  double x, y;
  Point(this.x, this.y);
}
Comments bubble
With constructor, which you will almost always have.