aimee's avatar

Learn to Type Correctly Week

by: aimee

The week has begun! Developers all around the world are making a conscientious effort to learn to type faster, more accurately, more effectively.

This is thanks to Corey Haines proposing a Learn To Type Week! Today we have been given our first instructions for Day 1: do a 1-minute, 3-minute or 5-minute exercise from FreeTypingGame.net with your hands covered over so you can’t peek.

I did the 5-minute test, writing the story of the Elves and the Shoemaker. I made a few mistakes, but i felt quite a smooth rhythm. I got 78 words per minute. That’s not too bad; it’s a nice baseline, something to build upon. In some of my typeracer games i’ve sometimes been getting to 100+ words per minute, so i’d love to be able to get there comfortably and consistently.

One thing i’m really trying to focus on this week is the number keys and symbols. I can touch type letters (on Dvorak keyboard layout) but when it comes to symbols i always have to look. I also need to learn once and for all to use both shift keys and not always to go to the shift key on the left.

Have a good week everybody! :)

Tom Crayford's avatar

Third Day at Eden

by: Tom Crayford

(This post is part of a series documenting my apprenticeship at Eden. For more, visit the archives)

This a retrospective post, which I’m writing on Monday morning (for Friday). On Friday I finished most of the wiki exercise, then paired with aimee for some client work.

Wiki Retrospective

The wiki exercise was interesting, not least in learning more about testing and abstraction. I think the main flaw with my program (as it stands now) is that every action is modelled with its own Webrick servlet class. This has cost me significantly in flexibilty; if I were to do this assignment again I would write one servlet that just routes actions to something akin to a rails controller. This would have made the testing much easier, and reduced (somewhat) the level of mocking I did.

I’m quite happy with the mocking library that emerged, and found that testing interactions (as apposed to state) fits nicely with my (newbie ish) ideas about OO testing.

The other main lesson I learned was with regards to ruby metaprogramming. Whilst not as ‘flexible’ as lisp macros, I’m finding ruby metaprogramming an interesting way of thinking, because you are mostly manipulating methods on objects (and classes).

The other pleasant thing here was finding out how little code it takes to write a minimum viable testing framework. I also wrote a little rspec clone on top of my testing stuff, which was very simple to do. I didn’t end up using it, because it would have meant converting all my tests to a new format (again, after I converted them to xUnit style), and everything was pretty much finished already. Furthermore, the examples were already pretty readable, and I didn’t feel that specs would add more.

Finally, I keep on feeling spoilt by Clojure’s sequence library. There are a number of functions there that I’d love to have in ruby (partition-by would have been useful for the scoring kata, and group-by is dang useful).

aimee's avatar

760th day at Eden

by: aimee

We have a new intern at Eden. Tom Crayford studies Software Engineering at Sheffield University and is doing a 2½ month internship with us, with the possibility of becoming an apprentice at the end of it.

In the style of Tom’s two recent blog posts, First day at Eden and Second day at Eden i thought i might also write about my day, since it was a particularly satisfying one. It just so happens to be two years and a month (760 days) since i joined Eden!

Straight after this morning’s stand-up meeting, I had a quick debrief of a meeting we had with a potential new client yesterday evening. Then i helped Todd to write an email. We draft our emails on Google Wave these days, which is often fun. Four of us were editing the email at once, which means we quickly get to something we’re all happy with before sending it.

I went out for a walk with Frances to pay in some cheques and buy some Friday Treats for everyone!

At lunch time some of us had several rounds of TypeRacer in preparation for Learn To Type Correctly Week next week! I think it’s incredible how so many people have got enthusiastic about learning to type well after Corey Haines announced it. If you don’t believe me, check the twitter hashtag, #learn2typewk!

Something quite unusual happened after lunch. We had a message from Richard Knoll at Mercia Cycling Club in trouble and needing help because the site was not responding. Richard had found us on Google after searching for Ruby on Rails. I agreed to look at it with Tom for an hour and see if we could figure out what was wrong. We determined that rubygems and Radiant had been upgraded on the server and we needed to tweak a few configuration files. With help from Chris and Spencer, the site was back within the hour! Chris then helped me to raise an invoice for an hour’s work.

It’s interesting that we can do anything from a fast restore of an unresponsive website, to projects that take several months from start to finish, requiring two or three pairs of developers working at a time.

Tom and i continued to pair together for the rest of the afternoon. We were able to add value to a project to help a charity in Cambodia. I always learn something whenever i pair with someone. Tom is no exception and i very much enjoyed pairing together today. We all have things we can teach each other.

Tonight i think i might learn a bit from the Ruby Kōans, possibly study a bit of SICP, and definitely see who gets evicted from Big Brother!

Tom Crayford's avatar

Second day at Eden

by: Tom Crayford

(This post is part of a series documenting my apprenticeship at Eden. For more, visit the archives)

I’ve now finished the Ruby Koans I started on the first day. The remaining koans taught me some useful things about message passing and method_missing, which I have since used for a little test framework.

After finishing these Enrique got me tdding a wiki server using just the ruby standard library. The twist to this is that you’re not allowed to use Test/Unit, so you basically have figure out how to write tests.

After finishing the day, I looked over the test code, and found it extremely ugly. I’ve often found that ugliness in code means that I’m missing the right abstraction, or at the very least that my design is flawed. My fault here was entirely in the test code, which seemed very unstructured.

To resolve this, I wrote a small (77 lines) implementation of the xUnit testing framework, so that I can clean up the tests on my third day. I wrote this (from memory), based on Kent Beck’s example from TDD by example There’s also a tiny mocking thing, based on Dingus, which I am using for testing servlets.

After writing these two to help me organise the tests, I’m think the rest of the wiki should be much easier to test (and therefore write). This reminds me again of the importance of aesthetics in code. I’ve found ugly code is often very difficult to work with, and makes the developers working on it unhappy as well.

Tom Crayford's avatar

First day at Eden

by: Tom Crayford

I’ve just finished my first day as an apprentice at Eden. As an exercise for the first day, Enrique (my mentor) had me going through the Ruby Koans, which were pleasantly surprising.

As a further add on to this, Enrique added the rule of not having any method longer than 4 lines. I first saw an idea like this whilst reading Clean Code (which is a very good read). In the past I probably would have written a large method, but this encouraged me to write much smaller ones.

The nice part about the koans is they teach parts of the language one might never touch much (I’ve never really used array slicing, for example). The scoring problem (the koan I’m currently on), was also an interesting design challenge. The solution I ended up with is here:

Even this small exercise reminded me of the important point of finding the right technique being crucial to clean code. With the right angle on the problem, code can become significantly smaller and easier to change.

The right abstraction in this case was finding triples by using

(1..6).each do |i|
  if dice.count(i) >= 3
  ...

After I discovered this, the problem was easy to solve (and the code was cleaner too).

Annendum

Learn to type week (as suggested by Corey) is next week, and I’ll definitely be taking part in it.

aimee's avatar

Mobile app development and the DRY principle

by: aimee

I want to ask: what do people think of applications that generate code for Android, iPhone and Blackberry applications? The sort of “write it once, run it everywhere” dream. I’m talking about things like Titanium, PhoneGap and Rhodes.

I’m particularly interested in hearing from people who have developed for at least one mobile platform. See, when i first came across PhoneGap i was extremely excited! I thought it was an extremely good idea: it conformed to the DRY – Don’t Repeat Yourself – principle, and meant you only had to learn one framework and suddenly you could build applications that could run on multiple devices.

Since then, i have had a little dip into Android development using Java, and i’ve spent a week intensively teaching myself iPhone development using Objective-C. I’m no longer at all convinced that these DRY frameworks are such a good idea.

I’m an Android user and i don’t really have much experience with iPhones, so learning iPhone development means also learning the standard ways in which people expect iPhone applications to behave. And i realise that they are quite different from the ways in which Android applications are expected to behave.

For example: application settings. The standard behaviour in Android applications is to press the Menu button and choose a Settings option. In iPhone applications you generally press a little icon which causes the view to flip over to another view containing Settings.

Another example: application feedback. An iPhone application often pops up an alert with an OK button, but Android applications pop up a little message towards the bottom of the screen which fades away after a second or two and does not prevent you from doing anything else whilst it’s there. Alternatively, a background task may put a message into the notifications bar at the top of the Android screen.

Android users are used to the ‘long press’ to get further options. I don’t think that concept even exists for iPhone. Button sizes and styles are different. Android has tab bars at the top, iPhone puts them at the bottom. Android uses the physical ‘Back’ button but iPhone needs a button in a task bar on the application screen. I could probably go on if i spent more time thinking about it.

The point is, Android and iPhone have different user bases with different expectations. How do you cater for both in one development environment without reducing both to something kinda clunky and not very satisfactory for either? I imagine the interface differences between Windows Mobile, Palm, Symbian and Blackberry are even more pronounced than those between Android and iPhone.

I should look into Rhodes, PhoneGap and Titanium and see how they deal with these very different paradigms. But right now i’m very interested in hearing from people with more experience. At the moment, if i wanted to write something for iPhone and Android i’m thinking i would probably go WET – Write Everything Twice. What’s your take on it?

Enrique Comba Riepenhausen's avatar

Adewale Oshineye in the Wandering Book

by: Enrique Comba Riepenhausen

It has been quite a while since the last entry to The Wandering Book has been made, but finally we have it! This time Adewale Oshineye, co-author (with Dave Hoover) of Apprenticeship Patterns gives us a gentle push as a community.

What have you made recently?

He rightly asks us what we have made, what we have learned by doing so and what is the next thing we are going to build.

Ade's entry in The Wandering Book

Ade's entry in The Wandering Book

There is one thing in his entry though that really made me nod and be totally in tune. He talks about generative communities; groups of people with overlapping values that, together, create things that interact with the physical world (conferences, software, articles, devices, etc).

Having said that, I am working on this problem for a couple of months now, trying to find a way to give back to my community (here in Winchester) and enable the growth of other people; either in terms of software development (teaching how to build software) or by infecting them with goodness and the will to help each other.

Chris Parsons's avatar

How to test your node.js app

by: Chris Parsons

I’ve wanted to hack on a node.js project for a while, and a new app idea has given me the perfect excuse. My first question was: how do I test this? It’s a fairly new field out there, and there isn’t much help from node.js itself: it’s much more like Rack than a proper framework. So I spent some time coming up with one way to do it.

Disclaimer: I’m not that experienced with Javascript, particularly with the best way to define objects. I’d be grateful for patches to help improve the quality of the code here. I’ve also borrowed heavily from apprentice-us - thanks to Dave and Corey!

Overview

This is what I’ve got so far (the actual app I’m working will remain closed-source for the mo):

Example node.js github project

You probably want to refer to the code whilst reading the rest of this article.

To run the tests, run rake. To start the app, run node app.js (you will need to have node.js installed obviously).

If you install the watchr gem, and run watchr autotest.watchr, you’ll get robust autotest like functionality. I’m liking watchr much better than ZenTest right now.

How it works

The basic premise is to decouple the request/response handler from the server (see app.js, lib/http.js and lib/router.js). The interesting bit is in test/ integration/ user_sees_homepage.js - this then calls the dispatch method directly, passing in dummy Request and Response objects.

Note how I’ve defined the Response object. This allows me currently to write an integration test that looks like this:

router.dispatch(new Request("GET", "/"), new Response(function(headers, data) {
  assert.contains("200", headers['status'])
  assert.contains("Hello, world!", data)
}));

The assert.contains() method is not part of node.js: it’s implemented in test/helper.js.

The reason you need the asserts to be fired in the end() function is that node.js is inherently asynchronous and will finish executing this file whilst waiting for the haml file to load in lib/router.js. Try it yourself: if you put an assert at the bottom of the file it will fire immediately.

Unit tests

The plan is then to define whichever unit tests you need in test/ unit/ (something)_test.js, with the corresponding code in lib/ models/ (something).js. Just run javascript code in here and call methods on assert, and rake will execute it.

Improvements

You could potentially use the Sinatra-like framework Express to define lib/router.js - I’ve handrolled it for the moment. I’m of the opinion that you spot betterrefactorings by handrolling to start with: it could be that express.js isn’t right for my app, and I can’t easily tell yet.

There are a number of javascript testing libraries out there, but at the moment I’m happy with my own handrolled version, which just relies on the ‘assert’ package that node.js provides. There’s nothing to stop you using JSpec or some other javascript testing library: I wanted to keep things simple to start with.

I’m also aware that Cucumber now supports javascript through V8, which is an important step in the right direction. Unfortunately however it doesn’t yet support the commonjs package system, and doesn’t run through node.js but through raw V8. This makes it hard to use with anything but toy examples. Ideally I’ve love to plug Cucumber in in the future, if we can get it to use node.js as the platform somehow.

If you use it for something useful, let me know! I’d be very happy to receive patches and suggestions.

Chris Parsons's avatar

User Experience Is Everything

by: Chris Parsons

User Experience Design is a field which has been around as long at computer science itself, but has only recently come to the fore in the world of software development. While it’s been an important component of the work we do for some time, I’ve recently realised that it’s actually much more than that. It isn’t a component of what we do, it is the entirety of what we do.

How is a user to see the hard work we put in to fashioning a particular system, if it’s not through the use of that system? Their experience using the system is key to what they think of it, and the benefit that they get out of it.

When they encounter a bug with our software, it’s a failure of user experience. The “user” should not have “experienced” a bug in the system. When we build software, we try our hardest through all sorts of techniques and practices to create a system that is bug free. We are unconsciously thinking of user experience, even if we’re not aware of it.

Obie Fernandez recently gave a talk in which he made the statement “Perception is Reality”. He’s right. What a user perceives to be the case with the software they are using is what is real to them.

What use is it if our software is beautifully designed internally, but pig ugly to look at and difficult to use? The user’s perception of the software will be that it’s bad software. We might disagree with them all we like, but their perception is impossible to change, and we shouldn’t try to change it. Let’s instead change our software so that it’s perceived to be good software.

User experience goes so far beyond the common notion of “web design”. It’s everything about the site that the user uses and interacts with. It’s the feeling the user gets when they “open the box” - the login screen, the page load time, and the blank state. It’s the presence or absence of features. It’s the ease of accomplishing difficult tasks.

An important corollary to this is that it’s not desirable to build a piece of software that looks and feels beautiful, but internally is poorly implemented. It’ll become obvious, especially over time. The system might work after a fashion now, but inevitably most software will need to change over time. If the cost of change is high the user experience will eventually diminish, as the essential features will be difficult if not impossible to finish.

What does all this mean for web developers? We must pay the same attention to how something feels to use as we currently do to how it works. We should ask ourselves: does it move well? Do the pages and clicks that make up the feature flow just so? Is it juicy?

Is the user thinking about the task they want to perform, or how to make the system we’ve written do the task they want to perform? It’s a subtle yet crucial difference.

The last 5% we need to put into a feature will probably take us 50% of the total effort, but it’s worth it. It’s the last 5% that helps our web app rise above the sea of mediocre sites out there and be something truly great. It’s doing the last 5% that separates great developers from merely good developers. Who wants to be merely good?

User experience is everything. What can we do to put in that extra 5%, so our users can experience something wonderful?

Chris Parsons's avatar

Leancamp Report

by: Chris Parsons

Leancamp was on the 10th May, and a few Edenites including myself headed up to London to check it out.

Café area

Leancamp was an unconference: the content was almost entirely decided by the attendees themselves. The organisers chose a couple of notable speakers to get the ball rolling, but the rest was up to us.

The Blank Leancamp Schedule

Diving into the spirit of the whole thing, I ran three sessions. A brief report of each follows.

Lessons Learned Bootstrapping a Service Company

Most of the attendees were definitely in the startup arena. To this end, I did a very brief presentation on the accidentally lean startup of Eden Development (how we started the company with no cash and made it up as we went along).

There was a company post-mortem afterwards, mostly centered around how I could have done it quicker and been even leaner. Maybe next time (if there ever is one) I’ll do it better, who knows…

Technical Incubation

We spent half an hour discussing whether the concept of service companies such as Eden incubating startups was a good idea. The idea is that we could accept reduced rates in return for an equity stake.

There was a lot of animated discussion about this: many service professionals in the room were wary of equity work, having had bad experiences in the past. We agreed that in principle the concept could work, if the startup was built around a strong idea and the service company had either a controlling stake or real influence in the direction of the startup.

I’m open to ideas in this direction - ping me if you want to discuss further.

Applying Lean Principles to Coding

Rather dismayed by a lack of technical discussion, we decided to get together and have a bit of a chinwag about lean principles can be applied to coding.

Much was made of continuous improvement ideas (applied through practices like pair programming and code reviews) as well as the concept of minimizing waste (applied through YAGNI and the general allergy to Big Design Up Front).

Discussion at Leancamp

It was an excellent day, and I’m looking forward to the next one. I enjoyed the many hallway conversations I had and would love to continue them online.

Did you attend? What did you get out of the day?

(Photos by Enrique - see the rest of his photos of Leancamp here)