You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "Matthias J. Sax" <mj...@informatik.hu-berlin.de> on 2015/06/09 09:02:42 UTC

Code Style

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Hi,

I was told that Flink follows a strict code style (eg, putting a blank between 'if' and the opening parentheses). However, I could not find any documentation about it. I would like to follow those rules if there are any. Can you please give me a pointer (or confirm that there is nothing like this or open a Jira for missing documentation -- maybe somebody can spent some time on it after the release).

Currently, I am only aware of the checkstyle plug-in that checks eg for unused import statements. But this plug-in is quicker flexible and does not check for minor formatting differences like blanks or newlines etc.

- -Matthias
-----BEGIN PGP SIGNATURE-----
Version: APG v1.1.1

iQJNBAEBCgA3BQJVdo+RMBxNYXR0aGlhcyBKLiBTYXggPG1qc2F4QGluZm9ybWF0
aWsuaHUtYmVybGluLmRlPgAKCRAV5KLTxRKw1lETD/4iBgvEvN2lsTHjTZnqw87C
KelvQo1dK2KMBGlbDBFBVfzdQvnFP+Loj4To//aDhF3FstIczCev+jy2I/rNGQ8D
bnt2xnExwn36fjh6Lm1dkjp1cU5ziVNXpZt6Qx2aw+foOoXOpjmGTmdIjkHPQn7N
kHUzoAb6mi4rNorChVZw3vFEdMxm2CUdd3ALtxc1NpFrkbJMbpPKQXvAMzT9Uh6G
DN+ZttQIGhngNvkp/qiE6yiCdpGFkG4eUCeUe72TifyC++BMJK1fTv/KHr4i/9JU
vzXtpnsDyNR9WolOfY19VtsFxRdf3oiXUeL0gCIJz46ymt9su985oyl8/T9pBLbz
klbAeUijIaLDPGFVqIlgPZ04dE6LuUmXCXSbPQWizr/Nfzs36FKfrY3bfhi99eiO
9xA+OlPAxttmvfbW8LnCtyVFd8KQaiNeq73EIcfJu0Nxggu+USUBzmwxdVIrKrdF
A120yRbrnfqCJTG8Fgw2NlDyzwiAuNX/K0jvvMI/GHOWqaNoZ/84SwbTgUpxMtpT
8OcP6+S0QgVjYj1RY3xrqEw9n9gLgylDEiB4kGkZCM6JV2rVCChnyGmIQ4DNt9dE
8sIkvCzkhp/yfY3WJjBQ58OALpAM7CRkhDm9ARXtU1Kv3jq2J8xcBgBpxCBzZLT9
iAuN8ZtR2UnQeu6uQPtHeA==
=Hg/O
-----END PGP SIGNATURE-----


Re: Code Style

Posted by Maximilian Michels <mx...@apache.org>.
Despite Flink's superb code quality :), only few code style rules exist. In
previous discussions we found that very strict code style rules do not
necessarily lead to better code readability and quality. The community
follows a pragmatic best-effort approach instead. Aljoscha already pointed
you to the existing rules. For Scala, the rules are a bit stricter. Most
prominently, the enforcement of the line length of 100 characters.

On Tue, Jun 9, 2015 at 9:05 AM, Aljoscha Krettek <al...@apache.org>
wrote:

> These are the only format coding guidelines I'm aware of:
> http://flink.apache.org/coding-guidelines.html
>
> Some other stuff (such as space between 'if' and open parentheses) is
> implicit. It seems to be common Java style and the code that we
> already have follows it. I would say that the existing code is the
> best style guide, although I see that it is inconsistent sometimes.
>
> On Tue, Jun 9, 2015 at 9:02 AM, Matthias J. Sax
> <mj...@informatik.hu-berlin.de> wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA512
> >
> > Hi,
> >
> > I was told that Flink follows a strict code style (eg, putting a blank
> between 'if' and the opening parentheses). However, I could not find any
> documentation about it. I would like to follow those rules if there are
> any. Can you please give me a pointer (or confirm that there is nothing
> like this or open a Jira for missing documentation -- maybe somebody can
> spent some time on it after the release).
> >
> > Currently, I am only aware of the checkstyle plug-in that checks eg for
> unused import statements. But this plug-in is quicker flexible and does not
> check for minor formatting differences like blanks or newlines etc.
> >
> > - -Matthias
> > -----BEGIN PGP SIGNATURE-----
> > Version: APG v1.1.1
> >
> > iQJNBAEBCgA3BQJVdo+RMBxNYXR0aGlhcyBKLiBTYXggPG1qc2F4QGluZm9ybWF0
> > aWsuaHUtYmVybGluLmRlPgAKCRAV5KLTxRKw1lETD/4iBgvEvN2lsTHjTZnqw87C
> > KelvQo1dK2KMBGlbDBFBVfzdQvnFP+Loj4To//aDhF3FstIczCev+jy2I/rNGQ8D
> > bnt2xnExwn36fjh6Lm1dkjp1cU5ziVNXpZt6Qx2aw+foOoXOpjmGTmdIjkHPQn7N
> > kHUzoAb6mi4rNorChVZw3vFEdMxm2CUdd3ALtxc1NpFrkbJMbpPKQXvAMzT9Uh6G
> > DN+ZttQIGhngNvkp/qiE6yiCdpGFkG4eUCeUe72TifyC++BMJK1fTv/KHr4i/9JU
> > vzXtpnsDyNR9WolOfY19VtsFxRdf3oiXUeL0gCIJz46ymt9su985oyl8/T9pBLbz
> > klbAeUijIaLDPGFVqIlgPZ04dE6LuUmXCXSbPQWizr/Nfzs36FKfrY3bfhi99eiO
> > 9xA+OlPAxttmvfbW8LnCtyVFd8KQaiNeq73EIcfJu0Nxggu+USUBzmwxdVIrKrdF
> > A120yRbrnfqCJTG8Fgw2NlDyzwiAuNX/K0jvvMI/GHOWqaNoZ/84SwbTgUpxMtpT
> > 8OcP6+S0QgVjYj1RY3xrqEw9n9gLgylDEiB4kGkZCM6JV2rVCChnyGmIQ4DNt9dE
> > 8sIkvCzkhp/yfY3WJjBQ58OALpAM7CRkhDm9ARXtU1Kv3jq2J8xcBgBpxCBzZLT9
> > iAuN8ZtR2UnQeu6uQPtHeA==
> > =Hg/O
> > -----END PGP SIGNATURE-----
> >
>

Re: Code Style

Posted by Aljoscha Krettek <al...@apache.org>.
These are the only format coding guidelines I'm aware of:
http://flink.apache.org/coding-guidelines.html

Some other stuff (such as space between 'if' and open parentheses) is
implicit. It seems to be common Java style and the code that we
already have follows it. I would say that the existing code is the
best style guide, although I see that it is inconsistent sometimes.

On Tue, Jun 9, 2015 at 9:02 AM, Matthias J. Sax
<mj...@informatik.hu-berlin.de> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
>
> Hi,
>
> I was told that Flink follows a strict code style (eg, putting a blank between 'if' and the opening parentheses). However, I could not find any documentation about it. I would like to follow those rules if there are any. Can you please give me a pointer (or confirm that there is nothing like this or open a Jira for missing documentation -- maybe somebody can spent some time on it after the release).
>
> Currently, I am only aware of the checkstyle plug-in that checks eg for unused import statements. But this plug-in is quicker flexible and does not check for minor formatting differences like blanks or newlines etc.
>
> - -Matthias
> -----BEGIN PGP SIGNATURE-----
> Version: APG v1.1.1
>
> iQJNBAEBCgA3BQJVdo+RMBxNYXR0aGlhcyBKLiBTYXggPG1qc2F4QGluZm9ybWF0
> aWsuaHUtYmVybGluLmRlPgAKCRAV5KLTxRKw1lETD/4iBgvEvN2lsTHjTZnqw87C
> KelvQo1dK2KMBGlbDBFBVfzdQvnFP+Loj4To//aDhF3FstIczCev+jy2I/rNGQ8D
> bnt2xnExwn36fjh6Lm1dkjp1cU5ziVNXpZt6Qx2aw+foOoXOpjmGTmdIjkHPQn7N
> kHUzoAb6mi4rNorChVZw3vFEdMxm2CUdd3ALtxc1NpFrkbJMbpPKQXvAMzT9Uh6G
> DN+ZttQIGhngNvkp/qiE6yiCdpGFkG4eUCeUe72TifyC++BMJK1fTv/KHr4i/9JU
> vzXtpnsDyNR9WolOfY19VtsFxRdf3oiXUeL0gCIJz46ymt9su985oyl8/T9pBLbz
> klbAeUijIaLDPGFVqIlgPZ04dE6LuUmXCXSbPQWizr/Nfzs36FKfrY3bfhi99eiO
> 9xA+OlPAxttmvfbW8LnCtyVFd8KQaiNeq73EIcfJu0Nxggu+USUBzmwxdVIrKrdF
> A120yRbrnfqCJTG8Fgw2NlDyzwiAuNX/K0jvvMI/GHOWqaNoZ/84SwbTgUpxMtpT
> 8OcP6+S0QgVjYj1RY3xrqEw9n9gLgylDEiB4kGkZCM6JV2rVCChnyGmIQ4DNt9dE
> 8sIkvCzkhp/yfY3WJjBQ58OALpAM7CRkhDm9ARXtU1Kv3jq2J8xcBgBpxCBzZLT9
> iAuN8ZtR2UnQeu6uQPtHeA==
> =Hg/O
> -----END PGP SIGNATURE-----
>