TGViewer
HowProgrammingWorks - JavaScript and Node.js Programming HowProgrammingWorks - JavaScript and Node.js Programming @howprogrammingworks · 6.52K subscribers
Post #1641 4.32K
🙊 The Law of Demeter (LoD): Don’t talk to strangers

If you see something like this:
👉 connection.parent.service.storage.db.saveRecord
👉 this.action.scenario.bot.telegram.sendMessage
👉 service.find('logger').kind('error').stream.write

You have technical debt! It's time to plan refactoring.
Each entity (unit/instance) should have only limited knowledge about others (only "closely" related to the current one).
Each entity should only talk to its friends (immediate friends): don’t talk to strangers!

Вut don't do it in a panic and do not mix refactoring with other issues (like new features implementation).
Just note that and plan resource allocation.
  • 👍 17
  • 💯 2
More from @howprogrammingworks
  1. Oct 6, 2026Post #2188
  2. Oct 4, 2026На кого учиться, если все профессии отберут роботы? Где пределы экспансии искусственного и…
  3. Oct 4, 2026Объем текста и объем кода должны заставлять нас не махнуть рукой, а заставлять ии делать м…
  4. Oct 3, 2026https://youtu.be/I5ILntVSjkQ
  5. Oct 2, 2026Dashboard with real-time monitoring Released in reslop v0.2.6 https://github.com/tshemsedi…
  6. Oct 2, 2026video post
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 →