jcryptool / crypto

JCrypTool Crypto Plug-ins
https://www.cryptool.org
Eclipse Public License 1.0
67 stars 37 forks source link

Coding-Style initiative #353

Closed tassadarius closed 1 year ago

tassadarius commented 3 years ago

Coding-Style initiative

Hello everyone, a I want to start a discussion / project to improve our JCrypTool code quality.

Why

JCryptool has specified Coding conventions and tools to apply them. Our automated checking tool currently counts 105.528 violations against it as can be seen in this screenshot.

image

This leads to code which is: inconsistent, hard-to-read and therefore hard-to-understand, more error prone and painful to maintain (you name it). The goal is to improve the quality of existing code, as well as ensure a certain code quality for newly written parts.

What

We as core developers should begin to enforce our coding guidelines in the code we produce. The tools are there (checkstyle, auto-formatter etc.), we just have to apply them properly. We should also try to enforce these conventions before new code is adopted from external contributors.

Possible steps.

I know it's not the nicest topic, but everybody is happier with cleaner code.

HTML coding conventions

We currently have rules only for Java in place. It would be cool to cure our inconsistent and bad HTML code as well. There are HTML formatters available and standards as well.

What do you think? Please comment and/or let's discuss this in a meeting.

simlei commented 3 years ago

Hi,

  • [ ] Discuss whether we are happy with our coding guidelines or if it can be improved.

I'm against an 80 characters limit; we have widescreens now. This is not an unpopular opinion; eg. Linus Torvalds raised that argument.

It would make gone >70% of that checkstyle problems instantly.

  • [ ] Tell people (we to ourselves, external contributors) explicitly about these tools and ask them to use them.
  • [ ] Place the wiki page for it more prominently

Ok :)

  • [ ] Start a refactoring initiate to make more code conform to our coding conventions.

An admirable quest ;)

  • [ ] (Far Future goal) enforce a checkstyle check at build level and reject non-conform code.

Even more so :)

MfG, Simon Leischnig

On 3/15/21 9:55 PM, tassadarius wrote:

Why

JCryptool has specified Coding conventions and tools to apply them. Our automated checking tool currently counts 105.528 violations against it as can be seen in this screenshot.

image

This leads to code which is: inconsistent, hard-to-read and therefore hard-to-understand, more error prone and painful to maintain (you name it). The goal is to improve the quality of existing code, as well as ensure a certain code quality for newly written parts.

What

We as core developers should begin to enforce our coding guidelines in the code we produce. The tools are there (checkstyle, auto-formatter etc.), we just have to apply them properly. We should also try to enforce these conventions before new code is adopted from external contributors.

Possible steps.

I know it's not the nicest topic, but everybody is happier with cleaner code.

  • [ ] Discuss whether we are happy with our coding guidelines or if it can be improved.
  • [ ] Tell people (we to ourselves, external contributors) explicitly about these tools and ask them to use them.
  • [ ] Place the wiki page for it more prominently
  • [ ] Start a refactoring initiate to make more code conform to our coding conventions.
  • [ ] (Far Future goal) enforce a checkstyle check at build level and reject non-conform code.

HTML coding conventions

We currently have rules only for Java in place. It would be cool to cure our inconsistent and bad HTML code as well. There are HTML formatters available and standards as well.

What do you think? Please comment and/or let's discuss this in a meeting.

e

tassadarius commented 1 year ago

I think this is not gonna happen anymore.