• 0 Posts
  • 134 Comments
Joined 2 years ago
cake
Cake day: July 3rd, 2023

help-circle


  • printf is superior and more concise, and snprintf is practically the only C string manipulation function that is not painful to use.

    Try to print a 32-bit unsigned int as hexadecimal number of exactly 8 digits, using cout. You can do std::hex and std::setw(8) and std::setfill('0') and don’t forget to use std::dec afterwards, or you can just, you know, printf("%08x") like a sane person.

    Just don’t forget to use -Werror=format but that is the default option on many compilers today.

    C++23 now includes std::print which is exactly like printf but better, so the whole argument is over.















  • It’s ultimately a question of money. Older guys with software engineering degrees and fancy salaries can spend their weekends doing free community service in the form of open-source development. Younger people have to worry about job and rent and bills, they simply don’t have that kind of free time.

    Add to that the growing complexity of the software. Something that could be done by an university student before, like writing an OS from scratch, won’t be nearly as useful as it would in the '90-s, because it was already done before, now you have multiple OSes to choose from. And joining an existing software project is hit-or-miss, some are inclusive and some are an old boy club where you need to know the secret rules.