The story about how I switched from Windows and classic asp to Linux and Node.JS

Bye, bye classic ASP, I love you, but you will not be missed ...

I have used Windows and classic ASP for over half my life. Classic ASP even outlived my first dog, and brings up a lot of memories.
I started learning classic ASP using personal web server on Windows 95, which was basically IIS 4 with a limit on it.
At that time I did not have access to Internet at home, so I looked at the asp scripts included in IIS to learn. I guess this gave me a good start as I learned the code style from those who implemented it.
When I had free time at school I searched for tutorials in ASP, "dynamic" HTML and JavaScript. I also had two friends there who where very good at vbScript.
Before classic ASP I had done some programming in Qbasic, so it was easy switching over to vbScript as the syntax looked the same.

I have now switched platform to Linux and Node.JS. And I have learned a lot in the process.

A few years ago I looked at something called Node.JS and asked myself:
- Who the heck would want to write JavaScript on the server side!?

JavaScript is a ugly language if you have not mastered it.
At that time, I had never used prototype in JS. But I had just begun to use Classes in vbScript, slowly starting to transcend from a functional programming style, into an object oriented style.
I had used classic ASP for about fifteen years and started to get really good at it. But classic ASP was considered deprecated by many, even though Windows supports it in their latest Windows server. Language wise vbScript and classic ASP is very stable. There has been no updates for classic ASP in years. I guess Microsoft want you to switch over to their dotnet ecosystem. And most ASP programmers have already made the transition to asp.net a long time ago.
But I hated asp.net, it gives you too little control, and generates weird JavaScript. And was slower then classic ASP. So I saw no real advantages switching to asp.net.

But then something happened. All the major browsers started to support something called Websockets.
I though Websockets could be really useful in a web chat. I had already implemented a chat in classic asp, but the HTTP overhead was too much, making the chat use up much more bandwidth then necessary.
I started looking at various implementation of Websockets, but they all seemed too complicated and in languages I wasn't proficient in. But one implementation kept coming up, and it was in this weird Node.JS thing. Getting a bit desperate I finally gave Node.JS a chance.

Node JS introduced new paradigms and thought me a lot about programming ...

Object oriented programming

For some time, I had worked on a 3d engine for the browser, using HTML div's for rendering, and was looking into using Canvas instead, as most browsers now supported it.

I looked at some Canvas examples and found something, that in retrospect was a school example of object oriented programming in JavaScript. But at the time I just though it was stupid! Why hide all the math and algorithms behind abstractions!? ...

But after learning more about 3d I got convinced that abstractions was a good thing. And started using matrices, points and vectors instead of just x,y,z.

I started to explore the prototype in JavaScript and it turned out to be pretty useful, and much simpler then classes in vbScript. Prototype makes it munch faster and more fun to write object orientated code!

Asynchronous functions

In all my programming career I had always coded in a sequential pattern. So Asynchronous functions was really hard to wrap my head around.

Classic ASP is multi threaded. And ASP makes threading very easy. You just use Application.Lock and Application.UnLock to make your code thread safe if needed.
This makes classic asp perform just as well as Node.js. So I guess one thing I will actually miss from classic asp is the multi threading. And when todays CPU's get more and more cores instead of getting much faster, threading totally makes sense. It's a bit weird that something made in 1996 actually handles todays hardware that good!

Modular patterns

When using Node.JS I first though it was annoying that you couldn't include code and had to make modules instead. But now I think the modular implementation in Node.JS is what makes Node.JS so great, and the reason behind the success of NPM and the Node.JS community and ecosystem.
Often when you need to do something advanced, someone have already solved it and written a module for it in Node.JS. Which you can use FOR FREE!

Node.JS vs Classic ASP

I will certainly not miss chipping out hundreds of dollars for each .dll compiled library in classic ASP. Imagine if you had to pay licenses for each module in Node.JS!!

To run classic ASP you need to have the Windows OS. This is really a deal breaker, as a Windows server license cost just as much as the hardware for a new server.
It has been a steep learning curve switching to Linux, but hopefully this investment will make me save money in the future.

One thing that classic ASP does better then Node.JS though is web page templating and intertwining HTML with server code. If I was to make a web application today that would have to work without JavaScript enabled, it would be better to use ASP, or equivalent languages like PHP.

Node.JS has really changed the way I write web applications. Now I use Websockets for communication via the client and server in all my projects. And depend heavily on JavaScript to do the rendering on the client side. You will probably not be able to use my future web applications with JavaScript turned off.

I am very confident in my classic ASP skills and can do almost anything with it. But classic ASP is not suitable for real time applications, where the opposite holds true for Node.JS. I can now make real time games for the browser!

Object oriented programming, asynchronous functions, prototype, and modules has leveled up my programming skills and opened up new opportunities. With modules and abstractions in Node.JS, you have the combined knowledge of thousands of programmers at your fingertips!


Written by April 20, 2015.


Follow me via RSS:   RSS https://z├Ąta.com/rss_en.xml (copy to feed-reader)
or Github:   Github https://github.com/Z3TA