C++ Readability vs. Standard Library Hieroglyphics
Description
A two-panel meme contrasting different types of C++ programmers. The top panel is labeled 'Regular C++ programmers' and shows a man with a concerned expression sitting at a computer. A speech bubble from him reads, 'My code needs to be readable or I won't understand it tomorrow...'. The bottom panel, labeled 'C++ Standard lib programmers', shows the same man in the same posture, but his head has been replaced with a grey alien's head. The computer screen in front of him, which was normal before, now displays a block of chaotic, unreadable text resembling Zalgo text or ancient symbols. This meme humorously exaggerates the perceived complexity and inscrutability of C++ Standard Library (STL) code. It plays on the idea that while most developers prioritize writing clear, maintainable code, those who work on the standard library delve into such deep, complex template metaprogramming that their code becomes 'alien' and unreadable to the average programmer
Comments
15Comment deleted
Some C++ programmers write readable code to solve problems. STL programmers write unreadable code just to see if the compiler's SFINAE implementation starts crying
Why bother writing docs when the compiler will gladly emit a 500-line template instantiation traceback that doubles as your architecture diagram?
The STL maintainer who wrote std::enable_if_t<std::is_invocable_v<...>> just got promoted for reducing compile times by 3% while simultaneously making debugging impossible for the next decade of engineers
The C++ Standard Library: where `std::enable_if_t<std::is_same_v<decltype(std::declval<T>()), U>>` is considered 'self-documenting code' and your future self will need a Rosetta Stone to decipher what you meant by that perfectly cromulent SFINAE expression you wrote at 2 AM
Std::lib developers don’t write comments; they let two-phase lookup and SFINAE annotate the code as a 900-line compiler error
STL: where 'readable tomorrow' requires resurrecting the metaprogramming monk who wrote it
Zero-cost abstractions: the CPU pays nothing; your reviewers, compilers, and 3 a.m. on-call pay the invoice
__std_crp_ttl_ra2 Comment deleted
Kind of where nightmares come into existence Comment deleted
Когда lorem ipsum folor sit amet Comment deleted
До сих пор не понимаю зачем у них локальные даже имена переменных с начинаются с __ Comment deleted
Стдлиба должна пережить дефайн Comment deleted
Да, действительно, чет я тупенький и не додумался, спасибо. Забыл про возможность #define true false и подобного, и чтобы это не ломало стдлиб Comment deleted
Please use English as a main language in this chat -- add a translation Comment deleted
No doubt c/cpp will allow you to that :). Theoretically, you can completely write your own preprocessor language dialect with unique constructions & other things, and that's the reason a lot of people like it (incl. me). However, I think we were discussing cases when you don't want absolutely accidentally break things up, not when you're really wishing to shot yourself in the leg Comment deleted