<story><title>A Critique of React Hooks</title><url>https://dillonshook.com/a-critique-of-react-hooks/</url></story><parent_chain><item><author>desc</author><text>I&amp;#x27;m going to express something a lot of people are thinking and are being far too diplomatic about.&lt;p&gt;React Hooks are a &lt;i&gt;fucking stupid idea&lt;/i&gt; and always were.&lt;p&gt;They&amp;#x27;re basically just adding dynamic scoping to a language and framework which doesn&amp;#x27;t need it, in one of the most &amp;#x27;magical&amp;#x27; and confusing ways possible. You have to care about execution order to understand exactly how they&amp;#x27;ll all work and that &lt;i&gt;will&lt;/i&gt; bite you eventually if you&amp;#x27;re building anything without knowledge of all the contexts in which it&amp;#x27;s called.&lt;p&gt;There&amp;#x27;s a reason that most languages stick to lexical scoping: you can &lt;i&gt;see&lt;/i&gt; the dependencies, in the same file.&lt;p&gt;And a large portion of the value of functional languages is that they avoid state, making magic-at-a-distance impossible.&lt;p&gt;Boilerplate is not the problem. Magic is the problem.</text></item></parent_chain><comment><author>azirbel</author><text>I for one preferred the diplomacy.&lt;p&gt;The &amp;#x27;magic&amp;#x27; involved in hooks is a tradeoff; there are real benefits in the way you can consolidate logic, or mix in behaviors. Personally, I strongly prefer hooks to HOCs.&lt;p&gt;Many technologies have magical behaviors and are still very popular and useful (Rails comes to mind). I&amp;#x27;m really liking the pros and cons being brought up in the rest of this thread.</text></comment>
<story><title>A Critique of React Hooks</title><url>https://dillonshook.com/a-critique-of-react-hooks/</url></story><parent_chain><item><author>desc</author><text>I&amp;#x27;m going to express something a lot of people are thinking and are being far too diplomatic about.&lt;p&gt;React Hooks are a &lt;i&gt;fucking stupid idea&lt;/i&gt; and always were.&lt;p&gt;They&amp;#x27;re basically just adding dynamic scoping to a language and framework which doesn&amp;#x27;t need it, in one of the most &amp;#x27;magical&amp;#x27; and confusing ways possible. You have to care about execution order to understand exactly how they&amp;#x27;ll all work and that &lt;i&gt;will&lt;/i&gt; bite you eventually if you&amp;#x27;re building anything without knowledge of all the contexts in which it&amp;#x27;s called.&lt;p&gt;There&amp;#x27;s a reason that most languages stick to lexical scoping: you can &lt;i&gt;see&lt;/i&gt; the dependencies, in the same file.&lt;p&gt;And a large portion of the value of functional languages is that they avoid state, making magic-at-a-distance impossible.&lt;p&gt;Boilerplate is not the problem. Magic is the problem.</text></item></parent_chain><comment><author>Sophistifunk</author><text>This. So much this. You are 100% correct. Hooks are incredibly stupid. No, your component is not &amp;quot;functional&amp;quot; because you don&amp;#x27;t use the word &amp;quot;this&amp;quot;. You still have a &amp;quot;this&amp;quot;, it&amp;#x27;s just fucking secret now so your debugging is harder. I could go on about all the other reasons hooks are stupid, but JavaScript is largely a cargo cult and I&amp;#x27;m a nobody so I&amp;#x27;d just be wasting my breath.</text></comment>