Monday, November 23, 2015

Weekend Reader, Week 47

Highlights from AngularConnect 2015

The post is a very good overview about the progress of Angular 1 and 2.

Angular 1 ist still making progress. I am looking forward to the component syntax and also to the component router and the new internationalization features which both are shared with Angular 2.

I am a bit concerned about the ever growing scope of Angular 2:

  • They plan to deliver their own command line interface called Angular-CLI for integrated tooling
  • They want to support APIs in 4 languages: ES5, ES6, TypeScript and Dart
  • They want to support the MV* pattern but also the Flux pattern for separation of concerns
  • They want to support different rendering targets besides html to support native mobile applications
  • They want to use WebWorkers to run most of the Angular code in a seperate process

I am really curious how all these features will turn out in regard to complexity and developer experience.

JavaScript Community in Bern

Just a reminder for the "Bärner JS Talks" happening next wednesday.

Very interesting topics, I am looking forward to all of the three talks.

The Thing about Bower

There is something going on around bower

It was proclaimed dead on redit

One reason for that proclamaition was this discussion on github.

As a reaction the bower team posted the following post: Bower is alive, looking for contributors and started a crowd funding initiative.

Meantime in the Microsoft World, VisualStudio is still betting on the bower horse and improved the integration with a new Bower Package Manager UI for ASP.NET 5.

Personally I am currently a fan of modern JavaScript workflows based on NPM/Webpack or JSPM … no bower for me anymore.

If you want to get rid of bower, the following post might be a good starting point: Why We Should Stop Using Bower – And How to Do It

New Rules for JavaScript

Kyle Simpson ist known for having other opinions about “best practices” in JavaScript. In this video he questions many common practices and rules of current JavaScript programming.

Business: Nobody Wants Your App

An interesting article as an interesting following up on "Don’t base your business on a paid app"

The article shows the story of a startup that wanted to create an app … and was not that successful.
Interesting is that they had a good visibility, but nobody wanted to download for the app:

One download for every one thousand web views.

The conclusion:

The app world is so bloated, it’s overwhelming to the consumer.

I see that effect myself: Some years ago I was browsing the App store to detect new cool Apps, but now I can’t remember when I actually opened an App Store the last time…

Tools: Classeur

I am using Markdown a lot. For my courses and for blogging. But I am still looking for my favorite Markdown tooling. For some time I have been using StackEdit for blogging. Recently I discovered Classeur.io which makes a neat impression. I am writing this post right now in Classeur …

Programming Humor: FizzBuzz Enterprise Edition

Fizz Buzz is a famous programming exercise, suggested to be used in programming interviews. A solution in JavaScript might look like this.

Somebody made an enterprise version of Fizz Buzz in Java … Hilarious!

Tweets of the Week

Saturday, November 21, 2015

Quo Vadis JavaScript?

JavaScript went through a makeover extraordinaire with ES2015 which was finalized this summer.

This is not your grandma’s JavaScript any more:

import React from 'react';

export default class Catalog extends React.Component {
    constructor(){
        super();
        ...
    }
    buy(product) {
        ...
    }
    render() {
        ...
    }
}

But it seems this was just the beginning… the metamorphosis is far from done for JavaScript.

For future versions of JavaScript there are many proposed new language features. Among the most outstanding proposals for me are decorators, async functions and private state

Some years ago nobody would have believed that the following snippets are (will be) valid JavaScript.

Decorators:

@createStore(alt)
@datasource(CatalogSource)
export default class CatalogStore {
    
    ...
    
    @bind(CatalogActions.searchLoaded)
    onSearchLoaded() {
        ...
    }
}

Async Functions:

async function fetchJson(url) {
    try {
        let request = await fetch(url);
        let text = await request.text();
        return JSON.parse(text);
    }
    catch (error) {
        console.log(`ERROR: ${error.stack}`);
    }
} 

Private State:

class DataObj {
  private #data1;

  constructor(d) {
    #data1 = d; 
  }

  get data() {
    return #data1;
  }
}

I think its now safe to say that Silverlight and Flex were failed attempts to bring other languages than JavaScript into browsers … but looking at the snippets above, it might sure look like some C#/Java infiltration squad sneaked into the Ecma building …

Babel and TypeScript both already support decorators and Babel also supports async functions (TypeScript is working on it). So you can use those language features right now in a modern JavaScript project setup.

Of course the JavaScript ecosystem/community is going through a tremendous development and learning process right now. We are slowly getting the new features piece by piece and figuring out how to use them … while that slow metamorphosis process can be healthy, it can also be painful…

In the future, once JavaScript has completed it’s metamorphosis, people might legitimately ask why we did not just integrate C# or Java into the browsers … ?

Tuesday, November 3, 2015

Karma and Protractor Illustrated

For my JavaScript / AngularJS workshops I created two illustrations to explain how unit-testing with Karma and end-to-end-testing with Protactor is working:

In both setups the code is running in the browser. The main difference is, that with Karma I am testing isolated ‘code-units’ that are run individually, there is no complete running application involved.
In the Protractor setup a complet running application has to be availabe and the test drives a browser to interact with this application.

Related Posts Plugin for WordPress, Blogger...