Why people hate JavaScript

Photo by Auréanne Mailhiot on Unsplash


This is my personal opinion. I’ll not try to convince you that your language is good or bad. Programming language is a matter of preference. But of course your programming language is the best.


A lot of people dislike JavaScript. From my perspective there are a couple of reasons for this:

  1. It’s really hard to avoid it;
  2. It’s not strictly typed;
  3. Browsers behavior may vary;
  4. Dozens of frameworks and libraries with different API and sometimes even syntax (e.g. Angular);

Let’s go through these items and I’ll explain what I mean.

Continue reading “Why people hate JavaScript”

Pure functions, JavaScript and Unit Testing

Photo by Christopher Burns on Unsplash

I’ve started to write a small game on GitHub to try Node.js, because I’ve never touched Node.js during work hours. On my current project I’ve back-end written with Microsoft .NET. I’ve decided to not use any UI framework, I just added Browserify to share some code between front-end source code and back-end source code. I’ve written a small amount of code and tried to cover this code with Unit Tests. And at this point I found that I have nothing to cover…

Continue reading “Pure functions, JavaScript and Unit Testing”

Side effects in Unit Testing

Photo by Irvan Smith on Unsplash

Today I want to share my recent unpleasant experience. I believe, most of the developers understand it, because it’s something, that is a part of Unit Testing term definition. But we are all humans and sometimes people make mistakes. In my case, the cost of the mistakes, made by one of the developers on the project was couple of hours of work. I’m talking about side effects in Unit Testing.

Continue reading “Side effects in Unit Testing”

Debugging HTML modifications

Photo by Irvan Smith on Unsplash

Let’s imagine the situation: you receive a bug in a component of application you don’t familiar with. The issue is connected with some strange DOM behavior. For example: some part is removed from the document, some incorrect classes applied. The code of the component is quite huge and it will take a while to find all the places, where these modifications can be performed, set breakpoints and try so see, whether this part of code is involved in the issue or not.

Continue reading “Debugging HTML modifications”

Memory leaks and memory management in JavaScript

Photo by Oliver Hale on Unsplash

Web applications are getting more and more complex from year to year. Couple of years ago nobody cared about the memory leaks on the web pages (yeah, they were really a set of web pages, but not web applications). Even if you forget to clean up some memory – it’s not expected, that user will spend a lot of time on the same page. There were a lot of navigation links, which removed information about the entire page from memory and loaded new page.

But now you cannot relate on this behavior, because now web sites turned into web applications. User loads one small HTML file, one script file and some other stuff (like CSS and images) and that’s it. Making requests from browser to servers user can stay on on the “page” for ages. In the worst scenario you will receive a report from production user: “Oh, your application is crashing after 60 hours of using”.

It looks like you have leaking memory in the application.
Continue reading “Memory leaks and memory management in JavaScript”

Flooding DOM by using HTML templates

Photo by Irvan Smith on Unsplash

Some time back I’ve discovered and started to use an amazing feature of HTML 5: templates. If you never heard about it – you definitely should visit HTML 5 Rocks website to read about pros and cons of these functionality. But anyway this post is not about feature itself, but about some pitfall, which I’ve faced after some time.

So, let’s imagine, that you are going to write some page with a dynamic content, which will be generated by using some AJAX calls and templates mechanism. For example you are not satisfied with slow data-binding from existing frameworks (all of them are too generic) and you developed your own data-binding with blackjack and… anyway, you have some HTML:

Continue reading “Flooding DOM by using HTML templates”

Getting started with Grunt

Currently I’m studying new development process for my project and I’m learning the Grunt automation tool for this purpose. I want to share some basic knowledge about Grunt configuration. I’ll assume Windows OS, but you can use Grunt on Linux-based OS as well. Let’s start:

Continue reading “Getting started with Grunt”

Some words about == and ===

Photo by Irvan Smith on Unsplash

When developers starting to write the code on JavaScript I’ve noticed, that they are using “==” (I’ll call it equal), but not “===” (I’ll call it identity) most of the time. Probably, you will not see any difference most of the time, but one day you’ll get a very interesting error and probably you’ll spend a lot of time, trying to resolve it.

Let’s take a look at the details:

Continue reading “Some words about == and ===”