Okay! Next.js 🤯 is not that bad.
Tags: watercooler, productivity, webdev, nextjs
Published: 2024-07-03 13:04:17

I have a love-hate relationship with JavaScript! Having worked with it for more than 10 years building sliders, jQuery UIs, and React SPAs, I know its warts and imperfections fairly well, but alas compared to its lesser-known competitor VBScript, I'll take JS thank you! 

Fast forward to 2024, you can't get very far without deep diving into React for all the UI fanciness that modern apps demand. My favorite web frameworks are Echo (Golang), Laravel(PHP), and Django (Python) but just sometimes, it's better to do everything in one stack.

## Typescript is weird 🤷 

I am all too familiar with strongly typed languages like Go and C#, but TypeScript just feels more verbose and "dirty". I am Minimalist at heart - so that's probably why.

Anyway, after throwing up a bit 🤮 I got over the weirdness and am fairly comfortable with it now. Not my favorite language ever, but it's okay I guess.

## Next.js is lean and clean

One of my major problems with Laravel; don't get me wrong, it's a beautiful and powerful framework, but there's just too much stuff! Controllers, routes, views, livewire, and the list goes on and on...

Next.js favors convention over configuration; the skeleton template comes with just a handful of folders/files and a big bonus: you get React baked in.

The routing is a breeze, maybe I'm too lazy 🙄 but setting up a Controller, then a view, and then a route in Laravel is tedious.

In Next.js, you just create a folder with "page.tsx" file, and Tada! you have a working route at "/something".

The same applies to API routes. Simple directory-based routing, it's like PHP from back in the day.

I like the MVC structure but heavy UI apps with React will then require a hundred API endpoints and "Axios" or "fetch", plus authentication and all that Jazz! I ain't got time for that!

Furthermore, since you writing your views in React and Typescript, you can easily share code between the frontend and backend with ease.

## Next.js is innovative for startups

Server-side components are like the old Microsoft Web Pages concept re-invented with a touch of class!

Having this close binding with the frontend makes me so much more productive. I am an innovator and spend a large percentage of my time researching and building MVPs.

Scaling and unit testing, all the enterprise stuff at this stage is not essential, the goal is to build a proof of concept or find product market fit usually, thus server-side components make the most sense for frontend rich SaaS-type apps.

## I would stick with Golang or Laravel for bigger projects

While Next.js is cool and makes building frontend-rich apps much easier, large commercial-type apps with lots of backend heavy lifting probably are not a good fit.

Laravel's biggest weakness is also its biggest strength, for bigger enterprise-type applications, you basically can find all the packages and tools in one place optimized and maintained by the Laravel core team.

In Next.js you often have to rely on 3rd party packages for nearly everything. Even something as simple as a CRON job is not natively baked into the framework 😱