Your peers will thank you later

blank computer screen and a keyboard sitting on a desk
blank computer screen and a keyboard sitting on a desk

Coding conventions are the style guidelines for programming. Programming best practices and principles are included in this. Here we will discuss some coding conventions.

Benefits of Following Conventions

  • Clean code
  • Quality of code
  • Readability of code
  • Makes code maintenance easier

“Clean code is simple and direct. Clean code reads like well-written prose. Clean code never obscures the designer’s intent but rather is full of crisp abstractions and straightforward lines of control.” — Robert C. Martin

1. Magic Numbers

A magic number means we are assigning a number with no clear meaning. Sometimes we use a value for a specific purpose, and we don't assign the value in…


Prepare yourself for that desired job

Man coding on laptop
Man coding on laptop

Job interviews are not entirely predictable, but we often still see commonly asked tricky questions. Let’s take a look at ten of them.

1. Shallow Copy

Output

original: { 
father: ‘MD’,
age: 26,
email: ‘shoaib.mehedi@gmail.com
}
copy: {
father: ‘MD’,
age: 26,
email: ‘shoaib.mehedi@gmail.com
}

Why?

Object.assign and the spread operator both do a shallow copy. That means we copied the first-level object.

Reference

The code we used before can be written like this with Object.assign:

2. JavaScript Hoisting

Predict the output of the code below:

Output

undefined
26

Why?

The output of the code snippets is not shoaib and 20.


The fundamental of cronjob

Cron is a kind of scheduler program for UNIX-based operating systems. Cron is used to executing a program/script after a certain period. Suppose we have a program that we want to execute every night at 12 AM, or we need to back up necessary files every week once. These things can be done perfectly by a script that is executed by a cronjob.

cronjob
cronjob

Concept of cronjob

Cron is a daemon. Now the question is, what is a daemon? Daemon is a program that always runs in the background, and users don't have direct access over daemon. Cron checks the crontab (crontab is the…


Every day we do some technical things that we can fully handover to these websites

As a technical person, I fetch some regular basis tasks. There are tasks that we can solve in several ways. Many tools, open-source programs, coding, or anything can be helpful in these cases.

Work smarter, Not harder

But one thing I believe in that I mentioned above. If there is a way to do it easily then I am not going to do it by myself in another way. Here I will mention some websites like these that I use in my everyday life and skip my hassles.

Website Safety & Security Check

Security checking tools used to scan and check the safety of websites…


Code that you need always

Javascript code snippets
Javascript code snippets

Programmers always do something new, but some basic and regular things exist that every project must include. Here I mentioned some code snippets from where you will find something new. I swear you are going to bookmark this. Hope this will be helpful.

1. Loop through an object

Loop over an object is a regular basis need of every programming language. Sometimes it can be a complex object with multiple keys and values. Going through this kind of pair is a little confusing. Here I am going to describe two possible ways.

2. Find in an array of objects.

Finding into an array is the most needed task of everyday development…


Next level API development practices

If you develop your REST API without following good practice, your consumer or developers who are using your API may find this difficult to use. If you provide an API service to your customers, you might lose some customers just because of this. So let's learn about some best practices of REST API.

1. Use JSON as data format

In REST API, we can serve data in many formats like XML, JSON, CSV, HTML, Plain text, or any other you want. But the most and widely used format is JSON. For human visualization, plain text is much better, but our main purpose is to make it…


Make your code reliable and maintainable.

In this article, we will get to know all the clean code principles from the book “Clean Code” by Robert C. Martin. Here, we will learn how to produce readability, reusability, and write refactorable code. Try to follow the whole article. This will help you to improve your programming. Here is an overview of the topics we will discuss here.

Benefits of Following Principles

  • Quality of code
  • Readability of code
  • Makes code maintenance easier

What we will discuss?

Here we will discuss five topics and some other sub-topics based on those five topics. Let's have a look at the index below.

  1. Variables
  2. Functions
  3. Objects and data structures
  4. Classes


Host your website for free with a significant service

We can host our websites anywhere we want, but there are lots of issues. Website speed, deployment process, costing, and many other mentionable issues here. Overall consideration, I found firebase hosting far better than the others. Here I am describing all the steps.

Why Firebase?

  • Backed by SSD storage
  • Zero-configuration SSL
  • Free (Depends on some criteria)
  • Cloud Logging to view, search, and filter your web request logs
  • Automate continuous deployment with Cloud Build
  • Restrict access and counter a DDoS attack for your web apps
  • Global CDN (content delivery network)
  • Custom domain support
  • Keep all your sites in one place
  • Set up production…


Quotes that will motivate you to be a better programmer.

Here I collected the top 26 quotes of legendary software engineers. Following these quotes and understanding these quotes will be a great achievement of your programming life. Let’s start

1.

“Indeed, the ratio of time spent reading versus writing is well over ten to one. We are constantly reading old code as part of the effort to write new code. …[Therefore,] making it easy to read makes it easier to write.”― Robert C. Martin

2.

“Repetition is the root of all software evil.” — Martin Fowler

3.

“Don’t repeat yourself…


Contribute to the Node.js community.

It's important to note that you can publish packages that are not Node.js modules. Any files that are bundled together with a package.json file can be handled as an npm package.

Publishing an NPM package and getting others to use it is a huge achievement and will be a milestone in your CV.

Necessary files

Here we have a package.json file.

Another thing we need is an index.js that is the entry module. Here, for example, we just exported a demo function called printMessage.

So we got out package ready now we are ready to publish our package.

Here is…

Shoaib Mehedi

Love to solve problems

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store