-
Rebecca Turner authored
`with` and `rec` are considered anti-patterns: - `with` makes it unclear where variables are assigned and what variables refer to. Instead of `with pkgs; [ foo ]`, write `[ pkgs.foo ]` directly. - `rec` also makes it unclear what variables refer to and makes it easy to introduce subtle bugs. Instead of `rec { a = 1; b = a; }`, use a let binding: let a = 1; b = a; in { inherit a b; }Rebecca Turner authored`with` and `rec` are considered anti-patterns: - `with` makes it unclear where variables are assigned and what variables refer to. Instead of `with pkgs; [ foo ]`, write `[ pkgs.foo ]` directly. - `rec` also makes it unclear what variables refer to and makes it easy to introduce subtle bugs. Instead of `rec { a = 1; b = a; }`, use a let binding: let a = 1; b = a; in { inherit a b; }
Loading