Modern C for C++ Peeps

date: 2022-01-12 · Tags: #clang, #good-reading

C++ is not a superset of C, vice versa, (modern) C is definitely not a subset of C++.

Rain's Rust CLI recommendations

date: 2022-01-23 · Tags: #rust, #cli

Prefer to use clap with the derive feature. Try argh, pico-args for smaller bundle size.

  1. Rain's Rust CLI recommendations
  2. Command Line Applications in Rust

Useful Tool: command-to-found.com

date: 2022-01-22 · Tags: #cli, #tools

Finally I found this helper to locate detailed package when you got "command not found" in shell TAT

>_ commond-not-found.com

Useful Tool: RegexLearn

date: 2022-01-21 · Tags: #regex

Awesome project to let you learn regex with interactive practices without pains !!!

Regex Cheatsheet

软件工程是个面包机

date: 2022-01-12 · Tags: #insight, #good-reading, #career, #dev, #chinese

Strongly recommended reading: Learn what does industry actually mean?

软件工程是个面包机 (Chinese)

Remix vs Next.js

date: 2022-01-11 · Tags: #front-end, #good-reading, #web

How new framework desigh its features to compare old brother?

  • Ergonic
  • Use native web feature (SWR)

What I'm interested is the idea "work before Javascript"

What other things except of speed?

Remix vs Next.js

Unbuffered I/O Can Make Your Rust Programs Much Slower

date: 2022-01-07 · Tags: #rust, #til, #python, #dev
  1. Use strace and perf to count how many syscalls were invoked.
  2. Yeah, Rust actually supports file I/O without buffer. It's may more simple in some situtations

Conclusion

In this post1, we saw that:

  • System calls in Linux are slower than regular functions
  • Issuing too many syscalls can have very negative effects on run-time performance
  • By using BufReader and BufWriter, we can amortize the cost of syscalls
  • Even experienced programmers can miss these issues
  • We can use strace and awk to find if and where unbuffered I/O happens in our programs

Footnotes

  1. Unbuffered I/O Can Make Your Rust Programs Much Slower

Best practices for writing code comments

date: 2022-01-04 · Tags: #til, #insight, #dev

Good rules for writting comments

Best practices for writing code comments