Is there a real benefit to using cout as opposed to printf that offsets the extra work in formatting?

This page summarizes the projects mentioned and recommended in the original post on /r/cpp

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • C++ Format

    A modern formatting library

  • See the readme for fmt: https://github.com/fmtlib/fmt . The resulting binary size is actually closer to printf than it is to iostreams.

  • papers

    ISO/IEC JTC1 SC22 WG21 paper scheduling and management (by cplusplus)

  • Good news, they're adding that retroactively to C++20.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • tinyformat

    Minimal, type safe printf replacement library for C++

  • However, not all is lost. While there are libraries like {fmt} I don't pay attention to them because they are far away into The Future and unusable with my requirements (C++03 support at the earliest, work reasons). Most newfangled libs I've seen are intended for Compilers of the Future, for C++20/C++23 and the like, and with that among other reasons are not generic enough for me. Instead I just use tinyformat that lays on top of both and bridges them, not to mention the biggest sell that is rrtaining the POSIX style printf notation (why didn't {fmt} go with that is still a mystery to me).

  • printf-tac-toe

    tic-tac-toe in a single call to printf

  • I looked it up and printf() being Turing complete is to be taken with a grain of salt, but much more can be done with printf() than I would have ever thought. A paper outlining the dangers of printf() was followed by a game of Tic Tac Toe entirely run from a printf() (minus some #defines). http://nebelwelt.net/publications/files/15SEC.pdf https://github.com/carlini/printf-tac-toe

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts