Re: [framework-discuss] Codestyle |
[ Thread Index |
Date Index
| More lists.aurorafoss.org/framework-discuss Archives
]
- To: framework-discuss@xxxxxxxxxxxxxxxxxxxx
- Subject: Re: [framework-discuss] Codestyle
- From: Filipe Laíns <lains@xxxxxxxxxxxxxx>
- Date: Sat, 12 Oct 2019 21:28:51 +0100
- Authentication-results: out.migadu.com; auth=pass (login)
- Dkim-signature: v=1;a=rsa-sha256;bh=uz9oE2vEWKNCibO+eioC/cZItj74eQJ31+BMkgivXKA=;c=relaxed/simple;d=aurorafoss.org;h=from:subject:date:to;s=default;b=lOH1Hj5U4u3iO79OpLNzupkb42vW62XJ4ieya7EbXj3IPtgd3gNTo/dwJgkLF0RWLv0R/S3DG5M+fJOfkd922NqdWZyo6G0sbF9m3xM/+Akl9WT5Oa/nfa0042WPYE/wjkYYNp09vzHcwb2DkcWTeuFZd4ozfgQ8t4RjM6t07is=
- Organization: Aurora Free Open Source Software
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On Sat, 2019-10-12 at 17:29 +0100, Luís Ferreira wrote:
> - And some other codestyle sections you feel uncomfortable with.
What does this mean?
> My opinion in Tab indentation:
> I like the idea of use tabs for indentation and spaces for alignment.
> For each file extension, we need to define a file on infrastructure
> repo with the "standard" way of indentation.
You need to clarify things. Use spaces for alignment in which
situations? To align for ex. comments at the end of a line? Or perhaps
to align for ex. function parameters?
To align comments, using spaces is just horrible. We should use tabs,
like this:
```
#define SOMETHING /* My comment */
#define SOMETHING_ELSE /* Other comment... */
```
But to align function parameters, using spaces for fine alignment is
desirable:
```
void my_function(int my_very_long_variable_name_blah_blah_blah,
int my_other_variable);
```
I suggest we adopt the same codding style as the kernel, which is
widely used across a big number of other popular projects.
In a nutshell:
- Use tabs for indentation
- Tabs are 8 spaces long
- Use tabs to align as much as you can
- Use spaces for fine alignments (like my 2nd example)
I am not sure if the tabs and spaces in the examples will get messed up
by the email server, but I hope not.
Thanks,
Filipe Laíns
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCAAdFiEE0jW0leqs33gyftiw+JPGdIFqqV0FAl2iN3YACgkQ+JPGdIFq
qV1OkhAAqU7xbmbxv3vG5UAF/Pf/zEY2/Sx3DUSSnX+xRY8ASw+/dEQahNU//jUn
pe0MYz2Se5R5XNm3SsTzJDukHSscdGk6ZI2inl51PIgtKCkQyWq+9nzPX3Inh2Pp
RTv3lMdstYYQtFlQ2U7QO4EnIobUB61xPFSr0u8eg36lO4Z3wKyOyQX4RLnqVt8j
uB9jz9pyBOdl/kDYtR7WFnsW0Y3O2iA9+WeRJMz7lm9D64vFo2pfBfaX5lThc1+O
6QHrVmPjkWZ9wAuv1buqwPWPwYkZlGCjg0T/CeQRCLrBu3L21zCEfQNvUDSYTm7b
huAmGEd/J/20CD3nVXh/iHJBXqkooJrBeS8XO0RquEGFZAJUd1+YtKBfdYMNAyDc
mLvZiCmtEqr0J7vgWdQrIFnx5/Ia4vHhEWK0byh4XkTujTatoXOp02tEDsPi6AHU
wSyxd1lqJGq013QmHut8Hq87xgFb/by4oFBt1LvshBzJz62Np1ug8UQ0wantZbGk
zOSHWcM4DOLFSbFSK6ldX/VK9q/O9BopchCFFeIKqng6kD6XaKMbXaY2Mtywsrw3
b4jV3oJRfjYVaXZdXyePoY5uJXu5iqzDRdB2La5vKhzxcWovkHyg0qv+V7uddVFU
YeE8o5mGDemo2YxNTcDworwbOcxPOjc5dAe33wgaVgZkkH5VFqM=
=bpzx
-----END PGP SIGNATURE-----