TGViewer
Programming & AI Tips 💡 Programming & AI Tips 💡 @programmingtip · 46.3K subscribers
Post #30 1.68K
How your classes should be ? 💭

Think of a well-written newspaper article, You read it vertically.

At the top you expect a headline that will tell you what the story is about and allows you to decide whether it is
something you want to read. The first paragraph gives you a synopsis of the whole story.

As you continue down-ward, the details increase until you have all the dates, names, quotes, claims, and other
minutia.

We would like a source file to be like a newspaper article. 📜

The name should be simple but explanatory.

The name, by itself, should be sufficient to tell us whether we are in the right module or not.

The topmost parts of the source file should provide the high-level concepts and algorithms.

Detail should increase as we move downward, until at the end we find the lowest level functions and details in the source file.

A newspaper is composed of many articles; most are very small, Some are a bit larger, Very few contain as much text as a page can hold.

This makes the newspaper usable. If the newspaper were just one long story containing a disorganized agglomeration of facts, dates, and names, then we simply would not read it !

#CleanCode #NewsPaper #Metaphor
More from @programmingtip
  1. Oct 8, 2026GPT-6 and Intelligent UI are rolling out 🚀 OpenAI announced GPT-6 for everyone, alongside…
  2. Oct 7, 2026OpenAI Decisions API is in public beta 🚀 OpenAI's Decisions API is now in public beta. It…
  3. Oct 6, 2026Cloudflare shipped a Web Search API ⚡️ Cloudflare introduced a Web Search API. Search can…
  4. Oct 5, 2026AI is changing the developer career ladder 🚀 GitHub's latest developer career advice is r…
  5. Oct 2, 2026GPT-6 Astra gets an Ultrafast API tier 🚀 OpenAI added an Ultrafast speed tier for GPT-6 A…
  6. Oct 1, 2026Cloudflare shipped an agentic CLI for its API ⚡️ Cloudflare launched cf, an agentic CLI fo…
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 →