function(arg1, arg2, arg3,
arg4, arg5, arg6) {
code
}
The line with arg4 on it can't be indented by tabs alone but it's a common coding standard. function(arg1, arg2, arg3,
arg4, arg5, arg6) {
code
}
The line with arg4 on it can't be indented by tabs alone but it's a common coding standard.As long as you never use tabs after other characters, things will work well enough.
I think you might be misunderstanding the alignment comment. The idea is that the lines starting with "function" and "arg4" have the same number of tabs, and then the "arg4" line has nine spaces after the tabs.
(For a better readability and ease of edition, I however prefer to actually indent arguments (each on it's line) rather than the suggested alignment, as I show in the second function)
class Something {
>const obj = {
>>somePropName: 1,
>>xyz_________: 2,
>};
>function foo(arg1, arg2, arg3,
>_____________arg4, arg5, arg6) {
>>code
>}
>
>function bar(
>>arg1,
>>arg2,
>>arg3,
>) {
>>code
>}
}Fortunately all the projects I work on do the proper thing and use spaces ;)
React (FB) says they use spaces: https://github.com/airbnb/javascript#whitespace (react links to the airbnb style guide)
Google: is usually spaces, https://google.github.io/styleguide/jsguide.html#formatting-...
Apple: https://llvm.org/docs/CodingStandards.html#whitespace, https://webkit.org/code-style-guidelines/#indentation-4-spac..., Swift (load xcode, see it inserts spaces in default code projects and with reformatting in xcode, ...)
Mozilla: https://firefox-source-docs.mozilla.org/code-quality/coding-..., rustfmt defaults to spaces: https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=...
Python: https://www.python.org/dev/peps/pep-0008/#tabs-or-spaces
PS: I know some projects use tabs (go, linux) for example. I don't work on those :P
Of all the ways you could object, I feel like listing makefiles and python might make the least sense. Makefiles require tabs and python has zero problems using tabs for indentation and spaces for alignment. In fact, python will make it harder to accidentally indent a line wrong than almost any other language.
I'd just say people are more likely to screw up, or something like that.
> PS: I know some projects use tabs (go, linux) for example. I don't work on those :P
Linux requires 8 space indentations so it's the worst of all worlds.