5 JavaScript frameworks to watch

If you’ve been in the software development world over past few years, you can’t avoid noticing that JavaScript popularity continues its rising insanely. Even if you don’t have any plan on doing any web development, you will most certainly bump into JavaScript at some points on your journey. Moreover, according to IBM, JavaScript is the best programming languages to learn in 2017.
Related: What Is The Best Programming Language For Beginners?

Nonetheless, with hundreds of free JavaScript frameworks out there, you might pull your hair out to make decision which one you should get your feet wet with. If you ask five people about their choices, you will likely get five different answers. 
Everyone has their own reasons for preferring particular framework. There is no one-size-fits-all. It depends not only on how beginner-friendly is, but also what kind of projects you want to work on.

To help both you and me sleep tight at night, here are five of countless JavaScript frameworks popping up lately that are actually worth to keep an close eye on:

VUE JS

Most front-ent developers already know the big names like React, Angular and Ember. But I’d like to introduce you the less well-known but rising rapidly – Vue.js. After Vue.js 2.0 came out in April 2016 with its promise to be one of the fastest frameworks all in all, Vue.js is quickly gaining more attention.

Even though it is just a lightweight JavaScript framework, it takes the best from those big names above and putting all that into a handful tool.

You should definitely try this framework if you want to write complete applications within less than a day of reading the documentation and guide. That’s because Its source code is very readable. It allows you to easily write simple JavaScript.Vue.js is worth a look.

For more information, you can read at Vue.js website or its GitHub repository.

ANGULAR JS

What is the most beloved JavaScript framework for building single page application? What is “the big daddy” in the JavaScript framework world? Needless to say, it’s the popular Angular.

Released the first time in 2009, it was the baby of Google (which is convincing enough to use it). I know you are sick of hearing Angular.js all the time in the war of frameworks but till now, Angular ecosystem has grown beyond imagination.

Two-way data binding is a much loved feature of Angular.js because of its magic which automatically synchronizes the view and the model. Besides, it also includes some other useful features such as extending HTML vocabulary, client-side form validation, possibility to create custom DOM elements and more.
You can dive deep into it at angularjs.org.

METEOR JS

Meteor is no longer a new concept to those who study and work in IT section. Unlike other frameworks, Meteor is a smart and powerful tool that allows you build web and mobile application win one single language of JavaScript.
Related: What Is The Best Meteor.js Resource To Learn?

In term of programming, Meteor is described as an open-source and full-stack JavaScript platform that includes a key set of technologies for building reactive web and mobile applications. Meteor requires less code, so even though you are newbies to programming, you are able to build you own amazing app at lightning speed.

FYI, we are also a Prime Partner of Meteor. It was really our honor to have an opportunity for renovating their official website. You can access Meteor.com to find out how Meteor actually works in practice.

REACT JS

Are you in love with Facebook and Instagram’s users interface? Let me unveil you a secret, React.js is the super hero standing behind and powering that user interface. Isn’t it cool? Despite the fact that it is more of a library than a JS framework, it still stand out from the crowd.

Came out in 2013, it’s currently the hottest and the fastest of the bunch because of its implementation of a virtual DOM and synthetic event. Another thing developers love about React is that it’s much easier for developers with JavaScript experience to get a handle on. It’s totally not magnify to say that learning React.js is almost a must.
Find more information about React at – facebook.github.io/react/

EMBER JS

Another powerful MVC JavaScript framework is Ember.js. It was initially released in late 2011 as an open-source project by Yehuda Kats. Like Angularjs, Ember also rides on the principal of two way data binding.

Ember stands out with its simplicity and flow of functionality to make web development a smooth experience. Also, Ember community is quite big and active, so if you face any problem in your journey, you can ask them for help.
Learn more about Ember at – emberjs.com

Related: Awesome Free Resources For Learning JavaScript

Anything you would like to add?

So, there you have it. I just highlighted the 5 best JavaScript Frameworks in this blog. I hope this post can help you determine the suitable framework for your projects.

However, picking out the most suitable framework is just the beginning. It’s like you just pack you bags before going on a journey. A perfect JavaScript framework won’t make a perfect programmer if this person doesn’t make any effort. Remember, the best way to learn is by getting your hands dirty. You’ll be the best solider when you are fighting the real world enemy.

6 Reasons every Programmer has to learn JavaScript

If all the road lead to Rome, which one should you take? Wait, don’t even think about packing your bags soon if you don’t get a ticket!

Let me unveil a secret. If you are going to be a full stack ninja, JavaScript is the exactly essential ticket that you need. Even if you don’t have any plan on doing any web development, you will most certainly bump into JavaScript at some points on your journey.

If you’re unconvinced that you need to get familiar with JavaScript, I suggest that you should read my whole below reasons.

First easy step for beginner

How grateful it is to learn new thing but it’s easy to catch up on! Believe it or not, of the hundreds of programming languagesthat you could learn, none are as simple to learn as JavaScript is. It’s higher level language, which means it takes away most of complex details of the machine so your job is just focus on learning how to program.

Having fun together

JavaScript is a must learn for front-end developers. Pages without JavaScript are rather bland, whereas JavaScript laced sites allow for animation and better control over the web interface. It’s dynamic and flexible to use on object-oriented programming.

In demand

The rapidly increasing of online business makes JavaScript skills in demand for those who want to become professional programmers. Doubt it? To see it in action, open any job hunting websites, then you will see there are thousands of job announcements for programmer and software developer requiring either JavaScript directly or some JavaScript libraries such as Node.jsAngular.js, etc.

One language to rule them all

JavaScript is super versatile. Just like a dynamic kid, it runs everywhere from desktop and mobile apps, servers, databases, to even physical hardware. Especially, JavaScript is the only language built for both client-side and server-side, which makes it very fast because any code functions can be run immediately instead of having to contact the server and wait for the answer.

Besides, do you ever dream of the perspective of universal code – write once, then run everywhere? I know you do! Who doesn’t? JavaScript makes this case realizable. Once you learn JavaScript, you can use everywhere. Isn’t it amazing!

Great learning resources

Depending on your learning style, there are enormous amount of JavaScript resources out there for you to choose. A growing number of online JavaScript tutorials and classes have emerged in recent years. I highly recommend you to try CodecademyCode SchoolW3school.com.

Because you’ll have to anyway

In an environment, where the technologies and internet develop as lightning speed, website will become the future of any kinds of business. Speaking of the web, we can avoid mentioning the browsers and the browsers mean running the JavaScript. That’s why in the eyes of many experts, JavaScript is quickly becoming one of the world most popular and powerful programming language. We absolutely sure that there will be no job positions for programmers that would not have anything with JavaScript to do.

So, one way or another, you still have to learn it anyway. Why don’t you learn it now, then you will be the master in future!

Conclusion

Don’t get me wrong, JavaScript is not the only language you should ever learn, but it’s the only language that you HAVE TO learn if you want to dominate the web world. Again, no other language can take you as far if you want to do is create web application.

Now, your turn! Do you agree with my ideas? What do you think about learning JavaScript? I would love to know your thinking in the comments below.

What is the best Programming Language for Beginners?

It seems that technology rules the world these days. Then, the scene of being able to make the computer or mobile device dance to your tune seems to be very attractive. Writing computer code becomes “a super hot pot” that everyone try their best to join. However, the question is how does a person take a first step to gain this “power”? Choosing a suitable programming language might give you a hand.

To be clear, “the best” here is just relatively. It might be the best for you, but not fit for others. Everyone has their own reasons for preferring particular programming language. It depends not only on how beginner-friendly is, but also what kind of projects you want to work on.

Ruby and Ruby on Rails – The Happy Language

Ruby on rails is a great tool that can help you with the backend aspect of your programming. Although Ruby and Ruby on Rail have similar names, there’s actually an important difference: Ruby is scripting language, like Python, but Ruby on Rail is web app framework built on Ruby.

Rail is so fun for beginner because it’s really robust and it does so much of the hard work for you.
Learning to program in Ruby is much easier than other language because the language is super flexible and very forgiving, which translate to more time spend absorbing programming fundamentals, less time banging your head against your desk.

Python – The Easiest Language

When people discuss about first programming languages and which languages are easier for people to get their feet wet with, Python inevitably come up. We, programmers always desire to use as few lines of code as we can to express a concept, don’t we? Python can absolutely make it possible because of its simplicity and readability. It is usually used and referred to as a scripting language, allow programmers to churn out large quantities of codes in short periods of time.

It’s great language for beginner all the way up to seasoned professionals.

JavaScript – The Most Useful Language

There is no doubt that JavaScript is one of the world most popular and powerful programming language. It is the only language available for client-side scripting in the web development. That makes it virtually a necessity for everyone who wants to be successful as a programmer for web and a must learn for front-end developers. Pages without JavaScript are rather bland, whereas JavaScript laced sites allow for animation and better control over the web interface. It is dynamic and flexible to use on object-oriented programming.

It’s used to spice up web page by making them interactive

Get familiar with C

One thing that is importance about C: it’s one of the most foundational languages in computer science and programming. If you can grab C in your hands, other popular languages is just kids in your eyes! However, before jumping into C, you should proofread it on Wikipedia and other online resources to find out whether you should learn it or not. It’s because C requires more complex code to perform simple task, you may find it touch to keep yourself motivated if you join it as your first language.

Knowledge of C will definitely help you as programmer.

Conclusion

The nice thing is that, when you’ve taken the first step, the second step is much easier regardless of the direction it takes you. Remember, the best way to learn programming is by getting your hands dirty. You’ll be the best solider when you are fighting the real world enemy.

So, which programming language did you choose to learn first? Does it work? I would love your comments about how you became a programmer.

What is the best Meteor.js resource to learn?

People who are not programmers will surely agree with me that whether you are experienced coders or basically a shop owner who has interest in programming, you can easily learn and work on your Meteor project with minimal development effort in a short period of time.

In term of programming, Meteor is described as an open-source and full-stack JavaScript platform that includes a key set of technologies for building reactive web and mobile applications. Meteor requires less code. Instead of using thousand lines of code for a command like any other frameworks, it can just use 10 lines, Yes, 10 lines, you didn’t misread. Fantastic, right?

Since you’re here, you probably don’t know Meteor that well. Check out reasons why you should choose Meteor for your future web and mobile apps.

One more interesting thing, the Meteor community is rapidly developing day by day. That means the available resources are also growing immediately. In today’s post, I’ve rounded up the top brilliant, useful Meteor resources which could help you shorten the time you will take to learn this awesome framework from scratch.

Basic background of JavaScript

Before digging into every facet of Meteor framework, you are required to have a fairly good background of HTML, CSS and JavaScript, obviously.

  1. If your time is limited, you can take a quick look at A JavaScript Prime for Meteor
  2. If you have a little more time on your hand, you can try the tutorials at Codecademy.com or alternatively work your way through the course at JavaScript is sexy: How to learn JavaScript properly.
  3. For those who are already an advanced JavaScripter, you might want to step up your game a bit by walking through those articles at Badass JavaScript.
  4. Last but not least, don’t forget to get your hand dirty with some of the material Douglas Crockford put together before heading over to Meteor.

Meteor Resources

If you can grab JavaScript in your hands, Meteor is just kid in your eyes. I hope that the following roundup of tutorial will get you on the right track in term of learning this smart framework.

  • There is no better place to get essential information than from the official website itself: Meteor.com
  • Most importantly, check out the official Meteor documentation which contains documentation, tutorials and references.
  • FYI: Renovated by Designveloper team, Meteor.com itself is a typical example of how Meteor works in practice.
  • If you’re beginner and find their documentation bit advanced for you, you can refer to Discover Meteor which is both a website and a book written by Tom Coleman and Sacha Grief
  • The next unavoidable thing to do is head over to the Meteor Youtube channel. These videos are also very valuable if you’re starting out or want to improve your skills.
  • Check out the unofficial sanctioned wiki resource – Meteorpedia as well.
  • As a developer I believe that you have spent some time on StackOverFlow which is the perfect place to search for solution when you’re stuck with a specific problem.
  • For those who prefer watch video, you cannot avoid having a look at Evented Mind. They offer a bunch of awesome screen casts that will keep you busy for quite a while.
  • Another article worth reading is What’s This Meteor Thing? by Gabriel Manricks. I know it’s a bit outdated and old by now, but it covers a fully fledged ground in a way that no other tutorial does. If my words are not convincing enough for you, there are tons of comments left below the post showing how helpful and insightful it is for beginner Meteor developers.
  • Tom Coleman also provided a great post about Prototyping With Meteor. This particular tutorial aims to walk you through the process of turning a simple HTML wireframe into a functional application in a surprisingly simple number of step.
  • Once you decide to get your feet wet with Meteor development, it’s important to know that you understand what realtime web application is and how they work. The article, Introduction To Realtime Web Applications With Meteor And Node.js, does just that!
  • It’s time to get your hands dirty by Creating A Multi-Page Site With Meteor. In this article, the author takes a look at developing a library that not only can differentiate between the different URIs, but one that takes advantage of Meteor’s core features.
  • Learn how to Create A Meteor Chat App In 30 Minutes. What great about this tutorial is that it’s very simple to follow. Also, it gives you ideas and inspiration to work on your own stuff.

Keep up to date

Join a Meteor Meetup . If you’re in Ho Chi Minh City, don’t hesitate to swing by here and join Meteor Ho Chi Minh Meetup group. We usually meet once a month.
Subscribe to Meteor Weekly
If you prefer to listen, the Meteor Postcast might be the perfect one for you.

Know more?

So, that’s a few awesome resouces I suggest getting started with. Do you have any “I can’t believe you didn’t put it on your top” resouces? Please recommend your own tutorials by letting me know in the comments below and I will add them here. Thank you!

Single page application Development using Meteor JS

We live in a world dominated by JavaScript. Even though you are not a fan of this programming language, you still cannot ignore it if you want to be a professional developer. The good news is there are tons of JavaScript frameworks out there for you to pick up. In my case, the one that strikes my fancy the most is nothing else but Meteor.

After experimenting with this framework for a long time, one of its magical powers that I met was creating a single page app. So, in this post, we are going to discuss about benefits of single page application development using Meteor framework.

What is single page application?

If you are still wondering what single page app actually is, then read that word “single-page” again! Its name already told it all! Basically, it’s nothing but a single page without any additional pages. It is developed with an aim of improving the user experience by delivering all the functionality for an application without taking time to reload the whole page.

How about Meteor? What is Meteor?

Meteor was born in 2011 under the name Skybreak. Until January 2012, it changed to the name that we’ve called now. Unlike other frameworks, Meteor is a smart and powerful that allows you build web and mobile applications with one single language of JavaScript.

In term of programming, Meteor is describe as an open-source and full-stack JavaScript platform that includes a key set of technologies for building reactive web and mobile applications.

Benefits of single page app development in Meteor JS

There are many web frameworks available to choose from for single page web app development. But here, I’m going to bring to you a full list benefits of creating single page applications in Meteor Js.

Speed

Meteor requires less code. Instead of using thousand lines of code for a command like any other frameworks, it can just use 10 lines. Yes, 10 lines, you didn’t misread. Fantastic, right? So obviously, its speed is a outstanding benefit for developers and clients.

Responsive design

Because of the insanely increase of mobile devices, it’s a must for any kind of business to have an app that is mobile friendly. Single page apps developed with Meteor run great on desktop devices as well as on mobile devices such as smartphone, tablet, etc.

Real-time updating

When someone makes changes, data on the screen updated the moment instantly without stopping. There is no laggy feeling that is often a result of the data’s trip to the server and back.

One language

Meteor enables you to develop an awesome single page site just by only one language with one line of code which can run on both the client and the server, as well as do different things in either environment. How amazing it is! So, for those developers who want to become full-stacks ninjas, coding with Meteor framework is a good path that you cannot avoid mentioning.

Deployment

You just need only one command to push your web app to deployment and update all connected browsers and devices.

Open source

You are able to build your own amazing single page apps the way you want in a very short time. Moreover, this open source framework also owns a strong team maintain the whole projects and is responsible for new releases, QA, and keep API stable.

Because of everything mentioned above, I truly believe Meteor is one of the best frameworks out there for quickly building sing page apps, and it’s only going to get better. What do you think about it? I’d love to hear your thought in the comments below!

Multiplayer game with Unity3D and Meteor

Those who were not able to attend our 4th Meteor Ho Chi Minh meetup at September 17th could find all about Multiplayer Game with Unity3D and Meteor – one of the main topics of the meetup – in this blog.

Before digging into every facet of this post, you are required to have a fairly good background of Meteor and Unity3D.

What is Unity3D?

Unity is a cross-platform game engine developed by Unity Technologies and used to develop video games for PC, consoles, mobile devices and websites. First announced only for OS X, at Apple’s Worldwide Developers Conference in 2005, it has since been extended to target 24 platforms.

What is Meteor JS?

Meteor is a full-stack JavaScript platform for developing modern web and mobile applications. Meteor includes a key set of technologies for building connected-client reactive applications, a build tool, and a curated set of packages from the Node.js and general JavaScript community.

If you are a Meteor-novice, no worries! You can discover more about this full-stack JavaScript platform for developing single-page, real time web and mobile apps at Meteor.com

Why we should use Meteor with Unity3D?

When using Meteor, launching a MVP in 3-4 weeks can be a reality. With JavaScript on back-end, plus smart packages, Meteor allows you to develop faster. You don’t need to have experience about implement TCP/IP, UDP or pure Socket for a Gaming Server. With collection and method we can easily implement Gaming Network Architecture like Latency Compensation, Client Prediction, Server Reconciling and other technique.

How to connect MeteorJS with Unity3D

A team in Los Angeles have developed a plugin that make a bridge between Unity3D and MeteorJS through Websocket and DDP. You can find it here https://github.com/hiddenswitch/Meteor-Unity. By using this plugin we can use almost Meteor API such as: login, method, collection, publish/subscription. The plugin is great in general but one thing, it hasn’t supported WebGL for Unity3D yet.

WebGL

You cannot use hiddenswitch plugin with Unity3d WebGL now. But we can use other way to interact it. Unity3d WebGL support 2 API that help calling from inside WebGL container to javascripton page outside and reserve.

  • To call methods on GameObjects in your content from browser JavaScript, you can use the following code:

SendMessage ('MyGameObject', 'MyFunction', 'foobar');

  • To calls a function in the web page that contains the WebGL Player.

Application.ExternalCallExternalCall calls functionName in the web page containing the WebGL player, passing the given arguments to it. Supported argument types are the primitive types (string, int, float, string) and arrays of such types. Any other objects are converted to string using ToString and passed as strings.

So, did you find some great information of your own in this blog? Do you have any questions? Let me know in the comments and we can discuss about it!

Meteor Deep Dive – Reactive Programming With Tracker

Introduction

As a Meteor developer, I believe that everyone who has worked with Meteor all had experience with Tracker, or at least used it through some kinds of interfaces like getMeteordata or createContainer which come with the react-meteor-data package.

However, not all people know how Tracker works its magic. In this post, I’m going to dig into every facet of this case as well as bring to you a little bit of background knowledge.

What Is Tracker?

Tracker is a Meteor’s core package, it is small but incredibly powerful library for transparent reactive programming in Meteor.

Using Tracker you have much of the power of Functional Reactive Programming FRPsystem without following FRP’s principles when implementing your application. Combined with Tracker-aware libraries, like Session/ReactiveVar/ReactiveDict, this lets you build complex event-driven programs without writing a lot of boilerplate event-handling code.

What Make It Great?

In a nutshell, it is reactivity. In my opinion, it is the strongest aspect of Meteor. Tracker helps us make our system work reactively both on client and server with ease. We do not have to learn any extra stuffs about reactive programming or functional programming to get started.

Just read the Tracker api and do the work then the magic happens. Or even some Meteor-novice who do not know a thing about Tracker, their code still work reactively. Do you know what am I talking about? It is good old Blaze (I say it’s old because I already moved to React for all new projects).

Blaze’s helpers are reactive natively because they use Tracker inside, if you put inside them a reactive data source then whenever that source changes those helpers will be recomputed and you get new data on the screen.

Let’s read some code and behold what I am talking about, if you are already familiar with Tracker, skip this part and move to the next section to inspect the magic.

// Set up the reactive code
const counter1 = new ReactiveVar(0);
const counter2 = new ReactiveVar(0);

const observeCounter = function() {
  Tracker.autorun(function() {
    const text = `Counter1 is now: ${counter1.get()}`;
    console.warn(text);
  });
  console.warn(`Counter2 is now: ${counter2.get()}`);
};

const computation = Tracker.autorun(observeCounter);

/*
Message on the console:
Counter1 is now: 0
Counter2 is now: 0
*/

// and now change the counter1's value
counter1.set(1);
/*
Message on the console:
Counter1 is now: 1
*/

counter2.set(3);
/*
Message on the console:
Counter1 is now: 1
Counter2 is now: 3
*/

counter1.set(7);
/*
Message on the console:
Counter1 is now: 7
*/

How Does Tracker Work?

Basically Tracker is a simple interface that lets reactive data sources (like counter in the example above) talk to reactive data consumers (the observeCounter function). Below is the flow of Tracker (I ignore some good parts to make it as simple as possible)

  • Call Tracker.autorun with function F
  • If inside F, there is a reactive data source named R, then that source will add F to its dependence list
  • Then whenever the value of R changes, R will retrieve all its dependence from the dependence list and run them.

Everything is easier said than done. So, let’s take a look at the code:

const counter = new ReactiveVar(1);

  const f = function() {
    console.log(counter.get());
  };

  Tracker.autorun(f);

In the above code: counter is our reactive data source. It raises a question is that how can it know what function used inside to add that function as its dependence?

This is where the Meteor team does their trick to make this flow transparent. In fact, Tracker is an implementation of the Observer pattern or at least an Observer-liked pattern. Observer pattern can be used to create a reactive library like Tracker.

In an traditional implementation of Observer, we can think of F as an observer and R as a subject. R must have an interface to add F as its observer and notify/run F when its value changes. Something like this:

const counter = new Source();

  const f = function(val) {
    console.log(val);
  };

  counter.addObserver(f);

To imitate this, Tracker provides us these interface:

  • Tracker.autorun
  • Tracker.Dependency
  • Tracker.Dependency.prototype.depend
  • Tracker.Dependency.prototype.changed

Tracker.Dependency is the implementation of Subject in traditional Observer. All of reactive data source to use with Tracker use this object inside.

Let’s look at the basic implementation of ReactiveVar I use for examples above:

ReactiveVar = function (initialValue, equalsFunc) {
    if (! (this instanceof ReactiveVar))
      // called without `new`
      return new ReactiveVar(initialValue, equalsFunc);

    this.curValue = initialValue;
    this.equalsFunc = equalsFunc;
    this.dep = new Tracker.Dependency;
  };

  ReactiveVar.prototype.get = function () {
    if (Tracker.active)
      this.dep.depend();

    return this.curValue;
  };

  ReactiveVar.prototype.set = function (newValue) {
    var oldValue = this.curValue;

    if ((this.equalsFunc || ReactiveVar._isEqual)(oldValue, newValue))
      // value is same as last time
      return;

    this.curValue = newValue;
    this.dep.changed();
  };

So when we create a new instance of ReactiveVar, a Tracker.Dependency object will be created. This object will have two main functions: depend and changed with get call inside get and set function respectively.

This is the Tracker’s flow with more details:

Tracker.autorun will create a computation with the function (F) pass to it as the computation’s props.

// https://github.com/meteor/meteor/blob/devel/packages/tracker/tracker.js#L569-L585
  Tracker.autorun = function(f, options) {
    // ...
    var c = new Tracker.Computation(f, Tracker.currentComputation, options.onError);

    // ...

    return c;
  };

When being initiated, this computation is also set as the current computation inside a “global” variable named Tracker.currentComputation. And F will be run for the first time.

// https://github.com/meteor/meteor/blob/devel/packages/tracker/tracker.js#L146-L208
  Tracker.Computation = function(f, parent, onError) {
    // ...
    self._func = f;
    self._onError = onError;
    self._recomputing = false;

    var errored = true;
    try {
      self._compute();
      errored = false;
    } finally {
      self.firstRun = false;
      if (errored)
        self.stop();
    }
  };

  // https://github.com/meteor/meteor/blob/devel/packages/tracker/tracker.js#L302-L316
  Tracker.Computation.prototype._compute = function() {
    var self = this;
    self.invalidated = false;

    var previous = Tracker.currentComputation;
    setCurrentComputation(self);
    var previousInCompute = inCompute;
    inCompute = true;
    try {
      withNoYieldsAllowed(self._func)(self);
    } finally {
      setCurrentComputation(previous);
      inCompute = previousInCompute;
    }
  };

  // https://github.com/meteor/meteor/blob/devel/packages/tracker/tracker.js#L29-L32
  var setCurrentComputation = function(c) {
    Tracker.currentComputation = c;
    Tracker.active = !!c;
  };

If there is a .get operation (meaning .depend) inside body of F , this function will be run and set the current computation stored in the global var named Tracker.currentComputation as it’s dependent.

// https://github.com/meteor/meteor/blob/devel/packages/tracker/tracker.js#L403-L420
  Tracker.Dependency.prototype.depend = function(computation) {
    if (!computation) {
      // ...
      computation = Tracker.currentComputation;
    }
    var self = this;
    var id = computation._id;

    if (!(id in self._dependentsById)) {
      self._dependentsById[id] = computation;
      // ...
      return true;
    }
    return false;
  };

Then whenever .set is call (meaning .changed), F will be rerun

// https://github.com/meteor/meteor/blob/devel/packages/tracker/tracker.js#L428-L432
  Tracker.Dependency.prototype.changed = function() {
    var self = this;
    for (var id in self._dependentsById)
      self._dependentsById[id].invalidate();
  };

Yeah so it is the basic idea. Beyond this basic flow actually there are some other important things to be take care for to have a complete production-ready Tracker library. I am not going to write about those things, instead I will just name them. And you can go and check yourself for a deeper understanding of Tracker. They are:

  • Tracker inside Tracker (computation inside computation)
  • Clear stopped computations
  • Prevent infinite loop

Takeaways

Here’s something we’ve discovered so far:

  • Tracker make it possible to do reactive programming in Meteor
  • It is an observer-liked implementation
  • A good trick: use a “global currentComputation” to implement transparent Observer
  • Those guys who wrote Tracker are awesome 😉

So, did you find some great information of your own in this blog? I would love to know your ideas in the comments below.

Also, don’t forget to help this post spread by emailing it to a friend, or sharing it on Twitter or Facebook if you enjoyed it. Thank you!

What is the best JavaScript frameworks to learn?

If you’ve been in the software development world over past few years, you can’t avoid noticing some new versions of important JavaScript frameworks.

Although there are a variety of options for modern developers to choose from a range of JavaScript framework out there, five of them stand out: Meteor.js, Angular.js, React.js, Ember.js, Backbone.js

Meteor.js

Meteor is no longer a new concept to those who study and work in IT section. Unlike other frameworks, Meteor is a smart and powerful tool that allows you build web and mobile application win one single language of JavaScript.

In term of programming, Meteor is described as an open-source and full-stack JavaScript platform that includes a key set of technologies for building reactive web and mobile applications. Meteor requires less code, so even though you are newbies to programming, you are able to build you own amazing app at lightning speed.

You can read more about Meteor at meteor.com

Angular.js

What is the most beloved JavaScript framework for building single page application? What is “the big daddy” in the JavaScript framework world? Needless to say, it’s the popular Angular. Released the first time in 2009, it was the baby of Google (which is convincing enough to use it). Till now, Angular ecosystem has grown beyond imagination.

Two-way data binding is a much loved feature of Angular.js because of its magic which automatically synchronizes the view and the model. Besides, it also includes some other useful features such as extending HTML vocabulary, client-side form validation, possibility to create custom DOM elements and more.

Dive deep into it at angularjs.org

React.js

Are you in love with Facebook and Instagram’s users interface? Let me unveil you a secret, React.js is the super hero standing behind and powering that user interface. Isn’t it cool?

Came out in 2013, it’s currently the hottest and the fastest of the bunch because of its implementation of a virtual DOM and synthetic event. Another thing developers love about React is that it’s much easier for developers with JavaScript experience to get a handle on.

Find more information about React at – facebook.github.io/react/

Ember.js

Another powerful MVC JavaScript framework is Ember.js. It was initially released in late 2011 as an open-source project by Yehuda Kats. Like Angularjs, Ember also rides on the principal of two way data binding.

Ember stands out with its simplicity and flow of functionality to make web development a smooth experience. Also, Ember community is quite big and active, so if you face any problem in your journey, you can ask them for help.

Learn more about Ember at – emberjs.com

Backbone.js

First released in 2010 by the Jeremy Ashkenas, , Backbone is a lightweight but full featured JavaScript framework.

Backbone stands amongst some of the most popular web development framework for JavaScript developer for two reasons – it’s easy to understand usability modules, as well as the very straightforward learning curve.

You can read more about Backbone at – backbonejs.org.

So, there you have it. I just highlighted the 5 best JavaScript Frameworks in this blog. I know that choosing a JavaScript framework might be a tough choice because there are tons of frameworks available on the market these days. I hope this post can help you determine the suitable framework for your projects.

What is the best JavaScript frameworks to learn?Do you want to add some more names to the list? You can do so by mentioning the names of some more popular JavaScript frameworks in the comments box below.

Awesome free resources for learning React Js

If you’ve been in the software development world over past few years, you can’t avoid noticing that React js popularity continues its rising insanely.

Came out in 2013, it’s currently the hottest and the fastest of the bunch because of its implementation of a virtual DOM and synthetic event. Another thing developers love about React js is that it’s much easier for developers with JavaScript experience to get a handle on.

Related: 5 JavaScript Frameworks To Watch In 2017

It’s totally not magnify to say that learning React.js is almost a must. Nonetheless, with hundreds of free React js resources out there, you might pull your hair out to make decision which one you should get your feet wet with.

Lucky for you, I have pulled together a huge list of resources that will either help you get started with React js or broaden your understanding if you already know the basics:

Egghead

Egghead is an awesome resource where you can get all information on many different JavaScript libraries. And React js is one of them for sure.

Personally, I highly recommend you to try the React Fundamentals course which is totally free. It’s absolutely a great place for beginners to get their feet wet with and to quickly gain knowledge about all features of React js

React JS Crash Course (YouTube)

Covering all the basics including MVC architecture and the very foundational structure of React js applications, this React Crash Course video is your best bet.

Even though it’s not a complete guide, but I think it’s a solid introduction to the library that can help you shorten the time you will take to learn this awesome technology.

React js for Beginners (YouTube)

Another YouTube video that I want to share with you is React js for Beginners by Dev Tigris.

Its name said it all. This vid is a complete guide for beginners. The teaching style is very clear and easy to follow

FB React Docs

Did I mention React.js is the super hero standing behind and powering Facebook user interface? Yes, it is. Awesome, right?

Therefore, if you are looking for free React resources, you can’t not avoid mentioning the Facebook documentation.

It takes time and effort to work through these doc since there’s a lot of knowledge you need to absorb. But at the end of the day you will realize that it’s definitely worthy to try.

On the other hand, from all resources I saw, this tutorial is still one of my best resources to learn the basics of React js. If you are a beginner in React js and want a solid start in a short time, then it’s a good fit for you.

To-do App With React

It’s one of dozens of React js tutorials on Scotch.io. In my opinion, this simple to-do appis totally stand out from the crowd.

To-do app with React will guide you through a typical workflow and teaches common practices for building web apps

React Enlightenment

The React Enlightenment guide is another better sites for you to keep an eye on throughout your journey. One of its benefits is that it’s an open source. So, everything is free. You can easily read online or download if you like

This website is clean and extremely easy to navigate, using symbols, lists and a simple grid to lead to you the desired information. Moreover, this guide is frequently updated with new information.

TutsPlus React Tutorials

I have to admit that every tutorial on the TutsPlus site is very extraordinary.

Covering endless articles from basic to more advanced functions for any skill levels, The Tusplus React category will help you really get to grips with the knowledge of React js.
If you’re new to the React world, I recommend you to give Getting Started With React a try. I promise it won’t let your down.

Final Thoughts

There’s a ton of free beginner React js tutorials out there for you to choose and they will help you gain a solid understanding of React. This is my favorite list.

Hopefully, you are able to find at least one from these above resources to guide you through the world of JavaScript. It would be a good start for you to begin your new journey. But remember, nothing can replace what you learn by actually getting your hands dirty with it. Start on a new JavaScript project now!

If you know of any other great beginner JavaScript resources I missed, tell me about them in the comments. I’d love to hear your own reviews.

How to create a basic plugin by jQuery

jQuery is a quite small yet fast JavaScript library that consists of a number of extensible and durable features, and commonly used as a single method that performs a series of operations on one selection.

For example, its easy-to-use API is consistent with all browsers and can easily enable HTML animation, DOM manipulation, and event handling. Thus, bringing a more effortless client-side scripting for software programmers. In this article, let’s see how to write a plugin with jQuery.

How jQuery works: jQuery Object Methods

Before starting to write your own plugins, you must pretty understand how jQuery works first. Take a look at this code:

jQuery, programming language, javascript, software development, code, plugin

This is a basic jQuery code, but do you know what’s happening behind the scenes? When you use the $ function to select elements, it gives back a jQuery object which contains all of the methods you’ve been using (.css(), .click(), etc.) and every element that fits your selector. These methods come from the $.fn object.

Chaining

To help your plugin survive in the real world, there are a couple of things you need to do for it. When you link 4 or 5 actions onto one selector, you’re coming to the chaining feature of jQuery. This feature is done by having all jQuery object methods return the original jQuery object again (exceptions: .width() only returns the width of the selected element, not chainable). Making your plugin method chainable just takes one line of code:

jQuery, programming language, javascript, software development, code, plugin

Protecting the $ Alias and Adding Scope

Since the $ variable is very popular among JavaScript libraries, a conflict in the use of $ may arise when more than one jQuery library is required. The solution to this problem is you must place the code inside the expression of the immediately invoked function. This is carried out by the passing of jQuery and then naming its parameter $.

Adding Private Methods and Variables

After the alias ($) matter is resolved, move on to the next step: adding private methods or variables. In JavaScript (this case is jQuery), functions contain several variables and other functions that can be mainly accessed from inside the function, thus making the elements private. For the best way to access private variables and methods, you must use Immediately invoked function expressions.

Remember adding a private variable and enabling its use is only possible by using the Immediately Invoked Function:

These private methods can solely be called from within the scope of the function and only other private methods or public methods have the authority to call them. This is also for accessing the private variables.

Adding Public Methods

Public methods can be accomplished by nearly the same process as what you just did with private methods. There’s just one difference between these 2, the execution of the method. The method becomes public when it is supplied with a ‘this’ operator. The purpose of adding such public methods could be either to perform a function or to access the public variables and methods from outside the scope of the function.

Accepting Options for Plugin Customization

In some cases, your plugins turn more complex as you continue to add to them. Hence, it is a smart idea to make your plugin be capable of accepting some options and make them customizable. The easiest way to do this, especially when there are a lot of options, is with an object literal.

Putting it All Together

Combining all techniques we’ve discussed, the result is the following small plugin as below:

As you can see, the syntax ‘each()’ is used to loop through a collection of elements. Also, the return value for this method is the ‘this.append()’ which accepts the callback. We will be able to see what element is being appended to in the collection whereupon it returns.

 Hope our simple guidance for coding with JavaScript and this one – jQuery could help you be quite well-prepared and get ready to start the work by yourself. Now, let’s go code your own plugin, and don’t hesitate to share any of your confusion with Designveloper right down here in the comment box.