That git requirement/problem is in my mind. I'd like to ensure that the source files are source control friendly.
I never thought about using ; to separate lists, though there's no real reason why I would distinguish between ; and ,. Just a classic syntax I guess, though semi-colons seem "heavier" than commas.
In the rare occasion that I have inline list elements, I instinctively use commas then have to go back and replace with semi-colons. The compiler thinks I have one list item that is a tuple, since commas indicate tuples in F# (even without parens).
I do like the range of choices that are given by using either a separator char or newline. However in practice, I nearly always use the first style (newlines only). It is the most copy-paste and git friendly, and secondarily I like the visual flow.
I think the inline versus multiline choice depends on what type of code you are writing. Anything that involves a logical list of items I prefer newlines.
var items = [
item_one,
item_two(args),
1 + 2,
]
But, sometimes I have little tuples, like points, that would be burdensome, and unclear to do multiline:
var a : point = [1,2]
var b = pt_a + [3,4]
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
That git requirement/problem is in my mind. I'd like to ensure that the source files are source control friendly.
I never thought about using
;
to separate lists, though there's no real reason why I would distinguish between;
and,
. Just a classic syntax I guess, though semi-colons seem "heavier" than commas.In the rare occasion that I have inline list elements, I instinctively use commas then have to go back and replace with semi-colons. The compiler thinks I have one list item that is a tuple, since commas indicate tuples in F# (even without parens).
I do like the range of choices that are given by using either a separator char or newline. However in practice, I nearly always use the first style (newlines only). It is the most copy-paste and git friendly, and secondarily I like the visual flow.
I think the inline versus multiline choice depends on what type of code you are writing. Anything that involves a logical list of items I prefer newlines.
But, sometimes I have little tuples, like points, that would be burdensome, and unclear to do multiline: