Last thursday, I gave my first tech talk. My company enfavors its employees to share their knowledge through presentations. The idea had been in my mind for a long time. I always admired talkers. Not because of their charisma, but more because they have knowledge and the spend time preparing and have enough confidence to speak in front of their audience.

Preparation

I had been preparing my talk for months. I knew I could get a conference room to present it in. I needed a time slot too. Other presenters where ahead of me, but I didn’t mind as long as it happened. I also had to choose wether it would be a lunch presentation or an afterwork one. I went for the former as it drags more people to it, even though the downside of it that people eat during your talk.

As we were getting closer to the big day, invitations were sent, a Google event was made and I could estimate how many people would come. It was all very exciting.

But before I could present, I had to make the slides. I had a subject already. I’d been a big fan of AngularJS and been using it in a couple of projects and got loads of great feedback from it. My company gave me a Powerpoint template to start with … yuck ! The graphics in it dated from the 20th century ! With all these funky slides on the web, I had to find something worth it. Of course Keynote is good too, has great transitions, and it can even record your presentation, but that was probably too easy and not geeky enough. As I was to present live web page demos, so a web based presentation it would be. After searching around, I decided to use reveal.js. Even though it is open-source, slides.com hosts presentations using it.

So I prepared my slides, organized them, chopped down some infos, so as not to drown my attendees in words. Procrastination got the better of me and the last 10% of polish were obsessing me. Fortunately, I had my wife and @madbrain to reread the slides. I practiced several times throughout the presentation. Trust me, this is mandatory. You might think “I know this, I’ll have no problem talking about it”. Believe me, once you start with no audience, you realize a bit of practice is necessary. Imagine with the audience and pressure.

Giving the talk

So the big day came. After some problems with the overhead projector, I got things started. I have to say it went better than I expected. The audience was receptive. I had a survey in the first slides to get interaction and sometimes polled the audience. The talk was fine all in all.

The demos however, didn’t work. I could not get them to work. At first I thought that the lack of internet was to blame. But I had prepared so that the actual demo would reference a local copy of AngularJS while the slide showed that it references a CDN. I had cloned the repository on my laptop, but in order to get a local copy of AngularJS, I had to run bower install for bower dependencies to be retrieved.

I didn’t resolve this during the presentation in order to get things going. I now commited those dependencies to my repo in order to avoid that and have a working copy right after clone. This can lead to a divergence between the bower.json and the actual dependencies on the repository, but I guess it’s a lesser evil.

I really have to hand it to Zach Holman for his great advice on speaking.io. It really helped me concentrate on what’s important for a talk and what’s not.

Anyway, here’s the talk, it’s in French, though.

Recent javascript frameworks are great. They allow you to do many things simply. Such things are recent but so useful like two-way data-binding or REST resources. These concepts have become so essential that one could argue they could be part of the original language. This is what is suggested in Data-binding Revolutions with Object.observe().

After all, frameworks are nothing but temporary extensions of a language. Same goes for Spring in the Java ecosystem. For example, Spring Batch became so popular that a JSR was made to standardize batch functionnality for Java. See JSR 352 and JSR 352 Spring Batch And You for more details.

The annoying thing about frameworks is that they take you prisonner. It’s often not possible to use multiple frameworks for the same part of a stack. This is why standardization is a good thing. It allows one to use a standard regardless of implementation. This is great for switching technologies.

One shouldn’t avoid frameworks. Frameworks are great and the more people use a framework, the closer it gets towards standardisation, the holy grail, the one-standard-to-rule-them-all kind of conquest. But sometimes, it’s only the concept which is retained. This is what happened for Java 8. Closures existed already in many languages, even for the JVM. Such is the case for Scala and Groovy. Sure it was possible in Java with inner classes. Anonymous classes are a simple and widely used concept and now Java has a simpler notation for these.

Frameworks push languages forward. They are the beta testers of new functionnalities. The ones who succeed become part of the language.

In 2012 I started looking at the effusion of JS frameworks, amongst which three cought my attention :

At that time, AngularJS was still emerging compared to Backbone, which was used in production and had all the attention. Backbone is simple, so simple that its code serves as documentation. This seems like a good thing, but the purpose of a framework is not to be designed simply, but to be simple to use. That’s what Knockout.js and AngularJS are. But between the two, Knockout.js is too limited. It does very well with data binding and templating, but doesn’t have advanced features that made the popularity of AngularJS such as dependency injection, services, directives, animations …

AngularJS is my prefered choice for future web applications. It does wonders with a backend thanks to its REST API. For me there’s no need to have server-side rendering as AngularJS can take care of it and make use of services to communicate to the server.

Comparison between frameworks

The following characteristics are not meant to be exhaustive, but are of prime order to me regarding JavaScript frameworks.

Characteristic AngularJS Backbone.js Knockout
Ease of learning 3 2 1
Documentation 1 2 3
Community 1 2 3
Number of users 1 2 3
Testing
Dependency injection
Flexibility (1) 3 1 2
Convention 1 3 2
One way data binding with epoxy.js
Two way data binding with epoxy.js
Level of separation from DOM 1 3 2
Extendability 1 2 3

Ordering is from best to last

(1) AngularJS is noted as less flexible, but that is because it follows conventions. This is what makes it more efficient than other frameworks. The structure and convention is set, leaving way for the app’s code. There’s no need to reinvent the wheel, nor to ensure certain standards that one has to maintain between developers.

AngularJS is great for medium to large projects if you follow simple conventions. There’s just no bending the model as you would in Backbone and Knockout. But overall, it’s for the best. Here’s how it’s meant to be used :

Service : Connectors to external APIs Directive : Allows to modify DOM through the use of tags or attributes and bind to scope View : DOM Controller : Glue between Scope and other components like Services//Directives

Well, it isn’t really my first pull request. I’ve done pull request on friend’s projects on GitHub or even on GitLab working in corporate environment. This was really my first pull request on an open source project. Ever since I saw Zack Holman’s presentation at Mix-It 2013 I knew I had to be a part of it. And there I am contributing to Pivotal’s Spring Boot project.

I made this change because I was using Spring Boot for a corporate project. The bootstrapping made it really easy to build, the convention over configuration aspect had the advantage of reducing the amount of overhead code to get the app up and running. But maybe the convention wasn’t fully what I needed. Spring Boot 1.0.0.RELEASE had support for ActiveMQ, which worked great, but in my company, where the queuing system was relatively new, they decided to secure it by adding credentials. Unfortunatly, Spring Boot did not provide out-of-the-box support for credentials.

Adding this functionality was terribly easy (35 lines added and 4 removed). I had modified the Spring Boot project I had cloned and builded it and deployed it as SNAPSHOT on my local repository. Everything worked on first try. As this is a common feature I guessed I wouldn’t be the first and last to want it. I commited this feature on a new branch on my GitHub fork and made a pull request.

The Spring Boot team was really quick as to check the pull request and accepted it after my signing Pivotal’s legal papers. It got integrated into Spring Boot 1.0.1.RELEASE.

This may seem as not a big deal to many readers, but I’m sure you had the same excitement on your first major pull request.

I am now a part of the open source community.

My name is Jean Detoeuf. I live in Lyon and I’m a software developer. I spent the last few years learning to code and have gotten quite good at it. Can’t say I’m a genius, but I get my way around a few design patterns. I can’t remember their names, but that’s not really the point of design patterns. They’re meant as good practice for programmers.

This blog will be about the Java ecosystem, Agility, and the software industry. Hope you’ll enjoy reading it. I’ll be linking a lot of things I find useful and sometimes be posting solutions to problems I’ve come accross that weren’t already on the web.