You should use Node.js for your side projects

You should use Node.js for your side projects

There is one thing that unites people in the software industry: we love to build things that work. There is nothing more satisfying than finishing a feature or a project that just works as expected. For my side projects, I love learning new frameworks, technologies, and languages. But in the end, the most rewarding and satisfying part is finishing a project and shipping something to the public. Let’s be honest, you’ll understand when I talk about how it’s often hard to find the time to finish a side project if you have a full-time job, worry about exercise, chores, and maybe sleep. With some advance planning and perhaps some good project management tools, we can help ourselves. But what about our tech stack? If finishing and shipping a project is our goal, it’s important to pick a tech stack that can accommodate rapid development.

Node.js has become a popular server-side platform, used as a web server for many modern web applications. When developing a Node.js application, you will write everything in JavaScript and be able to run your application on any type of server (Windows, Mac, or Linux). Node.js consists of a large number of limited-scope modules and packages that you can take advantage of. However, you only need to take what you need and make sure your application is as lightweight as possible. At the end of the day, you should enjoy your side projects, and Node.js applications are fun to write.

1. What exactly is Node.js?

Node.js itself is just a runtime environment suitable for writing server-side applications using JavaScript. Node.js is not a JavaScript framework, but most Node.js applications use frameworks. Express.js is the most popular Node.js framework, with excellent documentation and a ton of great resources. So for a Node.js web application stack, you should install Node.js and Express.js to run your web server, which will become a fast, lightweight middleman that can quickly pass requests and responses between your client and the database.

2. Scenarios where you shouldn’t use Node.js

Before we dive into the exciting parts of Node.js development, let’s first clarify the situations when you should not use Node.js.

If you are developing an application that involves CPU-intensive operations, you should not use Node.js. Node.js is single-threaded and will take too long to run on the server, dragging down the performance of your application. Your application should not handle any kind of large data sets on the server. Either move this part of the work to the database, or switch drastically to a more suitable platform.

If you don't like JavaScript development, you shouldn't use Node.js. You should enjoy your side projects and not force yourself with unpleasant things just because someone on the Internet told you to. But before you give up, hear me out, I've met many people who disregard JavaScript and don't even give it a fair chance. JavaScript can seem wild and difficult to control at first, but once you learn how to use it correctly, you'll see how powerful it is. JavaScript is one of the most widely used programming languages, and with the release of ECMAScript 6, it's going to get even better.

3. JavaScript — Front-end and Back-end

Let's take a deeper look at the ways Node.js can maximize your side project productivity. JavaScript has taken over the Internet and is no longer used for trivial functions. For many modern web applications, the core functionality running on the client is provided by JavaScript. In addition to improving the user experience, it also offloads a lot of work from the web server. Remember the lightweight server we talked about earlier? Let the client browser do its own work, so that we can take full advantage of the greatest power of Node.js - light and fast I/O.

Application logic is spread between the frontend and backend; for us Node.js developers, we are lucky to use the exact same programming language for both the frontend and backend. Most developers have become more aware of the cost of context switching. Having to refocus and adjust your mind to new tasks, new languages, and new problems often costs developers valuable productive time. Reducing the distance between context switches allows us to handle various tasks more easily and the corresponding recovery time is also faster.

4. JSON — The King of the Data Jungle

JSON (JavaScript Object Notation) [Note 1] has become the de facto data format for data transmission between the server and the client. From my experience developing web applications on other platforms, the time spent converting your data into various formats and models is quite amazing. For Node.js applications, JSON can be used in all three areas of the application - client, server, and database. MongoDB and CouchDB are popular NoSQL databases that use JSON to store data. PostgreSQL, a popular open source relational database system, also supports storing JSON objects. Microsoft even announced that SQL Server 2016 will support JSON. With such a rich selection of options, it is easy to pick a reliable database for your Node.js application to squeeze out every bit of productivity without having to worry about data format conversion.

5. Modules - Take what you need

A rule of thumb for side projects is to keep them small and focused. This helps ensure that you actually finish your project. The same concept can be found in Node.js projects - you only use those modules that you really need. This makes your application lightweight. Unlike other enterprise-focused platforms, you won't have a lot of extra stuff that you don't even need. You will develop and deploy faster, your project will take up less space, and you will have the peace of mind of knowing that everything in your project is exactly what you need. NPM (Node Package Manager) [Note 2] is a major selling point for Node.js applications. It gives you quick and easy access to all public Node modules, with over 150,000 packages to choose from. It has never been easier to reduce development time and take advantage of existing open source software and tools.

6. Summary

Node.js provides us with an amazing application platform, and web applications really excel due to their high I/O requirements. If you are going to use Node.js for your next side project, try to develop a lightweight web server API to minimize the actual load on the server side. Node.js is extremely easy to understand and relatively easy for developers to learn and master, so why not give it a try?

7. My next plan

I wanted to include a quick list of some great resources that helped me master Node.js.

https://thinkster.io/mean-stack-tutorial/ : This was the tutorial that helped me the most. It's very well structured and covers a ton of valuable content. It's free, but you can also pay to get access to the source code and videos (I paid $25 for the source code at the time, but they seem to have changed to a $20 per month subscription for all of their tutorials).

http://www.toptal.com/nodejs/why-the-hell-would-i-use-node-js : A well-written article that helped me understand the pros and cons of Node.js.

Note 1: JSON (JavaScript Object Notation) is a lightweight data exchange language conceived and designed by Douglas Crockford. It is text-based and easy for people to read. Although JSON is a subset of Javascript, it is a language-independent text format and adopts some conventions similar to the C language family. https://zh.wikipedia.org/wiki/JSON

Note 2: Node Package Manager. It is a javascript package management system. The default environment is Node.js. Starting from Node.js version 0.6.3, npm is automatically included in the installation package. https://zh.wikipedia.org/wiki/Node%E5%8C%85%E7%AE%A1%E7%90%86%E5%99%A8

<<:  Want to be an independent freelance developer? It’s always hard to get started

>>:  iOS development of multi-table view sliding switching example (imitating "Toutiao" client)

Recommend

4 methods to teach you how to efficiently acquire seed users

In the early stages of a business , when you are ...

How to plan and promote an excellent event?

Whether you are doing user operations, new media ...

The Arctic is turning greener

The Arctic region only accounts for about 5% of t...

Kuaishou Advertising Platform Review Standards and Process

1 Audit Purpose and Basis Purpose: In order to st...

Microsoft officially announced: Cortana will exit Android/iOS platforms

[[282585]] On November 16, according to Windows C...

What are the “skeleton” and “soul” of event operations?

Activity operation is an important aspect of oper...

Tencent still needs to rely on third parties to support WeChat

At the Tencent Global Partner Conference held two...

Improving Android program security using hook technology (Part 1)

one, Introduction In the Android development worl...

Do you really understand product operations?

Internet products have only been proposed as an i...

Brand marketing promotion: How to increase tens of millions of users in 60 days?

Recently, some groups have been forwarding a mess...