TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The reusability fallacy – Part 3

89 pointsby galaktorabout 5 years ago

9 comments

ivanbakelabout 5 years ago
&gt;The latest paradigm “Microservices” became popular in the mid 2010s.<p>Microservices isn&#x27;t for re-usability. It&#x27;s main benefit is better encapsulation, which should let you do independent resource management&#x2F;deployments&#x2F;failures.<p>&gt;If we look at reusability, we notice that this is the tightest form of coupling possible: If the reused part is not available, the reusing part cannot complete its work by definition.<p>What? This is a weird nothing-burger of a sentence. Why can&#x27;t multiple components re-use some resource without gracefully handling any failures? Why does re-usability mean &quot;cascading failures by design&quot;?<p>&gt;An important property of reuse is that the reusing part ... does not work without the reused asset ... The reused functionality is an integral part of the solution that (re-)uses it.<p>Oh, I see: because the author has defined it this way. Then the article goes on to try to argue a semantic difference between &quot;usability&quot; and &quot;re-usability&quot;, in that usable components can be re-used independently, but in a way that can gracefully fail! So the whole thing is just begging the question.<p>There&#x27;s no argument here as to why I can&#x27;t write a distributed component with an eye to it being re-used in the future. There is no criticism of re-use in distributed systems. The only criticism is of tight coupling, which is totally valid, and then saying that re-use <i>demands</i> tight coupling, which is not substantiated.
评论 #22720232 未加载
评论 #22712756 未加载
评论 #22713031 未加载
评论 #22712880 未加载
discreteeventabout 5 years ago
Szyperski also said this back in 1997. &quot;Maximizing reuse minimizes use&quot;<p><a href="https:&#x2F;&#x2F;books.google.ie&#x2F;books?id=U896iwmtiagC&amp;pg=PA45&amp;lpg=PA45&amp;dq=maximize+reuse+minimise+use+szyperski&amp;source=bl&amp;ots=FH0S7vrsaI&amp;sig=ACfU3U1xIujcH8XOMiFlg7lXUWS4KHaR7g&amp;hl=en&amp;sa=X&amp;ved=2ahUKEwiU7ufNyr3oAhVKSBUIHaXgBxEQ6AEwCnoECAUQAQ#v=onepage&amp;q=maximize%20reuse%20minimise%20use%20szyperski&amp;f=false" rel="nofollow">https:&#x2F;&#x2F;books.google.ie&#x2F;books?id=U896iwmtiagC&amp;pg=PA45&amp;lpg=PA...</a>
galaktorabout 5 years ago
Part 1: <a href="https:&#x2F;&#x2F;www.ufried.com&#x2F;blog&#x2F;reusability_fallacy_1&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.ufried.com&#x2F;blog&#x2F;reusability_fallacy_1&#x2F;</a><p>Part 2: <a href="https:&#x2F;&#x2F;www.ufried.com&#x2F;blog&#x2F;reusability_fallacy_2&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.ufried.com&#x2F;blog&#x2F;reusability_fallacy_2&#x2F;</a><p>Part 1 was posted previously but without much discussion: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=22583605" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=22583605</a>
whackabout 5 years ago
The &quot;fallacy&quot; breaks down pretty quickly when we consider its implications. If we were to follow the suggestions given, we shouldn&#x27;t be using:<p>- Email services such as SES or Sendgrid<p>- Password auth services such as Firebase<p>- Chat services such as Twilio<p>You might say those are extreme examples, and that&#x27;s the whole point. Clearly there are a ton of use-cases where it makes sense to build reusable services once, and using it across many clients. Not just for &quot;enhancements&quot;, but as an integral part of your service&#x27;s functionality. So how and where do we draw the line between reusable services and avoiding service-dependencies? That&#x27;s the real question we should be asking, and one I don&#x27;t see being answered in the article.
评论 #22714850 未加载
评论 #22713803 未加载
评论 #22715724 未加载
danielovichdkabout 5 years ago
I think about reuse in a couple of different ways.<p>I do not copy paste the same exact code multiple places. Then i use the same code.<p>If the code is not exactly the same, it&#x27;s not a copy, hence it&#x27;s not up reuse.<p>I do not generalize code before 3rd strike and refactor can be applied, and then I still use a lot of time thinking if it might a premature optimization.<p>I write microservices the same way as i write methods. If i copy and paste the exact same microservice, it might be up for reuse (3 strikes). If it&#x27;s reuse, the same specifics applies as when programming a method or type.<p>I would never ever write any new code with reuse in mind. It&#x27;s arrogant to think one can forsee the future, and that&#x27;s exactly what writing for rejse is about. Start small, evolve.
nikanjabout 5 years ago
Java has the opposite problem. One of the often repeated taglines is &quot;If you&#x27;re unhappy with X, you can easily replace it with Y, Z, or Q!&quot;<p>I just want one well-working thing, not twenty alternatives - seven of which turn out to be abandoned, three incomplete, one only works with Java 15 beta, and two are actually forks of the same abandoned pre-Oracle blogpost from Sun.
评论 #22715548 未加载
6510about 5 years ago
Like my own his English is good but not <i>that</i> good. His seems the right way to explain (there probably is a formal description for the style of writing (and a word for it in German)) but when reception is not guaranteed (I keep feeling like I almost got his point.) I would lower myself to explaining by code example. Something like a &quot;hello world&quot; of usable vs re-usable. Someone more skilled in the art should probably address note 6 ( <a href="https:&#x2F;&#x2F;www.ufried.com&#x2F;blog&#x2F;reusability_fallacy_3&#x2F;#fn:6" rel="nofollow">https:&#x2F;&#x2F;www.ufried.com&#x2F;blog&#x2F;reusability_fallacy_3&#x2F;#fn:6</a> )<p>I did recall a thought I had some years ago that I will describe crudely because I&#x27;m lazy:<p>Parts of applications, by popularity, should be re-implemented in API&#x27;s.<p>Parts of API&#x27;s, by popularity, should be implemented in modules.<p>Parts of modules, by popularity, should be implemented in frameworks.<p>Parts of frameworks, by popularity, should be implemented in (higher) languages (then lower)<p>Parts of languages, by popularity, should be baked into hardware.<p>(Unpopular parts should migrate the other way around but that is not important right now)
galaxyLogicabout 5 years ago
What do we mean by &quot;software reuse&quot;? I propose this definition: Software reuse happens whenever a given piece of code is called from more than one other code-location.<p>That means whenever a function has more than one caller we have reuse. Or when a web-service request is created from more than one code-location, we have reuse.<p>Is there an official definition for what &quot;software reuse&quot; means?
m3kw9about 5 years ago
From my experience actual good reusable code are very small and usually relatively simple great specialized task. As the component get more features, and when you use it, you are in a trade off situation where this works, but it doesn’t fully do exactly what the requirement needs orbit does way more than it needs