poniedziałek, 14 maja 2012

33rd Degree Conference - Day 2

Okay, a long time since I wrote the first part of my 33rd degree journal and even a longer time since the conference itself. Still, I will try to write down what I learned, just to refresh my own memory.

Agile, Lean and Startups Practice & Principles to create ultimate value creation machine

by Barry O'Reilly

Starting early (not really, but I had some late night discussions with my colleagues) in the morning with a non-technical talk. I'm (unfortunately?) from the corporate world rather than from startup environment so I picked this talk to get a better understanding of how startups work (maybe one day I'll need this knowledge, who knows?). Barry started by introducing (?) waterfall, agile, lean and startup and highlighting some of the differences. He presented how the Deming cycle applies to startups and gave a handful of useful tips:
Ask: What's the smallest thing I can build that will give me a lot of feedback?
"Validate that what you're trying to build is the right thing to build.
In startup you don't have infinite time to do useless things as you might have in corporate world (oh yeah, I know something about it...).
 You need good understanding of the potential users to design a system suiting their needs  
Street surveys: help the team interact with end users to understand their motivations  
Developers don't just write code now, they have to understand their users
Get out of the building. Go to a coffee shop and talk to someone: Hey, I'm building something... 
Barry suggested doing street surveys - the very thought of it scares the s**t out of me but I guess that would be a scary & insightful exercise, as it would take me as far from my comfort zone as possible. That's how we learn after all. There's a few things to remember when doing it:
"Always ask Who? Why? How? What? and that kind of questions" 
"Ask demographic questions first to check if you're talking to the right person"
He also presented a few useful tools that can help people to understand their business (Business Model Canvas, personas, User value stream maps) and make it work better. And he stressed how important for startups is learning how are you doing (various metrics) & learning from mistakes:
Understanding what your customer wants is pure gold
Measure - data is the new oil
Don't waste your failures - don't celebrate failures but what you learned from them

I'll finish here as you can find the slideshow located here. I think that the talk, while concentrating on startups, has a lot of value for people coming from corporate world. I think that many of the patterns/tips applied to such environment would only make it better.

Micro Services - Java, the Unix Way

by James Lewis

Just noticed today - the slides are finally available! Yay!

The title of the talk intrigued me when I first saw it some time before the conference and I knew I'll participate. I think that was the best talk I've been to in the conference - maybe not the best show but I think most valuable from my point of view.
James shared with us the story of a project he participated in - they've build a huge application out of tiny, independent services (divided along the business capabilities of the system - one or more service per capability), implementing using various technologies (individual teams was free to choose whatever technology worked for them), all communicating in the same way - via HTTP.

"Micro service - small enough to fit in your head. Small enough so you can throw it away"
The services were small enough so that they could be discarded & rimplemented at any time. In fact, rewritting them would be even faster & cheaper than applying bigger modifications to them, should the need arise ("Rewrite over Maintain").

"Organize your teams around your business capabilities"
Such divide & conquer approach allowed them to share the workload among many teams, not conflicting with one another (and remember the Conway's law!). Otherwise, they wouldn't be able to meet tight deadlines they had. Additional benefit of this architecture:

  • can adjust the architecture of individual services according to the specific requirements (like huge data sets or low latency)
  • adhering to SRP (each application doing only one thing)
"If the class on the screen is bigger than by head it's too big"
  • individual services fits in one's head (simplicity!)

"Be of the web, not behind the web"
The services were talking to each other via REST APIs, using regular request-response calls and publishing ATOM-based event logs.
The services were distributes as standalone JAR files (with Unix rc.d scripts), along with their configuration. To prevent developers from seeing the similarities in the code & extracting tons of common code, they were put in different VCS roots (with some library/infrastructure code being shared as separate artifacts, maintained in a open-source-like way).
Later, James explained how such system scales (see the presentation), what tools have they used. He also stressed that the uniform interface of the services is critical and how to deal with eventual consistency in this case. He didn't manage to talk about versioning but he was asked about it after the talk and explained that they were using automated tests as contracts between the systems - as long as the tests were passing the applications could communicate with their collaborators. I find this a wonderfully simple (conceptually) way to ensure that systems can change & still work together.

The presentation was a great example how huge things can built from small parts, using well-known, open technologies, without a need to spend years to develop an internal framework that nobody will be familiar with. Additionally, I found it interesting to see the same concepts Greg Young was talking about during his DDD/CQRS training were coming out in this talk (eventual consistency, bounded contexts, simplicity!). I guess great minds think alike and those techniques are not something new, that people could be afraid to use or have troubles with understanding.

After the talk, I bought the 'REST in Practice' book that James recommended. I'm reading it right now and I see it will make me smarter, even if we're not doing REST in our projects at work.

Concurrency Without Pain in Pure Java

by Venkat Subramaniam

I arrived really late for this talk (stayed a bit longer near the TouK room to listen & talk to James Lewis after his presentation). As for every talk Venkat gave, the room was suffering from a heavy participants overflow so I wasn't really able to see/hear everything. I only saw Venkat showing how to use STM (using Refs) in Java (and Clojure, IIRC). While entertaining (as always!) this talk didn't bring much value to me. Maybe if I had participated from the beginning.

What's new in Groovy 2.0?

by Guillaume Laforge

This was one of those presentation I wasn't paying 100% of my attention to. I don't know Groovy too well so learning what's new wasn't of much use to me but what I've seen looks like a really nice language. I'm a bit surprised that Groovy developers are going in the direction of allowing Groovy code to be statically compiled - I know performance might be an issue (and it certainly is for Groovy 1.x) but that's the tradeoff you make when using a dynamic language - sacrificing performance & compiler checks for reduced development friction & more expressiveness. But anyway, I like the dot- and parentheses-less code you can write with Groovy.

And of course - attending this presentation enabled to get me a seat for the next talk:

Scala for the Intrigued

by Venkat Subramaniam

This one I was really looking for. First - you know the show will be great if Venkat is the presenter (no free seats 15 minutes before the presentation start). Second - from what I have seen so far, Scala looked like a nice language. Maybe not entirely familar, but kind of luring me to give it a try. Therefore I wanted to see what cool features of the language Venkat will show us.
First class support for XML, no primitives, implicits are only some of the goodies you get if you run away from Java language to embrace Scala. As Venkat said - Scala is Java with its flaws fixed. An expressive, low-ceremony language that doesn't need an IDE that will produce hundreds of lines of code for getters, setters etc for you:
"Java: I just declare fields and my IDE magically vomit the rest of the getters, setters and constructors"
Additionally, Scala has traits (~ mixins) - something I was often missing when hacking Java code.
Of course, the show was as good as expected and this presentation was a good ending for the second day of the presenatation (at least for me). Scala seems to be really promising and we even get support from our manager to learn Scala and use it (as a proof of concept initially) at work! Good news indeed.

czwartek, 12 kwietnia 2012

33rd Degree Conference - day 1

Thanks to my company, I was able to attend 33rd Degree conference in Kraków a few weeks ago. It was 3 days of great fun & enormous profit (my knowledge growth). Looking at the agenda I didn't suspect it will be such an awesome event.
Let me summarize the talks I attended to and maybe some insights I gained.

Twitter : From Ruby on Rails to the JVM by Raffi Krikorian

Opening keynote brought some impressive numbers about Twitter: each tweet causes emails being sent, Blackberry/iPhone/whatever pushes, resulting in 2.5E9 deliveries/day. After this introduction Raffi explained how Twitter, initially a RoR application ended up migrating some parts to the JVM. It turns out that at their scale Ruby's performance was definitely not sufficient. In their search for better performance they turned over to the JVM, but didn't pick its flagship, Java, as their language of choice. Instead, they picked Scala which felt more familiar to developers used to Ruby (they are also using Clojure in some parts!). Additionally, JVM's concurrency model was what they needed (seems that concurrency in Ruby really sucks).
However, it turns out that out-of-the-box JVM was still not perfect for the real-time, massive scale application that Twitter is. Twitter applications are running on custom JVM builds, having custom garbage collection. Ugh, that seems like challenges that would really scare an average developer. I'm glad I know how others are approaching those issues so I can keep calm if  I ever face such problems.
Next Raffi gave us a short introduction to Finagle, Twitter's framework for protocol-agnostic RPC, handling a lot of issues for developers: retries, connection management, transient error handling, load-balancing, distributed tracing, service discovery etc. Code samples looked really nice, with concise Scala syntax and all issues not directly related to the business logic hidden by the framework (which doesn't look invasive at all).
What I found interesting is that at the end Raffi stated that the fact they migrated from RoR to JVM doesn't mean that picking RoR in the first place was a mistake. With RoR you can get your application working really soon, and if you find out you need to scale to the point it's not enough you can look for alternatives. And that's the way he'd suggest startups to proceed.
I really enjoyed the talk, but felt a bit sad that I don't get to deal with such large scale problems in my work.

Complexity of Complexity by Ken Sipe

Next keynote was less technical, but interesting nonetheless. Some of the things discussed were already well known for me, such as the difference between essential and accidental complexity but Ken also offered a great number of advises really worth remembering. As he says, many things (idempotency for example) seem are hard for us to understand just because we're not familiar with them. Therefore it's hard to say that some programming language is easy and another one is hard. He stated (it was some quote IIRC) that you should pick up the most powerful language of those available and suitable for the problem at hand. Doing otherwise is a mistake. 
Ken also mentioned CAP theorem and shared some lessons learned by eBay developers such as embracing inconsistency and minimizing and controlling dependencies. He talked about the wise choices they've made - keeping the core business components highly available and the non-core only mostly available. Such trade-offs should be made to do the right thing and not waste resources on problems that you don't really have to care that much about. That's something people tend to forget or ignore and try to solve every tiny problem (ignoring the ROI).
I really liked one of the last sentences in the presentation: it's better/cheaper to develop product with good people than with cheap people.

Pointy haired bosses and pragmatic programmers: Facts and fallacies of software development by Venkat Subramaniam

I never before seen Venkat live. I have seen some of this talks online, but that was quite long ago and I didn't exactly remember what I should expect. The presentation was awesome. Venkat is a true rockstar and an awesome speaker, able to get your attention even if he doesn't say anything really new. He started with comparing software development to surfing - unpredictible, dynamic and really fun (but beware the sharks!). He offered a simple advice how to win software projects - with passionate, competent and responsible people because the thing that affects us most is the people (like Romans affecting the diameter of rocket boosters). Also we got warned of best practices (and advised to run whenever we hear those words).
Of course, as the title of the talk suggests, Venkat also went through a list of fallacies of software development:

  • More money and time will solve our problems (In fact, it turns out that projects with far deadlines and huge budgets tend to fail). I have already experienced it.
  • It gotta be good because it's from that large vendor.
  • Dynamic languages aren't safe (yeah, and Java's static type system is - riiiiiight - about as safe as a monkey using a computer)
A few memorable, fun and/or inspiring quotes from Venkat:
  • "Standardization before innovation is a bad idea"
  • "One thing you should never do is arguing with Java compiler"
  • "Don't fear to try new things, to make mistakes, to push the boundaries"
  • "A professional who doesn't learn to fail, fails to learn"
  • "Be unemotional in technical decisions, give things unbiased consideration"
Venkat finished his great show with a really good quote from Robert F. Kennedy, a quote every software professional should know (and agree with):
“Every time we turn our heads the other way when we see the law flouted, when we tolerate what we know to be wrong, when we close our eyes and ears to the corrupt because we are too busy or too frightened, when we fail to speak up and speak out, we strike a blow against freedom and decency and justice.” 
Howgh!

Build trust in your build to deployment flow by Frederic Simon

This talk was a bit disappointing for me. First, I arrived late because we wasted a lot of time waiting for our pizza in a nearby fast-food (for some unknown reasons we got reservation without lunch at the conference...). Then, the part of the presentation I've seen seemed to be an ad for Artifactory. The only thing I've learned from the talk is that Artifactory looks like a far more sophisticated tool than Nexus we're using at the company (which only seems to have a really slow search capability).

Being unsure what to do next I decided to take a look at Play framework. The presenter warned us at the very beginning that he was badly jetlagged - and that was clearly visible, but I enjoyed the presentation. Scala's (which is the language Play 2.0 is written in) syntax seemed nice again, and the way that the framework handles chunks of data looks interesting. A short demo of the Typesafe Console made me go really Wow! I guess the talk convinced me to take a look at the framework when I get some spare time (and take a look at many other, even more interesting things first).

Every rose has its thorn : Taming the automated tests beast by Wojtek Seliga

For this talk the room was overflowing with people. Wojtek is a leader in one of the Atlassian's Jira development teams and shared with us his experiences related to automated tests. Atlassian developers are serious about automated testing and Jira has an enormous tests suite, from unit tests to functional to integration tests using HtmlUnit to Selenium tests. The whole suite is about (if I'm not wrong) 13k tests that take an awful lot of time to run, slowing down development and causing fear of committing code (with distributed teams in different time zones, when a build broken by one team can prevent other teams from doing anything useful).
The presenter was very honest and clear about the mistakes they've made, such as putting all tests into a single project (actually a project per type of tests - unit/functional/etc) which makes the feedback loop extremally long. He shared a tip how to make their integration tests (going through the web UI) easier to maintain using what he called Page Objects (objects exposing actions you can take on given page but  hiding the ugly details of parsing HTML etc from the test itself).
The presentation was really awesome but it unfortunately ended with a sad accident involving a really ugly troll who came out shouting that Jira guys don't know how to write tests at all. When asked what would he do differently he yelled that we'd change the job if he were them and he left. Every time I saw him rising hand on different presentations later on I was expecting another flame but luckily it didn't happen. I regret I couldn't find traces of the troll online (though I remember his name well) - I would like to know where he works (if at all) just to be sure never to join such company ;)

Summary of day 1

If I had any doubts about coming to the conference before, they were all gone after the first day. It was a great experience and learning. I've spent the evening (up to late in the night) discussing what we've learned with my colleagues who were there with me.
(Oh, yeah, there was the beer party sponsored by ZeroTurnaround but as I don't drink beer it wasn't something I could get excited about.)

wtorek, 14 lutego 2012

Open sourcing Surveys project

In late 2010 and first half of 2011 me and a few other friends (Rafał Jamróz, Jacek Bryła and Małgorzata Popiołek) have created a small Java+Flex application for creating, filling and evaluating surveys. It was intended to be used at the local university but AFAIK was never really put into use. That's not a big deal, really, because it was an awesome opportunity to learn, away from everyday job's problems and deadlines.
We have spent a lot of time doing refactoring (my main focus was on Java tests), testing new ideas. We even got a major re-write of the user interface when it turned out that our initial concept was not really usable by the target users (on backend the changes were major but not that hard to fit into existing design).


Quite a lot of time has passed since we have finished working on it (in fact - abandoned it). From the very beginning we intended to open-source it but were not sure whether our contract will allow us to do it. In the end we were able to keep all the rights to the code (in exchange for 2 years of support period - but we don't spend a lot of time supporting the released version ;) and now the big day has come - Surveys and it's helper projects (ActionScript code generator and some commons) go available on the web - hosted on github.

Initially we did host it on a private SVN repository on Xp-dev.com . We've done all of our development using the old, good SVN but decided to migrate it to git before public release. I used a short tutorial on how to migrate a repo along with its history to git and it worked great (we've lost some of the history while still on SVN, while splitting projects, renaming svn repos etc.).

To end this short self-advertisement I would like to say thanks to my collaborators - you were great! I really liked our "stand-up" breakfasts at work and our "iteration" reviews. I had a great time working with you on that project.

P.S.Head revision might not be stable (I hope it still builds correctly!). To build Flex you might need some dependencies that are not (or maybe were not at that time) available in public Maven repos.