FSFE-defined coding standards?

kreyren at rixotstudio.cz kreyren at rixotstudio.cz
Wed Feb 10 08:46:15 UTC 2021


On 2/9/21 10:40 PM, Eike Rathke wrote:
> 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/
> _______________________________________________
> Discussion mailing list
> Discussion at lists.fsfe.org
> https://lists.fsfe.org/mailman/listinfo/discussion
>
> This mailing list is covered by the FSFE's Code of Conduct. All
> participants are kindly asked to be excellent to each other:
> https://fsfe.org/about/codeofconduct

Justify bad code and elaborate on bad mail user agents.

-- 
- Krey

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0x31AE4020956E0A9A.asc
Type: application/pgp-keys
Size: 3187 bytes
Desc: not available
URL: <http://lists.fsfe.org/pipermail/discussion/attachments/20210210/a25d17ff/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 855 bytes
Desc: not available
URL: <http://lists.fsfe.org/pipermail/discussion/attachments/20210210/a25d17ff/attachment.sig>


More information about the Discussion mailing list