Notes of Maks Nemisj

Experiments with JavaScript

Author Archive

JSON.parse welcome to my consciousness

Today JSON is widely used in different corners of software development. It’s used as data format, as configuration or even as in memory database. At my current company we also use it as configuration format. The more I use it, the more I have feeling that it’s “a bit” inconsistent and “raw”. You would expect […]

, , ,

The place where I WILL use getters in javascript

It’s going to be a short one, but powerful. Do you remember I wrote previously why getters/setters is a bad idea in JavaScript? I didn’t change my mind, I do still think so, but now I found one valid place where I can and DO want use them. You will never guess. (just kidding) Unit […]

JavaScript execution

Do you know what would be the result of the following code executed in node.js without babel and any transpiling? example.js Do you know the result ? Think good …       And one more time       Well, it appears that it depends on the version of the node.js ( and guess […]

, ,

Error handling in isomorphic node.js application

When preparing application for deploying to production env I want to ensure that everything is properly logged, especially things which are unexpected in code. That’s why, I think, proper error handling is crucial to any application. This is a short article on how to do an error handling when going live in isomporhic web app […]

, , , , , , , , ,

React.js: propTypes in ES6/ES2015 components

If you’ve decided to move react components to es6/es2015 syntax you’ve might found out that defining propTypes and contextTypes is not that seamless as it was. Babel@6.7.7 doesn’t yes support static properties on Classes and the most evident way to use propTypes is to append them to the class at the end: Though there is […]

, , , ,

Ubuntu 16.04, ViM and broken plugins

If you have moved to Ubuntu 16.04 you can find out that your old ViM stuff is not working – Some plugins are broken. This is due to the change in python interpreter for ViM ( https://wiki.ubuntu.com/XenialXerus/ReleaseNotes#VIM_defaults_to_python3 ) To fix this you have to use different package of vim, like vim-gnome-py2. If you’re like me […]

, ,

Implicit return in arrow function got me…

I still have to used to this new arrow functions and implicit return statement. If you’re unfamiliar with them, here is the doc – https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions Look at this two ‘almost’ identical parts of code and think what is the difference between them? code-one.js and this one code-two.js They look the same, except that one will […]

,

Why getters/setters is a bad idea in JavaScript

UPDATE (15 May 2020) : I see a lot of comments regarding TypeScript and that there is no issue with setters/getters while using static typing. Of course, you can safely use getters/setters in the environment, which guarantees static type check, but this article is about vanilla JavaScript. This article is my opinion why I think this […]

, , ,

Previous Posts Next posts