Category: Uncategorized

Automatic Code Formatting and Merges

…or, how to give other developers screaming nightmares in 10 seconds flat.

The next time you think to reach for the “reformat source code” button in your IDE, think twice before you press it. Automatic reformatting is a great way to turn a small merge hazard contained to a single method into a huge merge hazard affecting an entire file. Merge tools are relatively stupid: in general, they’re not aware of the syntactic structure of a source file, just the text by lines; as a result, it’s very easy to fool them into thinking a one-line change and a reformat are a conflict covering the entire file.

If you’re using automatic formatting tools, please check with the other developers on your project and make sure that your code formatter settings agree with theirs. If you can’t make that happen, then don’t reformat code unless everyone’s nobody but you is touching those files.

Please, think of the merges.

Shameless Self-Promotion: LDAP Outside the Enterprise

Last week I set up LDAP as a central authentication/identity store for the Toronto Hacklab. I thought I’d share my notes. It went well enough that I’m going to repeat the process with the Grimoire: right now each part of the site (Wordpress, WebDAV for various repositories, JIRA, and Hudson) handles its own authentication, and it’s gotten unmanageable.

Yes, there is only one user. Yes, I still think it’s worthwhile.

Annotation Processing and the Pernicious // TODO

Raise your hand if you’ve ever put a // TODO comment in your source code. Or // FIXME, // XXX, or any of the thousands of other variants programmers have been using since before there was dirt to mark places that need further work.

Now raise your hand if your compiler or build tool can tell you about them.
Read more »

Nobody Cares About Your Makefile

GNU Make is a relatively modern version of one of the oldest build tools still in regular use. Make has existed since 1977 and is still the standard tool for building native software in Unix-derived environment. The pattern Make established, based on using a directed graph to automate builds, is still in use in more recent tools.
Read more »

Merging Structural Changes

Recently, a project I’m working on set out to reinvent their build process, migrating from a mass of poorly-written Ant scripts to Maven and reorganizing their source tree in the process. The development process is based on having a branch per client, so there is a lot of ongoing development on the original layout for clients that haven’t been migrated yet. We discovered that our version control tool, Subversion, is unable to merge the changes between client branches on the old structure and the trunk on the new structure automatically.

Curiousity piqued, I cooked up a script that reproduces the problem and performs the merge from various directions to examine the results. Subversion, sadly, performed dismally: none of the merge scenarios tested retained content changes when merging structural changes to the same files.
Read more »

Image | WordPress Themes