You might have noticed I have been writing about ES6 a lot lately. This is because I am excited about ES6 and thanks to the use of transpilers we can actually use it right now until browsers catch up.
What are Javascript classes? In many ways, they are a sham. Javascript classes don’t really exist other than for cosmetic reasons. They are syntactic sugar over existing Javascript prototypical inheritance. The reason for this was to ensure backwards compatibility, classes merely give you a cleaner way to organise your code.
It’s time for another ES6 post. This time, we’re talking about arguably one of the best additions to Javascript that is up there with modules and classes. I am talking about the ability to specify default parameter values on a Javascript function.
This is one of the biggest missing pieces in Javascript in my opinion. I have encountered the need for this numerous times and while you can definitely implement a solution that does the job, there has been no support for native parameter values until ES6.
On Saturday the 31st of January Queensland public went to the polling booths to cast their vote and say in who gets to lead Queensland going forward. Both sides (LNP and Labor) had been slinging words at one another in what looks like primary school playground fighting all the way up to and during the election.
Looking at it non-objectively, both political parties have their pros and cons. Unfortunately, most people who voted didn’t vote because they took the time to understand which political party aligns with their beliefs but rather instead opting to vote against the socially unpopular party: in this case it is the LNP.
With ES6 comes a plethora of new features and changes, one of those is Weakmaps – essentially Weakmaps are a collection of keys and values with the main constraint being the key has to be an object. In-fact, Weakmaps are very similar to that of standard ES6 maps, with a few constraints.
Unlike using a map which allows for arbitrarily named keys, the key in a Weakmap is an object which can either be {} or function() {} because functions inherit from object.
I have been an avid user of Sublime Text Editor for as long as I can remember. I still remember when I used to use Notepad++ and the day I switched over to Sublime. I used the trial for about a week and then bought a licence for $70 (a big deal for me at the time due to not earning much money).
But now I feel as though Sublime Text Editor has fallen behind. Don’t get me wrong, it is a glorious text editor and I not only use it to code, but I also compose emails in it, I write Markdown and take notes in it. Sublime has always been there but I have yearned for more
One of many favourite things in ECMAScript 6 (aka ES6) is the newly added arrow functions. If you’re a Coffeescript user then the arrow function premise is not entirely new to you.
Essentially it allows you to create an anonymous function with the contextual value of “this” being the scope of the function being that of the outer function that the arrow function is being defined in. Nor does it expect you to use the keyword function
In 2013 I had my first experience with UK customs at Heathrow Airport. I had never been to the UK before, but my soon-to-be-wife has UK roots. Her parents immigrated over here 20 years ago and she has tonnes of family in the UK still.
We were visiting her nan and other family she has in the UK. A couple of aunts and uncles, her other nan as well. What actually sparked this post was this news story I read about a debate in UK parliament about making it easier for Australian and New Zealand’s to travel, work and live in the UK.
While browsers play catchup with ES6 support and we wait for older browsers without ES6 support to fizzle out and die, we can actually start using ES6 today thanks to the work of Google’s Traceur or BabelJS.
Whichever you choose for whatever reason, as long as the resulting code is ES5 compatible and your needs have been met, then really there is no competition between any transpiler except for perhaps the resulting code and various parts of the specification that are supported.
Recently I switched my writing workflow for all of my blog posts to Markdown. I compose all my blog posts in Markdown, sync them with Dropbox and then publish them. In doing so, I have noticed the quality of my posts has increased, the frequency of which I write has increased and more importantly, witness an unprecedented amount of growth in blog traffic.
Why Markdown? Writing in Markdown is so liberating, it is just text with a little sugar sprinkled over the top. Creating headings just means I have to write a # followed by text and bump up the number of # depending on the type of heading.
Things just got real in the front-end framework space. Durandal developer Rob Eisenberg and once upon a time short-term core Angular 2.0 developer has announced a new framework called Aurelia. A beautifully designed full-stack SPA framework with support for ECMAScript 6 syntax right out of the box and some clever design decisions.
Not only does it allow you to build applications using ES6, but it supports all forms of alternative abstraction syntax out of the box like TypeScript, AtScript and even CoffeeScript. Rob has plans to put out migration documentations detailing how to migrate from Angular 1.x, Angular 2.x and of course: Durandal. They are not currently available, but are on the roadmap as can be seen here.