339 private links
Rule 1: Restrict all code to very simple control flow constructs
Rule 2: Give all loops a fixed upper bound.
Rule 3: Do not use dynamic memory allocation after initialization.
Rule 4: No function should be longer than what can be printed on a single sheet of paper in a standard format with one line per statement and one line per declaration. Typically, this means no more than about 60 lines of code per function.
Rule 5: The code's assertion density should average to minimally two assertions per function. Assertions must be used to check for anomalous conditions that should never happen in real-life executions. Assertions must be side-effect free and should be defined as Boolean tests. When an assertion fails, an explicit recovery action must be taken such as returning an error condition to the caller of the function that executes the failing assertion. Any assertion for which a static checking tool can prove that it can never fail or never hold violates this rule.
Rule 6: Declare all data objects at the smallest possible level of scope.
Rule 7: Each calling function must check the return value of nonvoid functions, and each called function must check the validity of all parameters provided by the caller
Rule 8: preprocessor must be limited to the inclusion of header files
Rule 9: The use of pointers must be restricted. Specifically, no more than one level of dereferencing should be used.
Rule 10: All code must be compiled, from the first day of development, with all compiler warnings enabled at the most pedantic setting available. All code must compile without warnings. All code must also be checked daily with at least one, but preferably more than one, strong static source code analyzer and should pass all analyses with zero warnings.
Writing acts as transcribing as much words as possible that is like a creation mode. The goal is fast.
Editing goes the other way: focus on quality.
Structure the ideas (Islands and Bridges strategy similar to ones required at school.
Make clarity out of it.
Then provide a style. To do so, I diversify my vernacular, add colorful details, and give my writing rhythm by changing the length of sentences and the words inside of them.
KISS for maintainability: "Nothing in Rust forces us to get fancy. You can write straightforward code in Rust just like in any other language. But in code reviews, I often see people trying to outsmart themselves and stumble over their own shoelaces. They use all the advanced features at their disposal without thinking much about maintainability."
Here an real life example.
But if simplicity is so obviously “better,” why isn’t it the norm? Because achieving simplicity is hard!
Even in Rust: abstractions are never zero cost for developers.
Often, simple code can be optimized by the compiler more easily and runs faster on CPUs. That’s because CPUs are optimized for basic data structures and predictable access patterns. And parallelizing work is also easier when that is the case. All of that works in our favor when our code is simple.
Most of the code you’ll write for companies will be application code, not library code. That’s because most companies don’t make money writing libraries, but business logic. There’s no need to get fancy here. Application code should be straightforward to keep your fellow developers in mind.
Tips:
- start small
- avoid optimization early
- delay refactoring: we have limited information at the time of writing our first prototype.
- write code for humans
- The right abstractions guide you to do the right thing
As a nuclear engineer, I have never been asked to show my portfolio of reactor designs I maintain in my free time, I have never been asked to derive the six-factor formula, the quantization of angular momentum, Brehmsstrahlung, or to whiteboard gas centrifuge isotopic separation, water hammer, hydrogen detonation, or cross-section resonance integrals.
There's something deeply wrong with an industry that presumes you're a fraud unless repeatedly and performatively demonstrated otherwise and treats the hiring process as a demented form of 80s-era fraternity hazing.
La population veillis et se concentrent dans les grandes villes.
Similar to tailwind, but somehow better?
A phishing attack is running on crates.io
CSS anchor positioning includes many advantages!
It can be placed upon an element, origin from the center of the element, or next to it with position-area inside a 3x3 grid area. The position-area can span cells.
It can also have fallbacks with flip-blocks, flip-inline and flip-start.
Related CSS properties:
- anchor-name
- position-anchor
- position-area
- position-try-fallbacks
The post does not relate how to handle spacing though.
Some different ways to write HTML
CauseNet aims at creating a causal knowledge base that comprises all human causal knowledge and to separate it from mere causal beliefs, with the goal of enabling large-scale research into causal inference.