On May 2nd Chris Strom wrote a message on G+. He was looking for some candidates to try out the new Google Hangouts Remote Desktop while working on Dart.
I decided to give it a try, though I had never done any Dart development prior to this meeting.

Zero Dart experience required. Really :)

Chris Strom
This quote gave me enough confidence to send him an email and try this out. Since then I have done more than 5 #pairwithme sessions with him while switching between his machine and mine.

I want to use this post to review some of the things I have learned through these sessions. I believe more #pairwithme sessions should exist in any community.

By doing pair reviews and working on each other's machines, you get to see how others would tackle certain problems, how they would read errors or debug stuff. This allows you to get smoothly into the language while avoiding silly mistakes. Also, you get to learn from each other's methods and that is always a plus.

Getting started:

To my surprise the only thing I needed to get started was the Dart Editor and a fork of the ice-code-editor (the JavaScript version is live here ).
The out of the box experience with Dart is excellent. You are up and running in a short period of time and the Dart tutorials are a great material to get you started.

About Google Hangout remote desktop:

The quality of the remote desktop is great. The latency between screen updates has been very low so the pairing experience has been very pleasant even though I am currenlty in France and Chris is in the U.S.
We did encounter some issues when using each others keyboards. I have an azerty keyboard while Chris has a qwerty one.

Emacs and Dart:

There is a dart-mode for emacs. You can do a M-x package-list-packages, search for dart-mode, once you have found the package press I to mark for installation, then press X to start the package installation.

Dart paths and commands (OSX):

  • Chromium: is available under dart/Chromium/Chromium.app. Is good to have Chromium running while you are working on your app.

  • DartEditor: is available under dart/DartEditor.app. The editor is really easy to work with and is well presented in the Dart Tutorials.

  • To run an application you can do dart yourapp.dart from a command line. The dart command is available under dart/dart-sdk/bin you might want to add that to your path.

  • The dartanalyzer does the same work that the DartEditor does when it highlights errors and warning. It is also available under dart/dart-sdk/bin and is great if you want to use other editors like vim or emacs.

On Dart:

Through this pair review sessions we have worked on multiple issues while porting to Dart the ice-code-editor. This is great because you get to see multiple aspects of the language (Unit tests, JS interop, DOM usage). Here are some of the things we went through during these sessions.

DOM manipulation:
We worked on hidding some JS dependencies from the ice-code-editor. It turns out that html manipulation is really smooth.
Take a look:

var script = new ScriptElement();

script.src = "packages/ice_code_editor/ace/ace.js";
Javascript interoperability:
There are some examples of how to call Dart from JavaScript and how to handle callbacks here and here. We came up with a similar solution.

Keyboard events:
We also worked on some Keyboard events in order to delay preview updates in the ice-code-editor.

Unit tests:
We have also tackled some unit tests in Dart. You know it is always good to have them :-),


Through these sessions I also learned a lot of things that I didn't expect.
Network emulation in linux:
You can emulate network latency netem as described here.
Emacs commands and lisp expressions for my .emacs:
With the following code on your .emacs you can simply select a region and do a C-x C-; to comment out a region of code.

;;comment region

(global-set-key [?\C-x?\C-\;] 'comment-or-uncomment-region)
If you want to insert the content of a file into another file, you can perform a C-x i and choose the file you want to insert. Then press Enter.

That's about it. Not bad after just a few sessions of Dart in my opinion. I hope someone finds it helpful, and maybe some of you might want to try out or suggest more pair review sessions through the G+ hangouts.
Finally huge thanks to Chris Strom for proposing these #pairwithme sessions they have been really helpful.