Another start for blogging about my software development adventures. This is the second time for me on blogging and first time was good for about 6 months, but after that I dropped and go back to hard work. Generally I like sharing but writing is a habit to build up and last time it was not building very well :)
Currently, I am living in Istanbul and looking for a relocation but I believe I need to push more for a while. I am not a native english speaker so do not hesitate to edit me.
This blog is running over hexo blog framework which is powered by NodeJS.
The first thing, I did is to make hexo run at the boot of Ubuntu server or after hexo crashes somehow. There are multiple ways to do this, but here I will describe the latest practice over Ubuntu server.
I will describe for Ubuntu 16.04.2 LTS. To learn your ubuntu distribution version use command below;
Nowadays, web api is one of the most popular topic in our mobile world. And with NodeJS together with express framework, defining a web api takes minutes.
Basic API Definition With Express
Express framework initializer is very handy to create our example. To make use of it simply install it from npm. This will create express executable under /usr/bin/
npm install express-generator -g
Usage of express generator is also very easy. Execute the below command after installing express-generator and this will create the folder structure for you and some samples included to start your web application directly.
Coding is always fun when you are learning new stack or programming language and while learning, we are not always following the standard naming conventions or coding styles.
However coding style is very important if you are working within a project that contains multiple developers. Every software company can have their own standards, but applying this style for all projects is the hard part to manage.
So a common understanding of way of writing the code is one of the best practices that we have to follow. Some advantages of coding standards I can think of;
Easy to read someone elses code
Avoid simple mistakes
Less technical dept
But in general, the execution and writing order of these languages are same. Meaning the lines at the start executes first. Let me show you a C# code block and describe what I mean.
Misuse of conditional statements are not only hard to read, but also more complex for the processor. Today, I want to underline some points about misused or over engineered conditional statements.
This image makes me smile everytime I see, and is a very good fit for our topic :)
So what do I mean about misused or over engineered conditional statement. I guess, some of these examples may bring up discussions, please comment with your rejections or approvals. I am always open for critics and learn from anyone.
Let me underline that the concepts I discuss is more applicaple if you are using ECMAScript5 and above.
My type of guys - software development and open source addict - won’t miss such a trend, so I have started developing an application which is a SaaS for load balancing your applications. In its core, I am using Node.JS to manage Nginx configurations.