Øredev 2012 – Thursday Afternoon


I had a fantastic morning and the afternoon was equally as good. Here we go.

Katrina Owen – Therapeutic Refactoring

I had to leave a bag at the hotel and ended up having to jog a bit to make this session after lunch and got there just before they closed the door. Lucky for me! The topic of refactoring legacy code is one that lies close to my heart and I totally fell in love with this presentation. I’ve done a presentation of my own at Techdays earlier this year so I know how hard it is to find a good (I mean bad) code sample and then refactor it into readable, maintainable code without losing your audience.

Katrina takes a gnarly method and refactors it into beautiful code in about 30 minutes or so. The code sample is ruby code for creating a filename but the techniques she uses are just as applicable to any statically typed language. Katrina put the code up on Github along with all the steps. Here is the original file and here is what it looks like in the end with tests of course.

What makes this session amazing is just how many techniques she crams into those 30 minutes but still does it in a very relaxed way. She almost makes it look too easy. If you can learn to refactor like this then you’ll be able to take on any legacy codebase. Lovely art on the slides as well. So what are you waiting for, starting watching here.

Sandi Metz – Less, The Path To Better Design

Sandi is another Ruby programmer and someone who knows OO really well. She is the author of Practical Object Oriented Design in Ruby which I haven’t read (yet). Sandi starts by defining design as the art of arranging code. And that when writing code there is always tension between code that has to work today and change in the future. So the purpose of design is to reduce the cost of change. She goes through some possible ways to guide your code design: patterns and principles like SOLID or the Law of Demeter but concludes these are great but too broad to be of practical help at the code level.

So Sandi came up with her own way of diagnosing code which she calls TRUE:

  • Transparent (easy to see consequences of changing it)
  • Reasonable (cost should be proportional to the size of the change)
  • Usable (should be able to reuse it)
  • Exemplary (leads other to change it in the right way)

She then proceeds to go through some code samples and shows different ways to design the code and all the time applying TRUE diagnostics to check how good the solution is. Sandy gets to the core of OO programming as opposed to procedural programming. I think that I know a lot of this but mostly implicitly (I would have hard time explaining it clearly). For example, that the direction of a dependency is a choice and you should choose the direction that will cause the least changes in the future. But that you can’t know this at the start so decouple. I really liked how Sandi could analyse code and judge if it was good enough or if she needed to refactor more. That’s a skill I’d like to be better at.

Here is just some of the advice that I picked up from this session.

  • Classes are more stable when they know less.
  • You cannot avoid dependencies. Depend on things that are more stable than you.
  • You cannot know what is unstable, guard against it, don’t guess. Decouple.
  • Abstractions are more stable

It should be obvious by now that I really liked this session and that another book just got added to my reading list. You can watch the session here.

Mads Torgersen – TypeScript: JavaScript At Scale

Mads started his session with an extremely controversial statement.

“Application scale JavaScript development is hard”

I noticed on Twitter that this statement got absolutely hammered by a bunch of JS developers at the CascadiaJS conference. For me personally I’ve never built a large application in JavaScript so I can’t really judge the validity of this but the concept of converting a dynamic language into a static language seems strange.

However, Mads gave a really solid introduction to TypeScript and shows the advantages of being able to add extra tooling to aid in writing JavaScript. I’m still not totally sold but I have to admit it would be nice to be able to rename a class across several files.

I’d already taken a peek at TypeScript before but I learnt a lot at this session. For starters, TypeScript is not provably type safe. The reason for making JS static typed is for the tooling. All errors are actually warnings that are generated in Visual Studio but you can ignore them and the code will run anyway. For example, if I define a variable as a string but set it to be a number then Visual Studio will flag it as an error but won’t stop me from running the code.

To get this tooling for existing JS libraries a TS definition file has to be created that declares the mapping between JS and TS. And these will have to be hand-rolled as far as I can see. A quick googling produced these examples – AngularJS and AngularJS again. I’m seeing this as a potential problem, which version is the best version? Will these be kept up to date? Or will Microsoft take over this job?

TypeScript will work with Node. There is already a node.d.ts definition file and TypeScript has support for AMD for including other files. TypeScript is open source and on Codeplex so I will be having a look at the source code. The fact that it the typing is optional and that I can have mostly JavaScript and then just sprinkle in some TypeScript where I feel I need it was definitely a plus for me. And even if I did have some quibbles about the generated code (the whole classic class with constructor thing), for the most part it looked very clean. And I don’t think it would be too hard to debug it.

If you want to know more about TypeScript then check out the Playground which is a nice REPL that shows the automatic conversion to JavaScript. And the session is already up if you want to watch it.

Alexander Bard – The Rebels Come Out Online – What if the Internet is something much bigger than we think?

I’m not going to write too much about this and I didn’t take any notes. I just allowed myself to sit back and be entertained. This keynote generated the most discussion afterwards and a ton of memorable quotes. Highly recommended and it would be equally entertaining for non-programmers. This made me think about Twitter and my smart phone in a whole new way.

Summary of Thursday

Me and Daniel got invited to Magnus’ annual meatball dinner along with people he has got to know over the years at Øredev. Gorgeous meatballs and great fun to be able meet some of the speakers in such a relaxed setting. And then after that we went to the evening keynote with Alexander Bard and had some cracking discussions with friends. A day to remember.

Øredev 2012 – Thursday morning

Today was simply fantastic. Every session I went to was really good or brilliant and the keynotes were really good too. I really want to say thank you to my employer Active Solution and my manager Magnus for sending me to Øredev. It is very much appreciated!

Reginald Braithwaite – The Rebellion Imperative

Compared to the keynote with Jim McCarthy on Wednesday, Reginald Braithwaite was much more lowkey (in a very charming way). His first sentence was to apologize for not being a professional speaker as he is just a programmer. But he displayed a lot of natural talent and inserted loads of subtle jokes.

“I’m lisping slightly. Just imagine that there are () around everything I’m saying, it’ll work out”
– Reginald Braithwaite

Reg introduced himself as the child of two socialists and that he loves Cuba. And this led onto his vision of the dark future we live in where corporations don’t care about progress. Wealth breeds inefficiency amongst people and corporations as they have no incentive to change. In fact it’s just the opposite and they build moats to protect their interests e.g. patents.

“All those moments will lost in time, like tears in rain”
– Roy Batty, Bladerunner

is the quote Reg used to illustrate the fate of many of the great innovaters. He showed us a picture of the inventor of Visicalc, Dan Bricklin, and asked how many of us recognized him. No hands went up. Same for Jef Raskin the creator of the Mac computer.

“Your ideas will go further if you don’t demand that you go along with them”
– Reginald Braithwaite

Using ideas from the book Marketing Warfare, Reg presented the four sustainable positions for a company:
– The leader
– the rival
– the innovator/disrupter
– the 99%

The rebels are the 99%. All these startups are trying to be the disrupter but that’s really hard to do and only a handful will succeed. So if you want to be a rebel and build a successful business then go and watch Reg’s keynote!
He finishes the keynote with a dance to jitterbug music, so all in all this keynote is well worth your time.

Fred George – Micro-Service Architecture

This was the first session at Øredev this year where I felt really challenged by a new idea. I’d heard a little bit about micro services last year via Dan North but I haven’t read or heard much about it since. Fred George is a very experienced programmer (IBM and ThoughtWorks) and he used the timeline of his career to show how he evolved from using a layered architecture to micro services. The story starts with a 1 million line J2EE system with a layered architecture now in a pitiful state. Only 70% of the acceptance tests passed and not the same 70% after every run. They measured the amount of unit tests written every week and noticed that only a few programmers were writing all the tests. As an aside, weekly unit test count is really a interesting way to measure progress. The maintenance of the project had been outsourced and it was wallowing in technical debt. So how did it end up this way? Fred’s theory has four reasons for the existence of Technical Debt:

  • Laziness
  • Sloppiness
  • Inexperience
  • No power to refuse

Fred then continued along the timeline of his career through a series of shorter projects or prototypes where he started to move towards the pub/sub model of architecture. This led to Fred and his colleague, Jeff Bay coming up with the Baysian Service Principles (after Jeff Bays).

  • It’s okay to run more than one version of a service at the same time
  • You can only deploy one service at a time

These rules started to change how the team worked. They started deploying 3 times a day.

The next evolution and step in the timeline was a project where they tried out a technique that they called the Pinball Method. The project was to build a system to do batch processing of replacement parts for cars. Processing started with an empty order i.e. the pinball. The order then bounced around the system calling lots of tiny services to fill up the order object with all the information it needed. These services were around 100 lines of code each and did one thing. They did have some problems with this, it was hard to figure out where the order is and hard to understand, especially for inexperienced programmers.

They iterated this architecture more successfully after that, especially at the Forward Internet Group. This resulted in services that were small and disposable. If a change needed to be made to a service then they rewrote them instead of modifying them. The services became self-monitoring and this replaced unit testing. Real-time business monitoring replaced acceptance testing. They used JSON as the message standard for communication between service which meant that the services became language agnostic (Ruby, C++, Clojure, Node). He also mentioned that they used LinkedIn’s pub/sub system Kafka.

All this resulted in them killing off a lot of their agile practises and their technical debt pretty much disappearing. As the system consists of hundreds of small services instead of the usual layers, it is not monolithic but is still complex due having to manage the flow of all of these services. Fred mentioned that he was surprised about how large the impact of this technical change was. It changed the dynamic of the team and the company.

This session really got me thinking. It feels like there are both definite advantages and disadvantages to the micro service approach. Some businesses cannot afford to test in production in this way. The learning curve must be quite steep and would require very competent programmers. Companies like Github do something similar to this on their frontend (but not on their backend however). I’m also wondering how they solve all the potential performance problems. But I’m intrigued and I highly recommend this session. Should be up on Vimeo soon.

Denise R. Jacobs – Scalable and Modular CSS FTW!

Ivar and Daniel at work have both been talking about SMACSS as a better way to structure CSS files. I work on projects that use Twitter Bootstrap or similar grid frameworks and on legacy system with loads of horrible CSS but don’t feel that I really have control over the CSS in the same way as I do over the rest of the code. And Denise did a great introduction into not just SMACSS but also OOCSS, DRY CSS and CSS for Grown Ups. These are all style guides or rules that you can apply to your CSS architecture. Denise did a great job of making her presentation in to a fairytale with herself as a pirate that was helping to restructure the CSS foundation of a castle so that its foundations would be as beautiful as the outside. It might sound a bit strange but she pulled it off. Denise goes through the different style guides and describes both the differences and the similarities between them. This session is full of good tips to improve your CSS, things like writing better selectors, how to group them, naming conventions, layout helpers, leveraging the CSS cascade and how to modularize your CSS. These are tips that you can start applying tomorrow. And best of all, I won the SMACSS book by Jonathon Snook for being brave (or stupid) enough to answer a question from Denise at the end. I think my CSS skills are about to get dramatically better!

Morning Summary

I am going to have split this up in two parts, I just couldn’t stop myself writing about these sessions as they were so good. And the afternoon sessions were brilliant too. So lots more to come in part 2 – the afternoon.

Øredev 2012 – Wednesday

I’m a bit late getting this out (compared to last year) but it’s all good. I am sitting in the Slagthuset building where Øredev is held drinking a lovely cappuccino at the espresso bar here. It was a bit of a slow start this year and while most sessions were pretty good, it wasn’t the whirlwind start of 2011. They has a really cool meme theme here based on funny YouTube clips and I recommend watching some of them (Double Rainbows, the cat version of Grinding the Crack and Ken Lee). So here are the highlights of my first day at Øredev this year.

Iris Classon – Stupid questions and n00bs – top ten intriguing things you need to do

Iris’ session was very interesting and totally amazing for someone who’s been in the branch for less than 2 years. If I was able to travel in time and redo the start of my career, I’d definitely do it more like Iris has done. Anyway, Iris has done a series of stupid questions on her blog and some of them are really not that stupid at all (see here). The idea is to ask stupid questions that other juniors might be afraid to ask. Asking stupid questions is a great habit to cultivate, there’s nothing stupider than sitting in a meeting and not knowing what people are talking about. Iris talked about integrating junior developers into teams and what senior developers can learn from them. An example would be to copy their curiosity and lust for learning new things, something that you might have lost a bit after years of working as a programmer.

The most interesting part of this session was when Iris talked about gender equity and showed statistics that the proportion of women to men in our branch is actually decreasing. This is a fascinating topic for me. I have a 3-year old daughter and notice this stuff much more these days. Iris recommended watching Sapna Cheryan – Signaling Belonging. So I’ll be watching that over the weekend.

Pairing with Lisa Crispin

Angela Harms was supposed to do this session but had to cancel. Luckily Lisa Crispin offered to do it instead. This was a decent session with pictures of Lisas’ donkeys and a bunch of pair programming tips.

Brian Foote – Software in the Age of Sampling

This session was based around the metaphor of music which felt quite appropriate as Brian Foote is famous for his Ball Ball of Mud metaphor. Brian compared different eras and types of music with the different eras of computer programming. The Waterfall era is Frank Sinatra; first a composer wrote the music, then someone arranged and finally Sinatra sung the song. Next came the Agilists who are like the Beatles as they both wrote and played their music. Then came the Turntablists (Rap, Grandmaster Flash etc.) and they could create new music by changing the original music but without changing the source. Brian then mixed in even more metaphors (this session was chock full of them) and tied in the Mosiac browser as an example of a Turntablist project and as a Big Bucket of Glue. Mosiac was just mostly glue code, reusing code that others had already written but adding the ability to view images. And the final music metaphor was the Samplers, like electronic music, where you take small snippets and mix into your code/music and produce something original that way. Unfortunately, Brian had a bit of demo fail when doing his DJ show but a reasonable session anyway. There were a load of funny one-liners e.g. “tasteful, gourmet dumpster diving” to describe how you should work with legacy code. I know he redid it the day after to redo the DJ demo so I don’t know which version will be put up on Vimeo.

Vicent Marti – My Mom told me that git doesn’t scale

Vicent Marti works on the backend for Github (which I love by the way, in case you missed it). I reckon they have some sort of school or university at Github for making slides and practising presentation skills. Vicent (like all of them at Github) could easily find work as a stand-up comedian and his slides were so polished. I laughed the whole way through this despite it being all about the “boring” details of how they build the Github backend. Vicent started by saying the reasons to attend where either because you want to build a Github competitor or because you find this stuff interesting. He did a great job of making it interesting and now I know why the network and graph tabs in Github are slow sometimes and why Github doesn’t use the JVM (it’s too modern, they’re still focussed on using Unix tools as they’re the simplest way to do git stuff).

Alex Papadimoulis – Ugly Code: Beauty is in the Eye of the Beholder

Alex is the editor for the DailyWTF website (Worse Than Failure, apparently) and therefore has tons of ugly code to show. He started with Mumps and ended with the recommendation that if you ever have to work on Mumps code then find another job. In between all this, he should ugly code and code that could be considered ugly or not. His definition of ugly code is interesting; ugly code is code that costs more to maintain. Alex is a slick presenter and got lots of laughs out of the audience with all his samples from DailyWTF. He did give a few tips on how to improve your ugly code, the first being just don’t if you really don’t have to and his other message to us at Øredev was to stop writing clever code. So more funny than practical but well worth a watch.

Closing Keynote with Jim McCarthy

Don’t know what to say about this really. This was a real barnstorming, burn-down-the-barricades speech. Jim McCarthy has worked at Bell Labs, Borland and Microsoft and told the story of how he built the Microsoft Visual C++ team. This then morphed into his vision for the future with thousands of programmers doing great things, an era of magnificence. That we, the programmers can hack the culture of the world and that we hold the real power. He talked a lot about how important a shared vision is if you want your team to be high performing. Maybe even 10 times better than team without it. I got a bit lost at the end when he started talking about his new manifesto(maybe?) the Core Protocols (http://www.mccarthyshow.com/). His preacher style made the whole keynote a bit unsettling and I’m not sure he really managed to capture the audience. I’ll have to research this a bit more before giving an opinion.

Meeting Interesting People

I finally got to meet Kristoffer Ahl from DotnetMentor and one of the few OSS .NET devs in Sweden. He works on FluentSecurity so check that out and send him a pull request. Also met a bunch of former colleagues and had some really deep and involved discussions on programming. A visit to Øredev really triggers a lot of deep thinking that I don’t really have time for during the rest of the year. It gets me thinking a lot about the areas of learning I need to focus on and my core beliefs and values as a programmer. The discussions that triggered this were the best part of Day 1.

Øredev 2012

I’m sitting on the train on my way to Malmö and Øredev 2012. This will be my second time attending and as an interesting exercise (for me at least!) I’m going to evaluate the impact of last year’s conference on my programming life. I absolutely loved the experience but did it have a lasting effect?

JavaScript Everywhere

The first theme from last year’s Øredev that inspired me was Javascript/Node together with TDD. I’m pretty comfortable with C# and TDD even with horrible legacy code but TDDing JavaScript (especially for websites) is another kettle of fish. After Christian Johansen’s excellent session where he wrote an autocomplete plugin for jQuery with TDD, I had to buy his book and start practising myself. I’m still a total beginner but starting to improve and am already seeing the benefits. I’ve also been digging into Node and watching James Shore’s screencast series on Node and JavaScript. At work there is more and more JavaScript so I’m definitely going to keep at it and improve my JavaScript skills further.

Dan North

Dan North’s keynote and session were the two sessions that affected me the most. I think I went to Øredev last year expecting to be deluged in a wave of new technical stuff and hadn’t thought too much about the non-technical sessions. These two sessions emphasised how much I have left to learn before I can consider myself to be a really good programmer. I might be getting good in a few technical areas but it’s only a drop in the ocean of what is left to learn. The longer I work in this branch the more I notice how often the technical stuff is not the stumbling block, it’s the people stuff. Dan’s keynote reminded me of how easy it is to avoid the uncertainty of human communication and lose yourself in the more black-and-white domain of programming problems, often to the detriment of the project. The Agile Manifesto is as relevant today as when it was written and Dan made sure I won’t forget that.

The Rest

I went to loads of interesting sessions last year that I haven’t followed up and the primary reason for that is lack of time. But it was still worthwhile to have a deeper look at subjects like CoffeeScript, async in C#, agile testing practises, DDD and REST. I learnt a bit more about them and that is valuable in itself.

Expectations for 2012

So Øredev 2011 did change my programming life and I’m wondering if it is possible that I’ll be blown away again this year. There are some really interesting themes this year like refactoring (Brian Foote and Katrina Owen), NoSQL and Agile so I’m looking forward to those. Who knows what will influence me the most this time!

Last year I was too occupied with just being there to spend much energy meeting people so I’m hoping that I’ll be better at that this year. If anyone is interested in talking about Open Source in .NET or refactoring legacy code or TDD (or anything really) then please don’t hesitate to approach me.

I’m also looking forward to meeting former colleagues and people I follow on Twitter. And there might be a beer or two partaken as well. Me and the other Daniel got invited to a meatball dinner by another colleague, Magnus, from Active Solution who happens to live in Malmö, so that should be great too!

Looking forward to three exciting days!