Myths of the Near Future

Ruby and JavaScript enthusiast.

Page 2


Introducing Full-Scale JavaScript

Just wanted you guys to know, that I’ve started a weekly newsletter on revue recently in which I gather the most interesting stuff from the JavaScript world. It mostly focuses on ES6 and ES7 features, frameworks like Angular and React and functional programming.

If you’re interested in being on the edge, then you might wanna check it out.

The latest issue.

Subscribe to Full-Scale JavaScript here.

View →


Running Gulp tasks synchronously

Gulp tasks run asynchronously. For example when you describe your build task like this:

gulp.task('build', ['clean', 'html', 'sass', 'coffee']);

you can’t be sure in which exact order the tasks will be finished. Sometimes this is the source of problems. For example, if sass task is trying to compile your styles into the build directory and at the same time clean trying to empty that directory, you can get in a lot of trouble.

Now one way of solving this is to specify task dependencies. You declare you sass, html, coffee as being dependent on clean:

gulp.task('sass', ['clean'], function() { ... })
gulp.task('html', ['clean'], function() { ... })
gulp.task('coffee', ['clean'], function() { ... })

Gulp will guarantee that these tasks will start running only after clean is finished. Which of cause is nice, but if you use livereload and watch sources to recompile on the fly, this can...

Continue reading →


Binding data with Object.observe

In this article we’ll try to implement a minimal data-binding framework using new fancy Object.observe API which everyone’s in love with. We’ll go step by step and try to solve all of the problems appear on our way. The resulting framework is not by any means production-ready, though I’ll publish it on Github for this tutorial needs only.

 Data binding, eh?

Modern MVC frameworks like AngularJS or EmberJS gained their popularity for saving developer’s time in the era of ajax web-oriented applications. Mostly this is done by implementing data-to-html binding, so that a developer can focus on code and don’t care about the views much — they are updated accordingly automatically. This removes the need of working with DOM directly and thus reduces the effort dramatically.

Until very recent time, there were only two ways of binding your data.

One is putting your model object into a wrapper...

Continue reading →


JavaScript hacks explained

There are several JavaScript tricks that are used widely by experienced programmers. Many of them may not be instantly obvious, especially for beginners. These tricks use language features not by their direct purpose, but rather by their side-effect to achieve goals, that can’t be achieved by default language means. Here I made a little compilation of such tricks with explanation.

You should understand that most of these tricks are rather hacks and not something you should use in your daily development. The purpose of that article is to explain how they work, not to push to use them.

 Using !! to convert value into a boolean

Everything in JavaScript can be interpreted either as [truthy or falsy](‘http://www.sitepoint.com/javascript-truthy-falsy/’). This means that when you put object into an if expression, it will either let you go by true-branch (i.e. it’s ‘truthy’) of by false...

Continue reading →


JavaScript for Java developers

Even if you don’t have to directly work with JavaScript I think it’s worth investing your time in learning JavaScript and I want to encourage you to do that with that little overview article. So if you are a java-developer and you want to catch a bit with JavaScript this is a good place to start.

I also must warn you that I’m not aiming to cover every aspect of JavaScript in this article. Instead I just want to focus on most confusing concepts for Java developers, because well… yeah… JavaScript can be confusing. Especially when it tries to pretend something which it isn’t.

 Object-oriented, but no classes

Alright, here is the thing to start with. There are no classes in JavaScript. Almost everything is an object. Even arrays, even function, but there are no classes as cornerstone language construct. While Java forces you to describe behaviour of your objects before you can initiate...

Continue reading →