FSFE-defined coding standards?

Eike Rathke erack at fsfe.org
Tue Feb 9 21:40:10 UTC 2021


Hi,

On Monday, 2021-02-08 10:56:43 +0000, Jacob Hrbek wrote:

> Should FSFE provide some kind of platform for community to discuss and propose coding standards?

Before discussing coding standards we should rule out bad Mail User
Agents that produce totally unusable text/plain from text/html in their
multipart/alternative:

> Bad code:
> 
> #!/bin/bash
> 
> number=
> 
> "5"
> 
> if
> 
> [[
> 
> "
> 
> $number
> 
> "
> 
> =~ [0-9] ]];
> 
> then
> 
> whatever;
> 
> fi
> 
> - Works only on systems with dynamic linking
> - Bash is not part of standard portable OS → Not portable
> 
> Good code:
> 
> #!/bin/sh
> 
> # shellcheck shell=sh # Written to comply with IEEE Std 1003.1-2017
> [<http://get.posixcertified.ieee.org/>](http://get.posixcertified.ieee.org/)
> number=
> 
> "5"
> 
> case
> 
> "
> 
> $number
> 
> "
> 
> in
> 
> [0-9]) whatever;
> 
> esac


As sent, both are bad code.

  Eike

-- 
OpenPGP/GnuPG encrypted mail preferred in all private communication.
GPG key 0x6A6CD5B765632D3A - 2265 D7F3 A7B0 95CC 3918  630B 6A6C D5B7 6563 2D3A
Use LibreOffice! https://www.libreoffice.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.fsfe.org/pipermail/discussion/attachments/20210209/4d429bef/attachment.sig>


More information about the Discussion mailing list