TGViewer
Блог* Блог* @dereference_pointer_there · 1.98K subscribers
Post #11270 903
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.

void openAndDo(char* fileName, void (*doTo)(FILE*)) {
FILE* f = fopen(fileName, "r+");
doTo(f);
fclose(f);
}


Это из критики второй редакции Clean code, но цитата из книги прямая. Дядя Боб не умеет программировать
  • 🤣 20
  • 👎 1
  • 🤮 1
  • 💩 1
  • 🫡 1
More from @dereference_pointer_there
  1. Sep 27, 2026photo post
  2. Sep 27, 2026#meme про прожиг дисков
  3. Sep 27, 2026Если вы считаете себя бесстрашным, попробуйте познакомиться с женщиной.
  4. Sep 27, 2026Почему я не работаю на себя? Начальник кретин
  5. Sep 26, 2026Эм...
  6. Sep 26, 2026#politota #meme, видимо
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →