Hi, my name's Bron. I'm from FastMail in Australia. I flew from Australia today, so I'll try not to fall asleep on you. I'm sorry, this isn't a story about important things like the ones before. It's from when I was working with Opera in Oslo. --- This is a little bit about telecommunications, and entropy, and a lot about lazyness. This isn't my datacentre OK - it's from the internet. We've all seen something like this. It probably works fine so long as you don't touch anything. --- It's also a story about Perl, but only because Perl is a great glue language, and I was gluing two systems together. FastMail has a great on call roster for our pager which already updates the phone number automatically. Opera wanted to hook this in to their phone number for second line support. --- So I need to update the phone number. There's an API right. And a perl module. This is going to be. Wait for it. .. --- ... a piece of cake. This is why you don't let programmers make estimates. We like to think we're pesimists, actually we're suckers. So I looked at the API. --- It's nice and simple yeah. Key, colon, value and an empty line to finish. This is just like HTTP headers or email headers. I know how to do that. I did some testing via telnet, and it worked. Great. --- Now the perl module. Here's the entire man page. How to connect, how to disconnect again, that's it. Luckily I had the source, so I could work out how to send commands. The first one was to get the current value. --- And here's the API. Check this. One response, or two responses if you get a result. I tried writing a program in perl, thinking maybe they've solved this in sendcommand or something. No. It crashed because of unparsed data on the line. Time to use the internet. --- Copy pasta! Yep, downloading code from the internet and copying and pasting it into your codebase. Of course we don't call it copying and pasting these days, we call it forking. That sounds much nicer. --- I put this slide in so the computer scientists could feel smug. We know about about forks. This is from wikipedia. But it's kind of appropriate, because concurrency is a great source of hard to find bugs. Anyway. --- So I found some code on the wiki. Here it is - see, verified to work. That's great. That's like QA really. It did work too. So let's have a look at how. --- Sendcommand twice, and the second time without an Action, so it doesn't send anything down the wire, just uses the side effect of reading a response. That's great naming, right. --- Ok. Count with me. 0, 1, 2 3 4 5 6 ... 7 If you split by line and then by colon, and index from zero, then the value is number 7. Yep. --- I left this slide up twice, to give you non-perl programmers time to JIT this into your internal bytecode or whatever. --- This code DOES work. I can copy this into my codebase and go home to my wife and kids. And it will keep working so long as they don't change the output format. I promised that I would say that I did change the code to use a hash for the result at least. --- 102% So maybe my maths is dodgy, but the world really is built on things like this. Stuff that just works somehow. Not just computers, search noncoding DNA some time. This code obviously evolved until the point that it worked, and then stopped. --- But it's not necessarily a bad thing. The thing is, stuff does work, and if it breaks it gets replaced. Our kids grow up, they replace us, and we die. This code never made it to production. Opera sold FastMail back to us, and we didn't need it any more. --- Of course no talk is complete without a rubber duck - so here's the plug. At FastMail we have a JSON connectionless API for access to email, contacts and calendaring. It works really well for us, but we'd like to share it with everyone, with an eye to eventual standardisation. --- J - it's the letter after I. jmap.io So have a look. See if it's something that would be useful for you, help us iron out the rough edges. --- And that's me done. I'm here all week. It's my first OSCON, so come and say "hi". Thank you.