Tag Archives: coding

Is git too hard

I stumbled across “On git and cognitive load” and it got me thinking. That post led me to “Oh shit, git!?!” and that got me thinking further.

But first, a disclaimer: this is a post more about having perspective than providing answers. If I knew a better way, I’d be doing it.

The first blog argues that git is difficult to use. Further, that it was designed with the limitations of the time and that those limitations are no longer valid constraints. A decentralised system was required when poor network connections were the norm. Now we have cloud providers and ridiculous amounts of bandwidth.

The second post notes that people keep getting themselves into a bind, with some helpful tips on extricating yourself from those situations.

The fun thing to note here is the kinds of problems that we need to solve with git:

  • I missed a file from a commit
  • I put the wrong commit message
  • I put committed a change on the wrong branch
  • I need to remove a commit

To me, the fascinating thing about all of these things is that in the systems that came before git, it wasn’t possible to do any of them. Once you made a commit in Subversion, that was it. It was in the repository and immutable1.

Missed a file from a commit? Shrug

Committed something you shouldn’t have? Tough2

Also, in the late 2000s, when git was just starting to take off, an argument against switching was that the commit history was not sacrosanct; the record could be changed. Subversion’s behaviour was a feature not a bug.

In the next decade, we’ve changed mindset so much that the ability to change a commit is now expected, even when we know that it can cause problems.

Similarly, while git’s distributed nature certainly adds to its complexity, it’s both fantastically useful and not a source of its worst behaviours. I can sit on a plane with no internet access and still have most features. I can move my repo between cloud providers or host my own. When my broadband or AWS goes down, I can continue working.

Maybe rather than move to a proprietary, cloud-based source control system — which is what the author of the first piece is really advocating — we should remember what we gained when we moved last time.

Git is tricky. But rather than return to a centralised system maybe we should fix git’s user interface. Being able to fix past commits is useful, though we we should be able to do so without messing up our code or, especially, the code repository.

  1. As ever, it was always possible to hack the repo but in my experience this was frowned upon. ↩︎
  2. I do remember a time when someone committed a password. It took a lot of time and expertise to scrub it from the history. ↩︎

Giving Back

A few years ago I was very much “into” the whole open source movement. I read LWN (still do, actually). I bought a copy of The Cathedral and the Bazaar.

But one thing I never really did was contribute to open source projects. I never really had much need. They largely did what I wanted and when they didn’t, well, the modifications were too big to consider attempting in my spare time.

And now I have a couple of applications in Apple’s App Store. I get the impression that a lot of apps you see there these days are mainly collections of open source code bundled together with some glue code and some new graphics. I know it sounds bad when you phrase it like that, but I don’t mean it that way. When you’re coding to a deadline and to cost this is a perfectly valid way of doing things.

But neither Yummy nor www.cut are like that. They are almost entirely my own code. Why? Two main reasons.

The first is historical: Yummy was initially developed when the now infamous NDA was in place. Developers couldn’t share code even if they wanted to.

Secondly, I like to minimise external dependencies. The iOS platform changes fast enough as it is without having to wait for other developers to update code as well. Of course, open source means that I could fix it myself but that probably means looking at code I’m not completely familiar with and that takes time. The desire to remove third party code led me to remove AdMob in Yummy Browser and www.cut and replace with Apple’s iAd, even knowing that the fill rate was very low1.

Ultimately, however, there’s too much great code out there to avoid it altogether. The current, shipping version of Yummy has two open source components and I have just released a (tiny) third one.

First is the Facebook Connect SDK. I have not made any modifications to this.

Second is InAppSettingsKit. This some software that duplicates the Settings screen and allows them to be included within the app as well as in the Settings.app. I made some minor fixes so that it works on the iPad (independently fixed and pushed upstream) and I added a “Log in to Facebook” cell. I’m not sure how common a requirement this is likely to be, so I’ve not pushed it back to the maintainers but I have made it available in a separate branch:


Third is something that should really be included in iOS itself. Apple’s guidelines say that when your app is sent into the background it should close any menus that are open. In “iPhone Speak” these are called UIAlertView (dialog in the middle of the screen) and UIActionSheet (menu from the bottom of the screen).

In addition, the iPad had a further requirement: there should be only one menu open at any given time.

I created UIViewAutoDismiss to help:


This code is inspired by a question and answer on Stackoverflow.

  1. Early indications are that, even with the lower fill rate, income is not vastly different, and this is with only two countries active at the moment with iAds. []

My delicious.com bookmarks for November 6th through November 10th

  • News Corp to Offer Plaid Stamps! – "Giving Murdoch the benefit of the doubt, then, I’m guessing he simply doesn’t mean what he said. Perhaps he just wanted to sow a little confusion, get some publicity and maybe a concession or two from Google."
  • The night the Berlin Wall fell – "For me it was that rare occasion when a story was unqualified good news. After years watching the way communism was practised, I felt no need to mourn its collapse. Whatever came next had to be better." Twenty years since the fall of the Berlin wall.
  • OMG Ponies!!! (Aka Humanity: Epic Fail) – "The real world has failed us. It has concentrated on local simplicity, leading to global complexity. It's easy to organise a meeting if everyone is in the same time zone – but once you get different continents involved, invariably people get confused. It's easy to get writing to work uniformly left to right or uniformly right to left – but if you've got a mixture, it becomes really hard to keep track of. The diversity which makes humanity such an interesting species is the curse of computing."

My del.icio.us bookmarks for July 15th through July 16th

  • Ars Book Review: "Patent Failure" – Interesting book review about the effect of patents on an industry. Apparently cost more money than they make in anything but chemical and pharmaceuticals.
  • Lucky to be a Programmer – I don't program as much as I used to but this explains why I love to when I get the chance.
  • WordPress 2.6 – Usual drill. I've upgraded to the latest version of WordPress, the underlying software of ZX81.org.uk. If you see anything wrong please let me know!
  • 20 Amazing Facts About  Voting in the USA – Still in any doubt that computerised voting machines are a bad idea for free and fair elections?

My del.icio.us bookmarks for January 12th through January 16th

  • Apple introduces new Apple TV software, lowers hardware pricing – Now potentially more useful with the movie rentals. But where is the price drop in the UK?!
  • Dell tells customer ‘Mac is good option’ – “Now, it’s possible that the techie was referring to a 1970s rock band, or to an item of waterproof clothing. But we can’t help concluding that he was indeed talking about Apple’s operating system.”
  • Steve Jobs gets cohesive – Some cool stuff from Apple at the MacExpo. I think the Time Capsule is going to be on my shopping list when it ships next month. The movie rentals (when they get to the UK) look interesting but they really need to build their catalogue!
  • How to recognise a good programmer – Great discussion on recognising great developers. The problem would seem to be finding them! Most recruiters just pattern match on CVs which tends to favour the “career” developer.