Comparing PDF Binary Data

If you generate a PDF using iText5 twice you get different results. The creation date, modification date and ID are different. This means that it’s difficult to write a test that is repeatable. It’s also not ideal to mock out the whole PDF generation from a library that’s sole purpose is to manipulate PDF as it gives no confidence the code works.

I decided to read the PDF Reference which documents the PDF format on disk to figure out how to write a binary comparison function that ignores the differences.

Continue reading “Comparing PDF Binary Data”

Vim as a Scala IDE

I’ve been using VIM as my Scala IDE for the last year and I can report I’ve had a very positive experience with it. Below I have a short table of what IDE features I use and what plugins offer those features. Before you read that stuff however you need to align your perceptions and expectations with mine. I’ve used vim to write Python and Perl every workday for 8 years. I have put forth considerable effort to make vim work for me as a Scala IDE. It didn’t happen overnight. Python and Perl are weakly-typed. Many IDEs simply can’t offer “Jump to definition” in Perl code accurately as there’s no strict rules on where `$obj->$method` would even go without evaluating the program at runtime. My expectations for a productive environment are probably far less than those coming from IntelliJ or Visual Studio would hope for. You have been warned.

Continue reading “Vim as a Scala IDE”

Adding a “scrollmarks” feature to KDE’s Konsole

Most of them are successful but rarely see the light of day outside of my work machine. They only have to help me to be worth it. I’ve hacked Konsole in a number of ways, Bash, DWM and generally anything that gets in my way. My desktop setup is incredibly unique due to that fact that quite a lot of software I’ve compiled solely for myself now.

Continue reading “Adding a “scrollmarks” feature to KDE’s Konsole”

The Terminal with Jira Integration (A KDE Konsole Hack)

I believe the following statements:

  • I am a professional software engineer
  • I should be as efficient as possible
  • Modifying other peoples’ software is easy.

People often deride the benefit of Free and Open Source Software (FOSS) as futile with the argument that no one really reads, modifies or understands the software. I appear to be something of an exception.

Continue reading “The Terminal with Jira Integration (A KDE Konsole Hack)”

Why now is a good time to buy a NAS device

For this article I’m going to use the term Cloud and Cloud computing to mean “an awesome service” that is available from any computer and hassle free, which is super convenient. I understand why people use them. As I just said… they’re awesome. I’m going to point to two good ones. Gmail and Dropbox. Get your email or files anywhere you want. Very simple, very useful.

Continue reading “Why now is a good time to buy a NAS device”

Liberating myself from Google and others

I’m a developer, general do-it-myself IT guy and linux hacker-er. I hate the direction the Internet is taking. Free Email, as long as it can be used to profile your habits. Facebook, An intelligence agencys’ photo database and tracking system. Free photo sharing services but you don’t own the copyright. File sharing cloud services but you’re effectively locked in as you lazily upload 80GB over 10 years and can never get it out again. These things bother me as an average developer because they hinge on unnecessary sacrifices. I could host these services myself. I don’t mind paying someone else, I just wish my money were enough and they could actually be trusted. Anyway this blog post isn’t a rant about the evils of cloud computing, just a recent meandering experience I’ve had in making myself less dependent on certain services. I can do some of it myself, so I did.

Continue reading “Liberating myself from Google and others”

Making code reviews successful

Code Reviews are excellent and important. They increase the quality of the code, they help the team share ideas. They allow knowledge transfer and in some companies coding standards never evolve without them.

However, code reviews can be a little problematic at first in some companies and since they involve critical feedback the developers need to have the interpersonal communication skills to pull it off. They need to be diplomatic and tactful.

Here are my tips for pulling off good code reviews:

Continue reading “Making code reviews successful”

Agile breakdown impedance

Breakdown Impedance is the term I’ve just coined for a problem that I’ve complained about in my Agile retros. Impedance is a word most commonly known from other scenarios where, for example, the way your database implements a type isn’t the same as your programming language. Thus you have a small area of casting work to do or grey area you need to investigate. It could be the fact that your doubles can’t be as accurate as PostgreSQL’s unbounded numeric field or it could be the way that Dates in an XML file need subtle alteration before they can be safely used.

Breakdown Impedance are the pulling factors that complicate the task of breaking an Agile story in to smaller parts. It’s the blurry bit that slows the process down a little and involves everyone in the team having their own ideas. The motivators for breaking things down in Agile are..

Continue reading “Agile breakdown impedance”

Patchwork

Patchwork is the name of a program I wrote. The basic problem in the software industry is that you want software that’s really easy to read and conceptually simple yet you also want that software to be feature rich, business specific and highly optimised. Rarely can you have easy to read code and highly optimised code. Rarely can it be feature rich and yet expose the simplest abstraction of a solution.

Continue reading “Patchwork”

Why C++

I’m a year and month into a Perl job at a fantastic company and my C.V. was online waiting for C++ jobs. The company I work for is great. Great money, I’m in a great, very Agile and very positive team with high morale shared by all. I feel respected by my peers. We work well, we can deliver things we’re proud of. The company supports us Open Sourcing our software, writing Blogs and expressing ourselves creatively. I have enough responsibility, there are hack days and tech talks. We host user group meetings too. Damian Conway, a respected Perl community member and author of “Perl Best Practices” has been in to train us with regards to writing better APIs. This e-commerce company knows its development team is an important asset and we feel respected. On top of that the company has a wealth of other benefits, such as free drinks once a month, great summer and winter parties, a 50% discount on their own site, plenty of holiday, flexitime. Life is good. To the point where I question why I would leave this company. There is still plenty to learn, contribute and career paths within the company.

I’ve enjoyed working there and I even see a remarkable character ark in my own personality, losing my “small company mentality” of “pushing people to deliver” to this company’s “Be Agile, treat others well, work together in defining tasks, be patient in sharing understanding and watch them exceed the quality you’d expect to deliver”. The soft touch really works and in combination with Dale Carnegie’s book “How to win friends and influence people”, I really feel like a better person that I used to be. I’ve always been self-motivated but now my motivation is reinforced by working with equally motivated people. It takes a great company to make you a better person.

However as I shake off what I perceive to be small company mentality that all must know what I do and be as disciplined in good OO design and debugging as me (or as I perceive myself at least), I can’t get over the fact that your choice of language is important. That as different languages are suitable for different types of program, it’s also suitable for different types of programmers. Think real programming is about delivering features? Think real programming is mastering the Zen between hardware limitation and scalability? Maybe you slightly idolise the power one language gives over another, in terms of speed of development or control over memory? I do.

For some reason I’m fixated on C++. In a few days I’ll begin my first C++ job and become a “professional C++ developer” for a company who maintains a pretty old MFC application that’s been around since the 90’s. So why C++? What’s the pull and need to write it?

I think it comes down to the amount of discipline required to write it and, as a result of that discipline, how it rewards you with extremely high quality software. It compiles to really quick machine code, requiring a programmer to understand the hardware rather than to be someone who only deals in expressing business logic. I’ve always been fascinated with Operating Systems and the crucial services they provide. My post regarding my toy OS Farmix may convince you of this. I think that is the final career goal for me. To be a kernel developer.

Further to requiring you to understand the hardware it also requires you to understand data structures and algorithms and when you use those skills C++ rewards you with high quality software you can be proud of. C++11 and shared pointers actually allow your code to look like Java, where you “new” things at the top of a function and don’t concern yourself with deleting them at the end. A little bit of portability fore-thought and an eye for undefined behaviour and you write software that mitigates the need for the JVM and overtakes a language created to cure it of its own flaws. A language that provides rich enough Object Orientation that it is no further from expressing business logic than Java, Perl or Python.

A year of commercial Perl experience and two and half of professional Python experience have taught me one of the benefits of those languages, especially in terms of writing it quickly, is how people uses hashes as lightweight objects. You always seem to see it a lot. C++’s new “Initialiser List” feature makes creating hashes in C++ just as simple. You can have Python style Tuples as well, and Lambdas and Closures too, even though I’ll admit I find the syntax for those last ones are bit more complex.

I mean no disrespect to Perl what so ever. It’s a great language. It works and the company I’ve come from prove it. Forgive me if I feel the need the need to be defensive. The developers I’ve met in the Perl community are excellent too. We’re all different and my “fixation” isn’t the one true vision of the world. It’s only mine and I’d never look down on someone who doesn’t have the crazy viewpoint I can’t seem to let go of. I consider the developers I’ve met as friends and excellent at their job and I’m just following my own path. This post is not even designed to encourage people to take the same stance as me, only really to highlight in the broader sense that we’re all different and we all see the world in different ways. Maybe I’m an idiot for leaving this job and only time will tell.