482 karma · joined January 11, 2017
Do people not realize that projects like Linux and pretty much every car's ECU software (pretty "substantial" in my opinion) is written in C before claiming this? I'm not saying these software are 100% bug free, but this claim isn't accurate either. You _can_ write substantial C code when you have a good understanding of the tooling around it. Mere learning the syntax isn't enough.
Actually, sometimes it is best to have a fixed size buffer, sized appropriately for the maximum data-bytes allowed as per design. Especially true for embedded systems where dynamic allocation is usually frowned upon.
There's a `restrict` keyword in C99.
> const really means const, where in C the compiler has to assume any pointer-to-const might be use to write through
Lookup what `const int *const ptr` does in C.
[1] http://pixelscommander.com/wp-content/uploads/2014/12/P10.pd...
I thought I was a “Dark Matter Dev” until this. But then it’s weekend so maybe I still am.
This does sound a good solution on paper, but "checking at the start" and "creating a file" are two different steps (i.e. not atomic) and will cause trouble eventually if your system has the tendency to run the script twice. A better solution is to use the `flock` command before creating the flag file. For example,
exec 999>/var/lock/my.lock
flock -n 999 || exit 1
if [ ! -f flag_file ]; then
echo "script not ran before, running"
touch flag_file
else
echo " already ran, exiting"
exit 1
fi
# do stuff here1. https://www.seattletimes.com/business/boeing-aerospace/a-lac...
On the negatives: A bit heavier than Bose headphones but not by much. The "touch control" is sometimes annoying to use.
On top of it, his reason to switch from Go to Rust is laughable at best.