In short words, follow the standard code conventions for each language you write. Following standard is better for you, for your productivity and for collaborative development.
But, how do we make bunch of editors consistent? Every editor has own configuration and should I tell people to follow the conventions manually? or any better way to do that?
Yes, you're safe now. Thanks for the editorconfig project. This project saves our life. Why?
Instead of telling people to change configuration and bla bla bla. You can create a
.editorconfig file inside your project directory. Here's the sample:
root = true
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
trim_trailing_whitespace = false
.editorconfig above, all files inside project directory, will be two spaces by default, except for
.php which use four spaces.
.editorconfig to the root of the project directory. Then Install editorconfig plugin for your editor. As long as the editors have plugin installed, it will be making your codes more consistent.