-
Notifications
You must be signed in to change notification settings - Fork 67
01. What is wrong with iostream and stdio? And why use this fast_io library?
The iostream library in C++ has been a topic of debate for quite some time. While it does a few things right, it also has several issues. One of the main problems is its overuse of Object-Oriented Programming (OOP), which violates the zero-overhead principle. Additionally, iostream contributes to runtime bloat, and its performance is suboptimal. Many large C++ projects, including LLVM, GCC, Google's, and Microsoft’s, have opted to ban iostream due to these issues. Although newer C++ features can replicate some of iostream’s functionality, they lack the same composability, making it challenging to find a fundamental replacement.
Regarding the alternative stdio, it also has its drawbacks. While it avoids some of iostream’s issues, it remains slow, and its mandatory locale and format string complexities have raised security concerns.
This is precisely why I initiated the fast_io library project. We need a modern alternative based on generic programming rather than traditional or Object-Oriented programming.