Some important things to know for Web Developers :

Rakib Hasan
5 min readMay 6, 2021

Primitive Values :

Primitive Values are consisted of string, number, bigint, boolean, undefined, symbol, and null. And these primitive values have something in common. They can not be altered . There’s nothing a programmer can do to affect them.

Sometimes people get confused over primitive values and variables that are assigned with primitive values. Let’s look at it this way, “You can always change the value assigned to a variable cause that’s literally a variable is for. Here you are assigning another primitive value in that variable. You are not changing the previous primitive value.”

Type of :

typeof is a JavaScript keyword that returns the type of a variable when it is called. It can also be used to validate function parameters or check if variables are defined or undefined. There are other uses as well. The typeof operator is useful because it is an easy way to check the type of a variable in your code. For example :

console.log(typeof(5)); // “number”

console.log(typeof(“My Name”)); // “string”

This is how typeof works.

Error Handling with try…catch :

Let’s be real. We are not superhuman. We make mistakes. If you observe then you can find mistakes almost in anything. That also applies too when you are coding.

Usually what happens that your program stops immediately when it finds a mistake in the code. But what if you can still run the code and show some kind of output to your user instead of just crashing the application? It would be nice right? That’s what try…catch can do for you. The basic syntax for try…catch is

try{

//write your code here

} catch(err) {

//handle error

}

Here at first the code will try to execute try part. If there’s any error then the catch part will be executed.

Try Catch and Finally :

In previous section we talked about try and catch. But wait there’s another variation to this one. You can actually add a ‘finally’ section in your code which will work no matter what happens.

try{

//write your code here

} catch(err) {

//handle error

} finally {

//don’t worry I’ll always get executed no matter what

}

Here after executing try and catch section, finally section will always get executed.

Coding Style :

You may feel surprised seeing this but yes coding style does matter. Your code is your identity. So why don’t clean it up professionally? Here I am not talking about making your code stylish. It’s all about making your code readable. If your code feels readable and understandable to other coders then it’s okay.

Now your question must be “How can I fix my coding style?” The answer to your question is really simple. You can add curly braces properly. Add comment to various sections to your code. You can add a space where needed. The list is big but the task is simple. And in today’s world there exist many snippets which will actually make your code readable and professional.

Comments :

Comment is a core feature in any programming language. It’s the section in the code which starts with // or /*….*/. The first one is single line comment and the other one is multiline comment respectively. For example:

// This is comment

/*This is a

multiline comment */

Comments can be very useful while coding. You can actually comment before a function and describe what it is for. It will help you to understand your code more. Or you can add comment in some complex part and write down what this or that variable is for. This will help you in the long run cause you will have a good grasp on your own code. Moreover it makes your code readable to other coders too. As mentioned before, it will also help you to enhance your coding style.

Cross Browser Testing :

As a Web Developer our duty is to make websites that can run on our computers as well as other computers too. Cross Browser testing is the practice which make sure that the web apps we create work across a good number of web browsers.

It means we have to make sure that our web apps runs not only on the modern devices and browsers but also in older browsers and low quality devices too.

We know that technologies are evolving day by day. So HTML,CSS, JavaScript are also a lot more modern now. But there are still some users who use older version of the browser or older devices and that’s when we need this Cross Browser Testing.

Workflows regarding cross browser testing :

Cross Browser Testing may sound scary and time consuming but if we work according to some process then it takes a very little amount of time . But at first we have to find bugs in our code.

Yes you heard it right. Even many of the social media platform has bugs in their codes which leads to terrible hacks. So it’s normal that we will have bugs in our codes too. After finding bugs we have to take these steps :

Initial planning > Development > Testing/discovery > Fixes/iteration

These processes are very important . And from process 2 to 4 it becomes iterative. Meanings it can take several try or leads to releasing several versions of the same app or web app.

Client Caching :

At first we need to know what is caching? In the most simple terms, caching is a general computer concept that provides efficiency through data availability. Now client caching is the one which limits the data cost incurred by the user by keeping commonly referenced data locally.

Sometimes clients request some data which are continuously needed. In that case if that data has to be fetched from the main server then the cost increases for the users. In that case if the data need can be stored locally and used when needed then it can actually save some time and save some money for the users.

Server Caching :

Server caching helps limit the cost incurred by the server and its underlying systems. Many requests made by clients can either be responded to using the same data, or responded to using parts of the same requests made by others.

--

--

Rakib Hasan
0 Followers

Web Developer, Dreamer, Quick Learner.