When You Should Ignore the JavaScript Frontend Framework Hysteria
Why all the praise and hype for JavaScript frontend frameworks when you can make a good-looking website with WordPress in half the time?
If you don’t understand the difference between a web application and a website, WordPress should be everything you need to deal with.
If you are serious about building a web application and you decide to use WordPress, do us real developers a favor and look for another profession.
WordPress is a transitional technology on its way out.
WordPress is a blogging tool with aspirations — like a penguin that wants to learn to fly. It’s ingeniously swift underwater, but can barely keep its balance on foot. You can hack its code until it’s getting where you want to go but it is going to leave you an unmanageable amount of technical debt at best, and break other areas at worst.
It is too complicated for an average user to setup a self-hosted WordPress blog, and too inflexible to use it for a bespoke solution. WordPress is a transitional technology waiting to be replaced by website builders like Wix or Squarespace, Shopify for e-commerce, and JavaScript front-end frameworks like ReactJS or VueJS for full-fledged single-page applications (or SPAs).
The WordPress myth about rapid deployment breaks into pieces as soon as you move outside of a narrow range of requirements. Once you account for the time it takes to customize or extend WordPress, evaluate plugins for functionality (install and de-install plugins while leaving a gigantic mess of schema tables behind) you might have been better off with a clean, bespoke solution.
A professional software engineer knows when to use the right tool for the job. If WordPress is your only tool then you are a WordPress mechanic, not a software engineer. It is a hammer given to the unskilled who thinks that every web application is a nail.
If you just want a good-looking website, use WordPress. Many companies that make dedicated web applications may use a WordPress blog for their marketing sites on which they describe their product and incentivise people to buy. The focus here is on blogging because that’s where WordPress shines. WordPress is a content management system (CMS) that is wonderfully optimized for SEO and generating leads. A WordPress website can be designed in a custom fashion, you can purchase a theme, or it can be a combination of the two. Once this is accomplished, you or your client can start to publish content immediately without dealing with further technicalities.
Consider using WordPress to generate leads from your content which funnel visitors to your web application.
WordPress plugins can give you a whole lot of functionality, even to the degree of forums or e-commerce, but they are not suitable for highly custom data which are processed to create business-specific outputs. The technology stack is dictated by the requirements of the website and preference of the developer.
It is not a question of whether to use WordPress or a JavaScript frontend framework; it is a question of what your website requirements are.
You’re right: You really could slap together a great WordPress website without even thinking about e.g. needing to transpile ES6 modules, or whatever else. For most use cases that is totally fine. In fact, it’s probably better to just use server-rendered HTML and CSS with a sprinkle of JavaScript.
Ignore the hype. If you enjoy building WordPress websites without front-end frameworks, keep doing that. As soon as you or your client plan to twist WordPress into what it is was not built for (i.e. presenting information and managing content), you should be forward-looking enough to consider a framework that caters to such use-cases. Once your business needs start to get specific and you feel that your focus should be on the most flexible and powerful client-side code possible, say “hello” to JavaScript.
ReactJS and VueJS are written in JavaScript and brought quality to the web. WordPress developers writing procedural PHP code mixed with HTML and ignoring all security measures are happy until the day a teenager hacks that website.
Web users now demand reactive and secure web applications.
Ten years ago, it was a good idea to rely on server-side rendering. The server generated the entire page and pushed its final result to the browser. It was the order of the day. You click a link and wait for the entire page to reload. A huge percentage (83.1%) of the internet today still runs on WordPress and other PHP-based solutions. Throw in the websites generated by Rails and Django, and you’re looking at a lot of the internet.
With the advent of Facebook and Twitter, users expect a much more reactive experience. You click the “like” button and immediately see its color change or a number counting up. You post a comment and never have to wait until the whole page has reloaded. Merely the relevant parts of a page are updated by transmitting tiny data packets from and to the server in the background. Using many of these web applications in the browser has become equivalent to using a desktop application.
JavaScript frameworks and libraries are great for building such SPAs. If you want a highly interactive user interface, consider a JavaScript framework. These frameworks can carry user-experience advantages such as performance gains and dynamically generated content which allows for robust page transitions and complex animations, making the whole browsing experience highly immersive.
One of the hidden costs of client-side rendering via these JavaScript frameworks is poor search engine ranking. Notably, there is evidence that Google executes JavaScript and indexes content, it does not necessarily do so for content that’s not immediately visible at mount. Therefore, you’ll want to render the content server-side to avoid potential SEO disadvantages. This will add complexity to the project. I believe that this is only a temporary issue. In the long run, as more and more web applications are fully client-side rendered, Google will also be accelerating its rendering engine to rank results equally.
If your intention is to make good-looking websites, Wordpress is a great tool. If you are fine with relying on pre-made plugins and you are able provide a good user experience with their help, continue using WordPress. If you create simple and static websites and don’t intend to expand beyond it, WordPress is your perfect match. Just mind that equally “good-looking” websites do not convert equally. The ones that perform better will convert better. Google rewards fast-loading websites with a higher rank simply because users give up on websites if they take more than 3 seconds to load. If you are hosting your website in the Philippines, you better find a hosting provider somewhere in the United States or Europe if you want to rank internationally. So it should be something that people care about.
Conclusion
If you’ve ever found yourself in a tangle of JavaScript trying to get one part of your interface to react to another part, you know the pain that these frameworks can ease. The hype around them is not entirely without merit.
When you see people excited about a set of technologies, it’s important to ask why rather than dismiss them as pointless. If you already know JavaScript well, the learning curve for most frameworks will be significantly flatter and than it might otherwise be.
By actually building something with a modern framework, you’ll begin to understand why they’re useful. More importantly, using these tools can make you a better developer and land significantly higher-paying salaries. Just remember that when WordPress came out, there were developers who thought, why would I use WordPress when I could build my own CMS that does the same thing in half the time?