Brewtarget: Hop into Beer Brewing with Open Source

811

If you’ve always wanted to brew your own beer, you’ll be glad to know there’s an app for that. Created by Philip Lee, Brewtarget is an open source application that helps home brewers create and manage beer recipes. We talk to Lee about Brewtarget’s history, its features, and its future.

Since my college days at the University of Texas, I’ve wanted to start home brewing my own beer. One of my college roommates dabbled in home brewing for a while, and now I’m friends with several members of the Lawrence Brewer’s Guild. Maybe by the time my daughter goes to college, I will have hopped into home brewing, and when I do, I’ll have a free, open source program to help me master my mixes of fermentables.

Philip Lee is an Electrical Engineering and Computer Science doctoral candidate who brews his own beer. In fact, he put his computer science chops to use in his home brews by developing Brewtarget, a free, open source application that helps brewers create and manage beer recipes. In this interview, Lee explains what happens when you mix open source programming with a passion for brewing beer.Brewtarget

Linux.com: What inspired you to write Brewtarget?

Philip Lee: Right after I got into homebrewing in 2008, I was looking for open source beer tools for Linux, and I found QBrew, but after looking at its implementation and contemplating whether to extend it or start from scratch, I decided I could do better by starting from scratch. I made some simple attempts early in 2008, but didn’t get very far, and resorted to calculating recipes by hand. I’m actually glad I did this, because after doing this for about a year, I learned all the math I would need to make a piece of software, plus some extra. The serious work started in December 2008, when I was sitting at home over the holidays – I was, and still am, a grad student – and had some free time to kill.

Linux.com: Which Linux and open source tools did you use to create Brewtarget?

Philip Lee: At the time, I had a Sony Vaio laptop loaded with Debian “Sarge” and KDE. After writing most of the underlying code in C++, I was starting to look for GUI libraries. I had never really used any GUI library in C++ before, so I tried out a number of them like GTK, FLTK, and finally Qt. I ended up with Qt, because out of all of them, it was by far the best documented and had the best tools as far as I could tell.

What I really love about Qt itself is its “meta object” system. It effectively extends C++ to include class property information that you can retrieve at run-time, like an object’s class name, what it inherits, accessor functions and so on, much like more modern languages. This allows you to do stuff like set an object’s properties and fields by name, rather than having to know the actual accessor function at compile time. Qt also has meta functions as well, which is really nice as Brewtarget becomes more complex and abstract, allowing us to execute a generic function on a generic object without having to write object-specific code.

Qt Designer is a great little drag-n-drop graphical layout tool that we use heavily to design most of our widgets and windows. It also allows you to connect GUI events, modify the basic properties, and so on in order to keep the codebase shorter and cleaner.

One of Qt’s other tools I like a lot is Qt Linguist for translation and localization. Basically, when you wrap a string literal in the code with tr(), Qt will automatically keep a list of those translatable strings and let you export them for giving to a translator. Linguist makes it pretty simple for the translator, even if s/he doesn’t know anything about coding, to open those files and send us back all the translations. I’m positive that the translations we get are really what sets Brewtarget apart from other beer software. Beer is international.

CMake is by far my favorite tool that we use, though. I have to say, qmake, which is Qt’s default project build tool, is really quite painful to work with, but I didn’t know any better for a while; however, after asking one too many questions on the KDE IRC channels, someone told me to just switch to CMake, since that’s what they use instead of qmake. Life has never been the same. Other than the fact that you can make UNIX makefiles, Visual Studio projects, and other toolchain-specific build files without any effort, it allows you to even package the output up into an NSIS installer for Windows, or a Debian or Red Hat package, or a Mac disk image, or whatever with the CPack module. Coupled with the fact that it has built-in robust tools for finding all the Qt libraries on your system, it becomes a real trifecta of a build tool.

Linux.com: I see that Brewtarget is still actively developed. Who helps you with it?

Philip Lee: We have quite a few contributors. Most of them just come to fix a particular bug or implement a specific feature and then go on to other projects. I would consider my good buddy Mik to be the “second in command,” so to speak. He is a long-term developer who always helps me out when he has time. He’s really good to bounce ideas off of, and is the one who suggested that we move off of our old in-memory database to SQLite, and we are working on finalizing that transition now for the next release.

Linux.com: Do you have any idea how many people actually use Brewtarget?

Philip Lee: I only have a vague guess at the number of users. We have about 51k downloads from the SourceForge site, and get about 60 new downloads per day, but now as the package is accepted into Debian, that won’t be an accurate number going forward.

Linux.com: If I’m interested in starting to brew my own beer at home, what will I need to know before I start using Brewtarget?

Philip Lee: First that it’s very rewarding. It’s very much like going from eating fast food to cooking better, tastier meals at home. It’s a hobby that can be a simple or complex as you want really. My favorite introduction is a book by John Palmer, available for free, at howtobrew.com. The basic things that matter in a beer are how much sugar is in it before and after fermentation — determines the sweetness and amount of alcohol; how bitter it is, to balance the sweetness; and what color it is. These are things that you can calculate from Palmer’s book, but that Brewtarget will do automatically for you.

Linux.com: What’s next for Brewtarget?

 

Philip Lee: This next release is mostly an internal clean up. The way the database was designed previously really hadn’t been changed since the my first code in 2008, and we were running into a brick wall with some of the features we wanted. After we move to SQLite, there will be quite a lot of new features like being able to search through the ingredients in the database and stuff like that. I also plan to add some water chemistry tools for people that like to alter the ions and salts to fit a particular profile.

Linux.com: Anything else you’d like to add?

Philip Lee: Maybe I’ll take this time to answer typical first questions about home brewing. Will I get Jake leg from it? No way. Can you make Bud? Yes, but why would you want to when you can make a vanilla cream ale, or a black IPA, or a cranberry wheat ale? Is it cheap? It typically costs about 60 cents for a bottle. How long does it take? About a month to go from grain to glass. Does it taste good? Extremely. Where can I ask questions? homebrewtalk.com. Where can I get supplies? midwestsupplies.com.

Beer and coding. Love it.

Linux.com: Thanks to Philip for taking time out of his busy brewing schedule for this interview.

Brewtarget is available for Linux, Mac OS X, Windows and some other UNIX-like platforms. See a video demo of Brewtarget in action on the project’s SourceForge page.