What are the potential drawbacks of including JavaScript directly in PHP views instead of external files?

Including JavaScript directly in PHP views can lead to code duplication, decreased maintainability, and decreased performance due to the increased size of the HTML files. To solve this issue, it is recommended to separate JavaScript code into external files and include them in the PHP views using the <script> tag.

&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;Example Page&lt;/title&gt;
    &lt;script src=&quot;external.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;h1&gt;Welcome to the page&lt;/h1&gt;
    &lt;p&gt;This is some content&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;