<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Irfan Ismail</title>
    <description>The latest articles on DEV Community by Irfan Ismail (@irfancoder).</description>
    <link>https://dev.to/irfancoder</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F349316%2F95cbd2a7-d724-4d5e-8c2c-a14c2d9e7254.jpeg</url>
      <title>DEV Community: Irfan Ismail</title>
      <link>https://dev.to/irfancoder</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/irfancoder"/>
    <language>en</language>
    <item>
      <title>[Discussion] Named routes vs file-based routes on frontend frameworks</title>
      <dc:creator>Irfan Ismail</dc:creator>
      <pubDate>Sat, 25 Jun 2022 12:39:40 +0000</pubDate>
      <link>https://dev.to/irfancoder/thoughts-on-named-routes-vs-file-based-routes-on-frontend-frameworks-ah4</link>
      <guid>https://dev.to/irfancoder/thoughts-on-named-routes-vs-file-based-routes-on-frontend-frameworks-ah4</guid>
      <description>&lt;p&gt;Hi guys, I wanted to know the community's thoughts on named routes on the frontend frameworks instead of the file system routing (like on NextJS or Nuxt). &lt;/p&gt;

&lt;p&gt;For those who are unaware, named routes is a common feature on backend frameworks (eg. Laravel, express), where you statically declare the routes, assign a name &amp;amp; have a specific handler for it. File based routing generates the app's route based on the files present in a designated folder (ie &lt;code&gt;/pages&lt;/code&gt;)&lt;/p&gt;




&lt;p&gt;Personally, I think named routes is a much better development experience than file-based routing. My thoughts: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Consistent route generation tooling through named patterns. Eg.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;declare the route: &lt;code&gt;route('/', 'home:index')&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Then, when generating the URL, you can: &lt;code&gt;route('home:index')&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You don't manage URL strings directly, control is abstracted for query or parameter replacement.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Clear view of the routes available to the app&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Extensible to other route-based logic inside the app (middleware &amp;amp; layout generation, etc)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Not sure if this has been discussed, but would like to know your thoughts whether you agree to the same reasoning or have different opinion about this. Cheers &lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
