There are multiple languages out there that, in my opinion, suffer the same burdens as PHP with server-side web development, and do not resolve some of the core problems PHP has, such as forcing people to use a specific web design philosophy (MVC). I think web development should not be purely about MVC, and the arguments against using MVC are very similar to the arguments against OOP. That's not to say that certain aspects of MVC are bad, but it is understood that interconnecting models to connectors, connectors to views, and views to connectors, is complex and adds unnecessary hierarchical coding structures that can be better organised simply by having different files built for specific pages on your website.
Now, I must confess I am not an expert in any given programming language, and I am not in the position to say whether or not Web development should be developed in X way or Y way. But I think it is commonly accepted that the Web is poorly designed and has been constructed off the back of OOP, and uses event-based programming in the form of `addEventListener` which promotes excessive use of callbacks. You can't escape this unfortunately, and that is especially true for websites heavily animated like the one I am designing.
I wanted to avoid using JavaScript and PHP altogether, but not have to learn multiple other languages to design a clean, smooth-running website.
I have been using a programming language called Haxe, which is an open source language with a standard library and cross-platform toolkit, including its own compiler. It builds your Haxe code as if it were the solution, then generates code for the target language of your choosing, whether that is JavaScript, PHP, C#, Java, C++, Lua, among others. Haxe-generated JavaScript is roughly 33% faster than hand-written JavaScript, unless you code in the exact same style as Haxe-generated JavaScript, of course.
Generally speaking, Haxe's compiler is actually quite fast.
Endorsing aside, then, I have come really to show you how we might be able to program a better Web. Using Haxe, you can ultimately use one code-base for both JavaScript and PHP, the only things you need to change is whether your connecting to a database and how you handle such requests. Data structures and data-handling can be left untouched once in place.
Now, I say "program a better Web", we would still technically be using PHP and JavaScript, but Haxe does a decent job at generating code that performs solidly in both these areas. PHP could do with a bit of work, though. What this means, however, is that we don't have to look at cumbersome code and we can instead look at purely Haxe code. Since Haxe is strictly-typed and it compiles, you can catch most errors before they reach your website.
I have decided to start a tutorial series which encapsulates much of this by using a router (no OOP involved), and using AJAX to make server requests to get back text data that is easily decoded and parsed on-screen in their respective places. I'm not sure if it's in the spirit of Handmade, but the idea is to use a minimal number of libraries possible.
The only library I would use is Markdown for blogging and content-focused web pages, but everything else would be tied to the Haxe standard library.
You can see my YouTube videos
here.
What do you think? Is this the kind of philosophy we should strive for with regards to Web development, or is this perhaps not far enough? I would appreciate your feedback, opinions and views on the subject.