A software developer. I'm interested in learning new technologies and core language features. I love to dive into legacy code writing tests and refactoring as I go.
A software developer. I'm interested in learning new technologies and core language features. I love to dive into legacy code writing tests and refactoring as I go.
A software developer. I'm interested in learning new technologies and core language features. I love to dive into legacy code writing tests and refactoring as I go.
But that depends on the style of the language or developers involved. When having the bracket on a separate line is expected, "reverse the problem" seems correct to me.
A software developer. I'm interested in learning new technologies and core language features. I love to dive into legacy code writing tests and refactoring as I go.
The reversal is in the location of where the style causes potential git merge issues. With comma-first the issue can happen at the top of the list with comma-last the issue can happen at the bottom of the list.
Im not sure what you mean by removing the dependency on the comma. If the language uses commas to separate the data there is no real way to remove that dependency. It is built into the language.
ah, i get you, so in the case where brackets are on their own lines, prepending the list will still cause a double diff
in fairness, i’d argue that appending is much more common from my personal experience, be it adding adding data to a JSON, extending an SQL query or passing more attributes to an HTML tag
good spot, though 🙂
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.
The git argument seems correct but doesn't it just reverse the problem? Wouldn't adding a value to the top of the list have all the same problems?
adding to the top will create a [+2, -1] diff in both styles. you'll need to keep the opening bracket on its own line to avoid that.
So yes?
uh, yes, but 'reverse the problem' is incorrect since it exists for both
But that depends on the style of the language or developers involved. When having the bracket on a separate line is expected, "reverse the problem" seems correct to me.
separating the bracket will fix the problem for both styles.
logically speaking, there’s no ‘reversal’ no matter how you peg it, as you’re coupling the data with its dependent comma instead of separating them
The reversal is in the location of where the style causes potential git merge issues. With comma-first the issue can happen at the top of the list with comma-last the issue can happen at the bottom of the list.
Im not sure what you mean by removing the dependency on the comma. If the language uses commas to separate the data there is no real way to remove that dependency. It is built into the language.
ah, i get you, so in the case where brackets are on their own lines, prepending the list will still cause a double diff
in fairness, i’d argue that appending is much more common from my personal experience, be it adding adding data to a JSON, extending an SQL query or passing more attributes to an HTML tag
good spot, though 🙂