Building my own blog

I’m building my own blog. I’m doing it using node and pure HTML + CSS, and as little JS as possible. Six years ago I would’ve become murderous at the suggestion to use JS on the server. The rationale was simple: it’s not that Javascript is a silly, primitive and hard to optimize language. It was the fact that I wouldn’t trust an interpreted, not compiled language, to run on my server.

And that was true for Java and for C# – especially the devilish C#, I thought. But six years of developing with C# got me over this technical barrier, and convinced me that the few cycles lost in translating from bytecode to native code might be worth their while.

Still, not Javascript, I used to think. And indeed, there are very few reasons to use Javascript on your server. In fact, there is only one reason, and one reason only. The Javascript environment.

Right now, the JS environment is the richest, most lively environment ever. Easy to import things, easy to reuse code. Code is distributed by source, and nobody has a problem with that. There are no binaries and no tricks, everything is open. Truly open. Insanely open. And the environment invites you to contribute.

It’s a simple case of „minimum effort, maximum effect”. You reuse code you’ll never know how good is, you don’t care about performance and you deliver a product fast. You’re productive. The end-result is delivered fast. It’s not fast, it is not high-quality, but it will look good and feel good. And at the speed at which people throw stuff away these days, node is an acceptable solution, since in two years time you’ll use something else anyway. Or you’ll need a rewrite. And if you will have many clients, and your node application doesn’t scale (regardless of what the fans tell you), you’ll just buy more servers.

Everything is single threaded, so that your little brain will not hurt itself thinking about context and interactions. Everything is stupidly simple, and people write convenient wrappers that hide two function calls for you, so you can make sure that you’ll not hurt yourself too bad. Everything becomes a framework these days, you follow some steps from a web-page and you’re set.

The cool part is that only the best survive in this world. Simple APIs. Clear APIs. Powerful APIs. For copy-pasters of the world cannot suffer complexity, so only the best APIs survive. The APIs that do everything for you.

Of course, this is not a professional solution. But it will be good enough for me. Especially since I tried to find out how people would deserialize JSON content in C++, and found out that:

  1. There is no decent serialization solution in standard C++
  2. There is no decent string class in standard C++.
  3. There is no decent library distribution model and project management solution for C++ projects.
  4. In the time needed to compile a simple Hello World that includes some headers from Boost I already delivered a web-server that connected to a database and spat out blog posts in the browser.

It’s not that Javascript is smarter. Really, it isn’t, the C++ world could be as easy to start a project in as the Javascript world. But it isn’t because it has:

  1. Experienced developers that are smarter than you.
  2. People that are sure they know how things MUST be done.
  3. Expert library writers.
  4. Aggressive fans that will rip you in three just because you don’t think like them.
  5. Boost. Seriously, someone please burn the Boost repositories, the world would be better off.
  6. and the standard library, so badly thought that it’s next to impossible to tell how many characters (not bytes) a string has, or if the UTF-8 string is well formed.

So yes, I’m going for the Javascript solution. Past me would kill me for even remotely thinking about this.


Comments

Building my own blog — 4 Comments

Comentariul tău