Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upAllow two line breaks #390
Comments
yoshuawuyts
added
the
i disagree
label
Jan 20, 2016
This comment has been minimized.
This comment has been minimized.
|
Wouldn't it be better to add comments to separate large entities? Or even better: break them apart into smaller functions or multiple modules? |
This comment has been minimized.
This comment has been minimized.
This is how you deal with this problem. |
This comment has been minimized.
This comment has been minimized.
|
My point is to separate clearly modules (whatever their size), with the logic one line for a function, two lines for a module. Taking the following example, these modules are small and a double line break helps to distinguish them. class Polygon {
constructor(height, width) {
this.height = height
this.width = width
}
get area() {
return this.calcArea()
}
calcArea() {
return this.height * this.width
}
}
class Point {
constructor(x, y) {
this.x = x
this.y = y
}
static distance(a, b) {
const dx = a.x - b.x
const dy = a.y - b.y
return Math.sqrt(dx * dx + dy * dy)
}
}The comment idea is interesting, but it feels more like a hack if I don't have a meaningful comment to make. |
This comment has been minimized.
This comment has been minimized.
caspervonb
commented
Jan 21, 2016
|
The extra new-line is just extra noise IMHO. If your file is large, use syntax based folding. |
This comment has been minimized.
This comment has been minimized.
|
@raphael-boucher by module, I am referring to a distinct translation unit. That is, a different file. |
This comment has been minimized.
This comment has been minimized.
|
It seems the concensus of the respondents in this thread is that this should not be adopted for standard, therefor I'm closing this issue. Thanks for bringing it up regardless! If you'd like to continue discussing this, feel free to do so. This has merely been closed to signal that at least for now a resolution has been found. |
yoshuawuyts
closed this
Jan 21, 2016
This comment has been minimized.
This comment has been minimized.
|
Shouldn't the syntax convention be fine for all file sizes, or at least up to 500 lines ? |
This comment has been minimized.
This comment has been minimized.
|
@raphael-boucher all my |
raphael-boucher commentedJan 20, 2016
Double line breaks allow to clearly separate large entities, such as classes. Could we allow them ?