• 2 Posts
  • 439 Comments
Joined 1 year ago
cake
Cake day: September 24th, 2023

help-circle


  • Actual blog post.

    Great accomplishment. I think we all knew it must happen like this but it’s great to see real world results.

    I think this is probably actually the most useful part of the post:

    Increasing productivity: Safe Coding improves code correctness and developer productivity by shifting bug finding further left, before the code is even checked in. We see this shift showing up in important metrics such as rollback rates (emergency code revert due to an unanticipated bug). The Android team has observed that the rollback rate of Rust changes is less than half that of C++.

    I think anyone writing Rust knows this but it’s quite hard to convince non-Rust developers that you will write fewer bugs in general (not just memory safety bugs) with Rust than with C++. It’s great to have a solid number to point to.



  • In common usage a linter detects code that is legal but likely a mistake, or code that doesn’t follow best practice.

    Although static type checkers do fit in that definition, that definition is overly broad and they would not be called a “linter”.

    Here is how static type checkers describe themselves:

    Pyright is a full-featured, standards-based static type checker for Python.

    Mypy is a static type checker for Python.

    TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at any scale.

    Sorbet is a fast, powerful type checker designed for Ruby.

    Here is how linters describe themselves:

    Pylint is a static code analyser for Python 2 or 3. … Pylint analyses your code without actually running it. It checks for errors, enforces a coding standard, looks for code smells, and can make suggestions about how the code could be refactored.

    (Ok I guess it’s a bit redundant for Pylint to say it is a linter.)

    Eslint: The pluggable linting utility for JavaScript and JSX

    Clippy: A collection of lints to catch common mistakes and improve your Rust code.

    Ruff: An extremely fast Python linter and code formatter, written in Rust.

    You get the idea… Linters are heuristic and advisory. Quite different to static type checking.












  • This is the sort of thing you have to learn by experience, like how you can’t really learn good coding taste from reading a list of rules (though some lists are helpful).

    Anyway in my experience documentation is quite different in public (i.e. seen by customers) and private (inside your company). For internal stuff there’s a much smaller incentive to document things because:

    1. documentation tends to be inconsistent (as you discovered), so people give up looking for it. Instead they just ask other people. This actually works fairly well inside a company because you can generally easily access whoever is responsible (as long as they haven’t left).
    2. there aren’t customers to keep happy and away from support.

    I think the best thing to do is to accept that people aren’t going to expect documentation internally. There’s zero point writing guides to tools on your company wiki or whatever, because nobody will even try to look for it - they’ll assume it doesn’t exist.

    Instead you should try to keep your documentation as close to the user as possible. That means, don’t have a separate docs folder in your repo - put your docs as comments in the code.

    Don’t put deployment instructions on your wiki - add a ./deploy.sh script. It can just echo the instructions initially.