https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112021-07-30T07:53:49ZRuby Issue Tracking SystemRuby master - Feature #18055: Introducehttps://bugs.ruby-lang.org/issues/18055?journal_id=930612021-07-30T07:53:49Zshalokshalom (Matthias Schuster)
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/93061/diff?detail_id=60504">diff</a>)</li></ul> Ruby master - Feature #18055: Introducehttps://bugs.ruby-lang.org/issues/18055?journal_id=930622021-07-30T08:06:12Zmatz (Yukihiro Matsumoto)matz@ruby.or.jp
<ul></ul><p>Can you explain how <code>introduce</code> solves the issue? How it is better than <code>require</code> and <code>autoload</code>?</p>
<p>Matz.</p> Ruby master - Feature #18055: Introducehttps://bugs.ruby-lang.org/issues/18055?journal_id=930632021-07-30T09:30:30Zshalokshalom (Matthias Schuster)
<ul></ul><p>Hi Matz!</p>
<p>I see value in it, since it gives us one unified way, to call libraries:</p>
<p>Where ever you do it, when ever you do it, it is always the most optimal choice.</p>
<p>Currently, users shy away from using autoload, since its riddled with use cases, in which it can bite your back.</p>
<p><code>introduce</code> always uses the most optimal way.</p>
<p>This gives a nice 'wrapper' around autoload and require, that lets us use always the most optimal of the two.</p>
<p>It can encourage, to load libraries only, when they are really used, and by that, increasing the start-up performance.</p>
<p>I hope this can help :)</p>