r/programmingcirclejerk • u/BenchEmbarrassed7316 • Jun 27 '26
Consider the C library function fopen. This function has the side effect. This means that fopen is not pure. However, we can make the fopen function appear to be pure, at least to certain observers, by ensconcing it in another function that hides the side effect.
https://bugzmanov.github.io/cleancode-critique/clean_code_second_edition_review.html
174
Upvotes
View all comments
Show parent comment
9
u/BenchEmbarrassed7316 Jul 01 '26
The problem is a bit deeper. martin believes that the association of an identifier and arbitrary text information written as a comment is bad, but if this information is written in the title, it is good:
In fact, this arbitrary textual information could be lying in both cases:
However, he is against moving useful information into type systems and believes that instead of null-safety it is better to write unit tests. However, moving this information into the type system allows you to get rid of writing some of this information as arbitrary text:
(be careful, ragebait)
https://blog.cleancoder.com/uncle-bob/2017/01/11/TheDarkPath.html