Skip to the content.

Great Tips, Mindsets and Practices for Coders

Empowering tips, mindsets and practices for happy coders about Training, Coding, Git, Unit tests, Agile, GNU/Linux installation, Markdown/Pandoc
 Not the best ones because continuously evolving and any one can propose improvements. 😉

Maintained with faireness in mind and shared in Public Domain.

Also available as a slide show (using Reveal.js).

See also

Design / CSS

Web site architecture

  SSR CSR Universal Static JAMStack
Requires hosting yes no yes no yes (API)
CDN 👎 👍 👎 👍 👍
SEO 👍 👎 👍 👍 depends on content from API
Initial load âšĄïžâšĄïž âšĄïž âšĄïžâšĄïž âšĄïžâšĄïžâšĄïž âšĄïžâšĄïž
Reload yes no no no depends on the tool
Fluid UX 👎 👍 👍 👍 👍
Frequent updates 👍 👍 👍 👎 👎/👍*

* To be frequently updated, JAMStack website can use APIs to retrieve content but looses SEO benefits. Approche can be hybrid: only very recent content is delivered by API, while static content is continuously re-built & delivered acroos CDN.

Security

Programming

Features Programming languages
Fast compilation V, D, Go, Delphi
Simplicity & maintainability V, Go, Nim, Python, Julia, Jupyter, Elm, Kotlin, Dart, Elixir
Great perf. and zero cost C interop V, C, C++, D, Delphi, Erlang, Rust
Safety (immutability, no null, option types, free from data races) V, Rust
Easy concurrency V, Go
Easy cross compilation V, Go
Compile time code generation V, D
Small compiler with no dependency V
No global state V
Hot code reloading V

Les résultats du sondage JavaScript https://2019.stateofjs.com/overview/

Training

Artificial Intelligeance & Machine Learning

Dev tools

Dotfiles Managers

Backup your customized configuration files (~/.bashrc, ~/.gitconfig
) and share them across the computers you use (home, work
).

yadm - Easy too use

chezmoi - Filename prefixes as deployment operations

dotdrop - Easy to hack (manual Git management)

Installation of dotdrop to be almost yadm-compatible

YADM repo looking is often a convention: respect of original path/filenames.

Two almost yadm-compatible installations are described here:

  1. Two Git repo (dotdrop repo + dotfiles sub repo)
  2. The dotfiles repo archives itself the ~/.config/dotdrop/config.yaml

Use same filename as YADM setting keepdot:true in ~/.config/dotdrop/config.yaml:

config:
  keepdot: true      # same filename as YADM
  dotpath: dotfiles  # set your dotfiles repo path/name
  backup: true
  banner: false
  create: true
  link_dotfile_default: nolink
  link_on_import: nolink
  longkey: false
dotfiles:
[...]

In order to have a dotfiles repo without dotdrop configuration and subfolder, use two repos:

Use tree -a -I .git ~/.config/dotdrop/ to have a look on your dotfiles backup:

$ tree -a -I .git ~/.config/dotdrop/
~/.config/dotdrop/
├── config.yaml     # above configuration file
├── .gitmodules     # main repo: ~/.config/dotdrop/
└── dotfiles        # Git submodule similar to YADM repo
    ├── .gitconfig
    ├── .bashrc
    ├── .config
    │   └── htop
    │       └── htoprc
    └── .ssh
        └── config

In the second installation, no need of the main dotdrop repo because the ~/.config/dotdrop/config.yaml is archived within the dotfiles repo. After each dotdrop import, also perform:

dotdrop import ~/.config/dotdrop/config.yaml
cd ~/.config/dotdrop/dotfiles
git add .config/dotdrop/
git commit -m 'Update dotdrop config'

Encrypt sensitive data

Other dotfiles managers

See also: https://dotfiles.github.io/utilities/

Dotfiles manager alternative

vcsh Multiple Git repositories in $HOME https://github.com/RichiH/vcsh

Sandboxing

Z shell - zsh

Most extra shell extensions are developed for zsh, this is the reason why to use zsh for you daily-used workstation. But, I do not recommend it for production servers where dash (or bash) seems to be more suitable.

To extend Zsh capabilities, you can use either use a zsh plugin manager or manually maintains your plusgins directly within your ~/.zshrc. The plugin manager will help keeping your Zsh plugins uptodate, but can slow down your Zsh startup time.

Plugin managers Activity Motivation
Oh-My-Zsh Active (2009) Historical community-driven project collecting & maintaining hundreds plusgins & thems within one big Git repo for simplicity and having eyes rewieving/checking malware in source code.
Prezto Active (2013) Created in contrast to Oh-My-Zsh, to keep only the plugin manager source code within its Git repo.
Antigen Active (2013) Written in Go to speed up the zsh stratup.
zgen Inactive Fast plugin manager inspired by Antigen (generates a static init script) but written in Zsh to avoid installing Go dependencies when updating the plugin manager. See Nukesor’s fork for most recent commits.
zplug Active Support all kind of plugin sources: Git repo, Oh-My-Zsh/Prezto plugins, binary artifacts

zinit Active Inspired by Zplug (zinit was formely zplugin) but written in C and compiling plugins to bytecode in background (Turbo mode) to be both rich-featured (like Zplug) and having a fast startup.
Antibody Active Like Antigen (in Go), but aiming to be even faster: for example, Antibody loads earlier the zsh and does not require the apply statement.
zr Active Simple plugin manager project written in Rust that generates static init script to speed up zsh startup.

DevOps

Hardware

Health & Work efficiency

Linux

Privacy

Popular self-hostable tools to share passwords:

Quikly converge to valuable API

  1. Design - RĂ©diger une documentation pĂ©dagogique (Markdown) Ă  destination de l’utilisateur final, cela permet de se mettre dans la peau du client, d’itĂ©rer sur ce qu’il lui ferait plaisir, de se baser dessus dans nos Ă©changes, et ainsi de suite jusqu’à obtenir une documentation API mature Ă  publier sur https://docs.example.com
  2. Code - Une fois, que nous sommes synchronisĂ©s et matures dans nos idĂ©es, on code avec des annotations afin de gĂ©nĂ©rer la documentation Ă  partir du code source (OpenAPI, reDoc
). Coder c’est rencontrer des problĂ©matiques techniques auxquelles nous n’avions pas pensĂ©es, et cela nous permet d’accumuler du retour d’expĂ©rience, de gagner encore plus en maturitĂ©, et on implĂ©mente une API diffĂ©rente. La gĂ©nĂ©ration de la documentation est mise Ă  disposition sur https://openapi.exemple.com et https://redoc.exemple.com
  3. Test - On commence Ă  avoir une premiĂšre Ă©bauche de l’API, on commence Ă  mettre Ă  jour la documentation pĂ©dagogique (Markdown), on commence Ă  tester l’API, des premiers utilisateurs nous font des remarques
 encore de nouvelles idĂ©es pour simplifier, pour clarifier
 on re-code
 on re-documente
 on itĂšre

  4. Deliver - Au final, on en a marre de toujours tout chambouler, on finalise dans l’état actuel, on stabilise, on livre ! On garde nos bonnes idĂ©es pour la version suivante :-D

JSON

One JSON per line

The “JSON Lines” formats: https://jsonlines.org/on_the_web/

The mos popular is application/x-ndjson http://ndjson.org/

JSON/JWT versus CBOR/CWT

Une alternative au JWT, est le CWT dont la RFC 8392 (may 2018) explique bien l’intĂ©rĂȘt.

Le CWT utilise CBOR Ă  la place de JSON, CBOR Ă©tant une variante binaire du JSON.

Il existe une dizaine de formats binaires pour JSON (comme BSON, MessagePack
), mais seul CBOR est traitĂ© dans les RFC, donc CBOR semble ĂȘtre mieux standardisĂ©.

See also: RFC 8747 (Proof-of-Possession Key Semantics for CBOR Web Tokens).

JSON dealing with float and 64-bit numbers

Une API qui gÚre des nombres 64 bits et des prix exprimés par des flottants double précision :

En attendant que tous les navigateurs web soient compatibles avec ECMAScript 2021 (BigInt), l’API devrait prendre en charge le format I-JSON :

The API uses a JSON subset format called “Internet JSON” (I-JSON) in order to guaranty a better interoperability with any client software:

However, the API uses the 64-bit signed integer type with the full range [-2⁶³, 2⁶³-1] because modern JavaScript (ECMAScript 2021) supports BigInt type and are no more limited to the [-2⁔³+1, 2⁔³-1] range. All other popular programming languages do not have this number range limitation. See also RFC 8785 Appendix D.

Other

Public Domain Dedication

CC0 1.0 Universal

Creative Commons Zero   No Rights Reserved   (CC) ZERO   (0) PUBLIC DOMAIN

To the extent possible under law, olibre has waived all copyright and related or neighboring rights to GreatPractices. This work is published from France since 2015. Refer to CC0 Legal Code or a copy in file COPYING.