Friday, 13 May 2016

The Next Big(int) Thing

One of our systems here uses a bigint identity column as a database primary key – because we knew when we built it, back in 2010, that we were going to end up with more than 2,147,483,647 records.

Well, that happened at 12:02 today, and a couple of systems promptly failed – because, despite the underlying database being designed to handle 2^63 records, the POCOs that were being mapped to those classes were using a regular C# int to store the record ID, and so as soon as they got an ID from the database that's bigger than Int32.MaxValue, they blew up. Thanks to the underlying DB schema already supporting 64-bit IDs, the fix was pretty simple – just change int to long in a few carefully-selected places and redeploy the applications – but it's still annoying that something we knew about, and planned for, still came back to bite us. So I started thinking – how could we stop this happening?

The problem is that, despite being a bigint column, we just accepted SQL Server's default identity setting of (1,1) – i.e. start counting at 1, and increment by 1 each time. Which means that until you hit 2-billion-and-something records, it doesn't actually make any difference - and that takes a while. In our case, it took 5 years, 8 months and 26 days. During that time we've made hundreds of changes to our code, and in a handful of those cases, we've mapped that bigint ID onto a regular C# Int32 – and so inadvertently planted a little time-bomb in our production code. Tick, tick, tick…

So here's a nice neat solution, that I wish I'd thought of five years ago. Anytime you create a bigint identity, seed it with (2147483648, 1) – so that right from day one, it's already too big to fit in an Int32. Any system that tries to store an ID in a regular int variable will fail immediately, not in five years when someone creates that magic 2.14-billion-and-somethingth record. Even though you've effectively thrown away 2^32 possible values, you have another (2^64 - 2^32) values to play with, so you've lost a tiny, tiny fraction of the available keyspace in exchange for immediate feedback if any of your client apps can't cope with 64-bit ID values.

Thursday, 5 May 2016

We're Gonna Build a Framework!

 

Check it out! I made a thing. A musical thing. Well, Billy Joel made the musical thing (which is copyright © 1989 Columbia Records, btw) and I wrote and recorded a new set of lyrics for it, all about software frameworks and how lovely it is to have so many to choose from.

And, for anyone who doesn't believe that every single one of those really is a software development framework, here's the Googlified lyrics.

Handlebars, Hibernate, Solar, Activate,
Phalcon, Flask and Silverstripe and TYPO3 Flow,
Agavi, Pixie, Hazaar MVC,
CodeIgniter, Lithium and PRADO.

Raphael, Bobo, Bottle and Tornado,
Django, CherryPy and WSGI
Glashammer, WebSphere, RedBean, TurboGears,
Albatross, Aquarium, Selenium, web.py

CHORUS:

We’re gonna build a framework,
‘cos we wanna use one, but don’t wanna choose one,
We’re gonna build a framework,
we didn’t like the others, so we’ll write another…

SiteCore, Tapestry, Maverick and JSP,
Barracuda, Ay Caramba, Groovy on Grails,
Intercal on Interstates, Cascade, NHibernate,
JDBC, Ruby on Rails
Jasmine, Doctrine, Java Forms Engine,
Active Record, D3, Dapper and Velocity,
Thymeleaf, TopLink, Pyramid, Rethync,
Aura, Rico, Midori and Mojito,

Sitemesh, Cymbeline, Enterprise Java Beans,
Hug, Grok, Boost, Click, anything by Telerik,
Rango, Dojo, LLBLGen Pro,
Carbonado, Seaside, Pylons and Pyroxide

Fusebox, Flight, Flex, ServiceStack, Silex,
Carbon, Cocoa, Ample and Giotto,
Banshee, Symfony, Laravel, Fat Free,
Mocha, Pecker, Hobo, Cuba and Rialto

OpenRasta, Nancy, ASP net MVC,
Kendo, Zend, ODBC and Tempo,
Java Server Faces, Entity Spaces,
Cappuccino, SpecFlow, Polymer, JDO,
Google Web Toolkit, no need to learn Javascript,
JDK, code away, what else do I have to say?

Prototype, Boilerplate, jQuery, animate,
Mustache, Wijmo, Ionic and Allegro,
Bootstrap, Backbone, running on an iPhone;
Mobile apps, going live, built in HTML5
Angular, Scriptaculous, react, redux,
Knockout, ember, does anyone remember,
It’s just like in the browser wars,
IExplore and Netscape 4,
lodash vs underscore,
and I can’t take it any more!

(yes, I know ODBC and JDBC aren't strictly speaking frameworks.)

(yes, I also know the recorded version uses Tempo twice. Relax. It's OK.)

London.NET User Group – A Progressive.NET Special!

This July, the Progressive.NET Tutorials returns to SkillsMatter – for the eighth year running, we’re bringing together some of the best speakers and experts in the .NET community for three days of in-depth workshops and hands-on tutorials. The team at SkillsMatter are working hard to finalize what promises to be a great programme, covering all the latest platforms, patterns and ideas in the world of .NET development.

To coincide with this, we’re running a special London.NET User Group meetup at SkillsMatter the night before the conference – Tuesday 21st June.

imageWe’re going to be hosting a series of short talks and demos, around a theme of “zero footprint” development tools. Over the years, we’ve had a lot of really excellent talks covering languages, platforms, patterns, architectural styles – but quite often, we’ll be in the pub afterwards chatting about the talk we’ve just seen, and you’ll hear people saying “it looks really great; maybe I can try it out on my next project” or “I love the idea but I can’t see the rest of the team going for it.”

So, for our Progressive.NET special, we want to showcase the very best tools, utilities and ideas that you can start using right away – they won’t modify your code, they won’t break your build pipeline, they won’t interfere with what the rest of your team are doing, but they might make your day just a little bit more pleasant – and we want your help!

Come along and give us a 10-minute demo of something you think is awesome. Maybe it’s an open source tool, maybe it’s one of your company’s products, maybe it’s just something you use daily and can’t live without – but remember: zero footprint. Don’t break the build, don’t don’t move the cheese.

In the spirit of things like Scott Hanselman’s 2014 Ultimate Developer and Power Users Tool List, we’re looking for talks about:

Whether you’re a first-timer speaker or a fulltime product evangelist, we’d love to have you on board, so have a think, get in touch – by email or find us @LondonDotNet on Twitter - and get involved!

Wednesday, 27 April 2016

Hintjens

I’m at BuildStuff Vilnius, in November 2015. It’s Thursday night. Mark Rendle and I are doing our comedy panel game quiz thing. We found out about ten minutes ago that we’re doing our show in a nightclub, with no wi-fi, hardly any microphones and… basically it’s a bit of a train crash. And we’re hustling for volunteers to help us make the train crash funny. Between Mark’s friends and mine, we rope in half-a-dozen people. One of them is this weird tall Belgian guy. He’s good; they’re all good. He gets it. He’s funny and engaging and genuinely interesting. We somehow walk away with our collective dignity intact, and people even tell us afterwards that they loved it. Mark and I swear to each other we’re never doing that particular show in a nightclub ever again.

We’re still in Vilnius, it’s Saturday, and I’ve had the day off. I’ve been sightseeing. I’m tired and hungry, and I don’t want to just head back to the hotel, so I find a café with wi-fi, I look up Vilnius on MetalTravelGuide.com, and I find this bar – Bix Baras. I go in, I chat to the staff. Their English, like their beer, is excellent; my Lithuanan barely covers “hello” and “thank you” – but I eat lunch and have a few beers, and then head back to the hotel. When I get there, the tall Belgian guy from the quiz is playing the piano – one of those wonderful grand pianos that adorn hotel bars the world over without anyone ever really playing them. I ask if I can join him; he moves over, I sit down, we play for a while – he’s doing most of the work, I’m just bouncing along on the white notes, picking out pentatonic minor melodies that fit with what he’s doing. It’s fun. It’s nice, and it feels somehow conspiratorial – for starters, we’re playing one of those pianos that you probably walk past every day of your life and assume that it’s for Other People to play, and not for you, and yet here we are.

I go upstairs, change my shirt, ask Seb if he fancies heading downtown for a beer. We need a night off from the whole conference crowd, but on a whim I ask the Belgian guy on the piano if he wants to join us. He says yes, and introduces himself as Pieter. We’ve officially met. We jump in a cab and head downtown.

Bix Baras has good beer, and great snacks, and we talk – myself and Seb and Pieter. We drink, we eat hard cheese and pigs’ ears and Lithuanian dark bread. And it’s remarkable, because there’s no small talk. We talk about ideas, and we share experiences. The conversation is disarmingly easy. I’m not used to this. Most people at conferences talk about tech – about .NET or NodeJS or Docker. We talk about life. We talk about what we do, and why we care. We talk about friendship, and failed relationships, and psychopaths, and adventures. We walk up the road to the pool hall where some of the other BuildStuff gang are having drinks. Pieter and I get talking about speaking. Within the hour, he’s challenged pretty much every idea I’ve ever had about speaking and giving talks, but it doesn’t feel adversarial – there’s something genuinely inspirational about it. We finish our drinks and wander back to the hotel, but the conversation resonates.

Sunday, we fly to Kyiv – a whole crowd of us. I’m walking next to Pieter on the tarmac as we head out to our plane, and he’s talking about how much he’s enjoying the experience – “For the first time ever I feel like I’m on the road with my gang” – and I know exactly what he means. The sense of camaraderie is wonderful – 30-odd hardcore geeks heading out to Ukraine together – yet it somehow didn’t really click until Pieter pointed it out.

In Kyiv, we hang out. We chat. We talk about code, about community, about psychology. I watch his talk about building open source communities. From where I’m sitting, he appears to give a 50-minute talk with no notes and no slides, and solve a Rubik’s cube while he’s doing it. He confides in me afterwards that the cube was a bit of a stunt – shuffle it a couple of turns, memorise them, play them backwards on stage – but that almost doesn’t matter; the talk is brilliant, the audience are involved and engaged, and I’m sat there wondering how much of my life I’ve spent making Powerpoint slides, and why…

Eventually, Pieter turns our conversation in that bar in Vilnius into a blog post – Ten Steps to Better Public Speaking – which is simultaneously gratifying and terrifying. Gratifying that he thinks our conversation is interesting enough to warrant an entire blog post. Terrifying, because when you’re name-checked in a post like that, the only thing you can really do is rise to the challenge, and that means I’m gonna need to REALLY work hard on… well, on every talk I ever give again.

Months pass. I think often of our conversation in that pool hall in Vilnius and the blog post that followed. One day, I email Pieter – “Hey, remember that chat in Vilnius? Do you fancy doing a joint talk at NDC Oslo?” He says yes, I write something up, I send it over, and start worrying about the fact I’ll be sharing a stage with the great Pieter Hintjens – and about the fact I’ve signed up to give a talk that’s gonna drag me out of my comfort zone in almost every way.

By chance, I’m in Brussels in March, en route to a long weekend in Leuven with my girlfriend. I email Pieter, we arrange to meet for lunch: we talk about ideas. He’s riffing on ideas – about opening an office in Brussels for people who need a place to hack; about using mesh networking to build “smart chairs” that tell the pavement café when they need replacing; about speaking and software and people and life. He talks about his father, about euthanasia, about family. We talk briefly about our joint talk and NDC, but not too much; after all, too much rehearsal would undermine the vulnerability. And we part with a hug, and a promise to see each other in Oslo.

I watch Pieter and @jesslynnrose joking on Twitter about gender-swapped TV shows. Pieter posts this: prescient, or just meditative? Then on March 26th, following a whole lot of the kind of fallout that just doesn’t fit into 140 characters, Pieter announces he’s leaving Twitter. I’m sad to see him go, but have no doubt I’ll have many more evenings hanging out and having my preconceptions challenged by this remarkable individual.

Then I get an email. The subject just says “NDC” It reads:

“Hi Dylan,

Seems my cancer has come back... still waiting for detailed prognosis and next steps. Looks pretty bad atm. In any case, no travel for me for the next months.

You're going to have to do the talk by yourself. Stick to the ten rules, watch my Serbian video a couple of times and you'll do fine. :)

Sorry about this.”

I don’t care about the talk. I’m worried about my friend – this sounds bad. I email him back. He replies. Time passes. He rejoins Twitter, because it’s a good way to connect with a lot of people who want to know what’s going on. And then he posts this:

We will try chemotherapy. It's palliative, there is no cure for this. So, time to start saying goodbye.

And then he posts “A Protocol for Dying”, and it’s pretty clear that this is it. One way or another, it won’t be long before Pieter’s not around any more. And people start talking, and posting, and tweeting… and before long, a common thread emerges. It seems you really didn’t need to spend very much time with Pieter for him to leave a lasting impression.

I spent five days with Pieter late last year, and had lunch with him once, a few months ago. I’ve never visited his house, never met his family, never collaborated with him – but the time I’ve spent with him and the conversations we’ve shared have been some of the most profoundly challenging and inspiring interactions I’ve had in a very long time. And it’s not just me. There are countless comments on Pieter’s most recent blog posts from people who met him once or twice – or not at all, in the case of the people who know Pieter through email and through his code – but whom nevertheless believe that knowing him has had a profound impact on their life.

I was in a restaurant earlier tonight, with my girlfriend, Clare, and some of my cow-orkers. We ended up talking about Pieter. Clare met Pieter briefly, for about five minutes, in Bruxelles-Midi railway station back in March. At the time, Clare was feeling completely freaked out at being in an unfamiliar country where she didn’t speak the language or know how things worked, and my meeting up with this weird guy who “looked really stern” didn’t help at all. Pieter warned us (a pair of hardcore Londoners) about the risks and dangers of hanging out in the station, and then helped Clare find her train to Leuven.

When I got that first email from Pieter, I told Clare. When I saw his Twitter post, and when he posted “A Protocol for Dying”, I told Clare – and she’d already read it. And then she said to me tonight “I want to email Pieter. I don’t know him, but I know what’s happening, and I just want him to know that I’ll remember him next time – probably every time? – that I go through Brussels, and I hope one day I’ll be a bit more badass – just like he is.”

So here’s to Pieter, and here’s hoping that long after he’s stopped coding and tweeting and blogging, he’ll still be inspiring all of us to open up, to embrace our vulnerability and “to be a bit more badass”.

Tuesday, 19 April 2016

Coming Soon To A City Near You…

Following on from "The Rest of REST" talk that I've given at several conferences over the last year, I'll be talking about real-world REST at several user groups over the next few months. In this talk, I'll be exploring some REST architectural patterns in more depth, and doing some hands-on demos showing how you can implement these patterns in your own applications.

For this demo, I'll be using NancyFX and the HAL+JSON hypermedia language – there's a beautiful synergy between the dynamic type model in C#, the dynamic model used in NancyFX and the way HAL exploits the dynamic features of JavaScript to extend JSON into a powerful hypermedia format, and I'll be showing how you can wire all these bits together to build flexible, RESTful HTTP APIs.

May 9th I'll be at Smart Devs User Group in Hereford.

May 18th I'll be at The Dev Bakery in Altrincham.

May 26th, I'll be at the Copenhagen .NET User Group in Denmark – and many thanks to the team over at Siteimprove for hosting and sponsoring the event.

Web Governance Tools | Siteimprove

As always - if your user group would be interested in a session on this or one of my of other talks, get in touch!

I'll also be appearing at these conferences throughout 2016:

8/9/10 June I’ll be at NDC { Oslo } in Norway, and I’ll be sticking around for PubConf at NDC { Oslo } on 11th June – the PubConf event in London here in January was an absolute blast, so if you’re going to be in Oslo for NDC, book yourself a hotel for the weekend, see some of the city, and come to PubConf.

22-24 June I’ll be at the Progressive.NET Tutorials at SkillsMatter here in London, running a deep-dive hands-on workshop which will probably be on async/await and asynchronous programming in C# – watch this space for further announcements as we finalise the programme.

8-9 July I’ll be at BuildStuff Odessa – following the successful and hugely enjoyable BuildStuff conference in Kyiv last year, I’m really excited to be going back to Ukraine for a weekend of code, games and sunshine by the sea.

13-15 July I’ll be at FullStack 2016 in London, the conference on “JavaScript, NodeJS and the Internet of Things” – I’ve been helping the team at SkillsMatter finalise the programme for this one, we’ve got some absolutely excellent speakers and sessions lined up, and it promises to be a great event.

3/4/5 August I’m going to be at NDC { Sydney }, joining an amazing programme of speakers to bring the NDC experience to the southern hemisphere.

See you on the road!

National Flag of Denmark  Norwegian Flag Image of National Flag Flag of the United Kingdom  Australian Flag

Friday, 15 April 2016

The Axosoft GitKraken Songwriting Battle!

A few weeks ago, I stumbled across GitKraken – a cross-platform GUI for Git that looks, well, lovely. ‘Cos git is a wonderful, amazing, powerful system, but it’s about time somebody added a little, well, beauty around the place.

image

So I’m using GitKraken daily now, and loving it, and then I find out that they’re having a contest. A song-writing contest. About revision control systems. Now, I love music. I play instruments. I write songs. I write parody songs about tech stuff. There is absolutely no way I can see a songwriting contest about revision control and not enter it… so I did. And here’s my entry. A completely original song, written and recorded for the contest, and called, simply, Git Kraken.

Friday, 8 April 2016

Exupérianism: Improving Things by Removing Things

Last night this popped up on Twitter:

Last year, as part of migrating our main web stack to AWS, we created a set of conventions for things like connection strings and API endpoint addresses across our various environments, and then updated all of our legacy systems to use these conventions instead of fragile per-environment configuration. This meant deleting quite a lot of code, and reviewing pull requests with a lot more red lines than green lines in them – I once reviewed a PR which removed 600 lines of code across fifteen different files, and added nothing. No new files, no new lines - no green at all – and yet that change made one of our most complicated applications completely environment-agnostic. It was absolutely delightful.

When I saw John's tweet, what instantly came to mind was a quote from Antoine de Saint-Exupéry:

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away."

So how about we adopt the term "Exupérian" for any change which improves something by making it smaller or simpler? The commit that removes 600 lines of unnecessary configuration. The copy-edit that turns fifteen thousand words of unstructured waffle into ten thousand words of focused, elegant writing. Maybe even that one weekend you spent going through all the clutter in your garage and finally getting rid of your unwanted lamps and old VHS tapes.

Saint-Exupéry was talking about designing aircraft, but I think the principle is equally applicable to software, to writing, to music, to architecture – in fact, to just about any creative process. I was submitting papers to a couple of conferences last week, and discovered that Øredev has a 1,000-character limit for session descriptions. Turns out my session descriptions all end up around 2,000-3,000 characters, and editing those down to 1,000 characters is really hard. But - it made them better. You look at every single word, you think 'does it still work if I remove this?', and it's surprising how often the answer is 'yes'.

Go on, give it a try. Do something #exuperian today. Edit that email before you send it. Remove those two classes that you're sure aren't used any more but you're scared to delete in case they break something. Throw out the dead batteries and expired coupons from your desk drawer. Remove a pointless feature nobody really wants.

Maybe you even have an EU cookie banner you can get rid of? :)