• Object oriented programming in javascript 🐶

    Javascript is a multi paradigm programming language and has object-oriented, functional, and imperative properties that make it very flexible, because of which you can see a countless number of design patterns being implemented using javascript, and which is also the reason why it’s so powerful.

    This post will go through what makes javascript a powerful object oriented language, by showing common OOP features implemented in javascript, as well as a few niche features that can be implemented due to its flexibility.


  • Why we should stop using GIFs 🏭

    GIFs have been around for as long as I can remember, and today they’re as popular as ever. For an image format so popular, GIFs are horribly outdated and inefficient, and they should die. Hopefully by the end of this post I’ll have convinced you to fight the plague that is the GIF image format.

    I could go on and on about how we should get rid of GIFs, but lets take a moment to find out why I feel so strongly about this.


  • How is javascript asynchronous AND single threaded? 💫

    Asynchronous programming is one of those programming paradigms that’s extremely difficult to fully understand, until you’ve done enough of it in practice. In an ideal world this shouldn’t be the case, so here’s yet another attempt to explain the concept of async programming, and why its different from parallel programming, in the context of javascript.

    Everything runs on a different thread except our code.

    At first glance, this sentence doesn’t seem to make a lot of sense. Isn’t everything we execute technically “our code”? Well, yes and no. Lets take a look at two examples of synchronous and asynchronous implementations of the same functionality.


  • Supercharge your ReactJs application with ES6 and jspm ⚡

    This post is about creating a hello world application using jspm and ES6 with ReactJs.

    Feeling lazy and just want to see the code? Go Here

    Although jspm and ES6 can be used for any type of application, I have specifically targeted React because I feel that the intentions of ES6’s module loading specification and ReactJs are all focused on the same thing, and that is componentization – separating your logic into small byte sized pieces. Throwing a mountain of script tags in your index.html file for a single page application is just not as appealing as it used to be. The ES6 way of doing things is to only import a piece of functionality when you need it. This marries really well with Reacts principle of separating your markup into its individual components, so its only natural that both of them be used together. Don’t worry… if you’ve never heard of jspm before, it’s really friendly to new-comers :)


  • How to work with NodeJS and not lose your mind 😫

    NodeJS is great! Its fast, its event based, and it uses the same language front-end developers know and love in he server as well. One of the greatest features of nodeJs is its non-blocking nature, which means that operations which seemed expensive before, like reading user input, and database operations, are now not a problem. Unfortunately this is also one of one of the most dangerous aspects of nodeJs as it makes it really easy for developers to write horrible code. The non-blocking IO means that you now rely on callbacks to perform tasks after an operation has occured, which can lead to quite a messy situation.


  • Understanding the modern front end web application project structure 😯

    Most people starting their journey on web development don't really pay much attention to their project structure. This is because its not really necessary, and one can easily get away by putting a bunch of html, css, and javascript files in a single folder, and linking them together. However, once you start developing more complex web applications requiring multiple frameworks and libraries, you will quickly find that this single folder structure will not cut it, and without proper organization, adding new features to your project becomes a nightmare.

    If you explore any popular repo on Github, you will most likely see a bunch of folders called 'lib', 'dist', 'app', 'public', 'fonts', and also a bunch of weird files like 'bower.json' and 'package.json' which don't have any apparent relation to the project itself. "Why are all these files and folders there? Why am I seeing anything other than html, css and js files?" is what I thought to myself when I was introduced to my first professional project, and a transition from a single folder to an organized structure can definitely be a bit confusing, so here is my attempt to explain as simply as possible, what each file and folder is doing in your project and what exactly is its purpose in life

    The directory structure shown here is the standard yeoman web project structure.


  • How to communicate between Python and NodeJs 🐍

    NodeJs is amazing at a lot of things, but one area where it falls short is numerical and scientific computation. Python, on the other hand, is great for stuff like that, and libraries like numpy and scipy make scientific computing a breeze. Fortunately, we can utilize the power of numpy within our node application, by calling a python process to run in the background, do all the dirty work and give back the result.
    In this tutorial, we will be using the child_process standard library in nodeJs to spawn a python process which will compute the sum of all elements in an array, using numpy, and return back the result to our node program.
    If you want to skip the whole tutorial and just get your hands dirty, copy start.js and compute_input.py into the same directory, and run the command
    node start.js
    on your terminal.


subscribe via RSS