Archive for March, 2010

The Cafe Project: Vérité Coffee

Wednesday, March 31st, 2010

Week Two of The Cafe Project: Vérité Coffee in Madrona. Vérité is also the home of Cupcake Royale, Seattle’s premier source for sugar overload. Since it’s morning, I preferred to remain healthy and opted for a muffin (although according to Jim Gaffigan, muffins are nothing more than bald cupcakes).

The coffee is the perfectly respectable Stumptown, albeit a bit on the burnt side for me. On the other hand, despite last week’s resistance to changing drinks, I decided to use regular milk in my latte rather than soy. I just may not be used to the lack of sweetness. But at least I’m not as much a creature of habit as I think I am.

About

I like wearing different hats. Follow me on Twitter. Connect with me on Google+

The C++ Programmer Problem

Tuesday, March 30th, 2010

I’ve spent the great majority of my career writing code in C++. After using the language for 14 years, I would consider myself very fluent in the language. I might even say “expert-level,” but the trouble with being even close to an “expert” in C++ is that no one believes you.

In that way it seems C++ is somewhat unique: I don’t think that people who claim to know Python or Ruby would engender the same level of distrust.  It seems to be only C++ where if you claim you know it, you are by default treated as though you are lying. Why is this? Perhaps because C++ is something a lot of people claim to know because recruiters think it’s good. Or it could be because those who have some level of expertise in the language know just how complex it really is and by default assume you don’t? It might also be the general distrust shown in an interview setting — numbers on resumes don’t mean anything, and you are guilty of being a non-programming programmer until proven innocent.

Of course I’m not saying that I’m at the same level of Bjarne Stroustrup or Herb Sutter. There are always some language internals I have to look up, like vtable-layout in multiple inheritance or the finer points of overload resolution. I use C++ as a tool, just like any other language. That said, ever since reading  Modern C++ Design by Alexei Alexandrescu I have explored the breadth and complexity and the language quite a bit, using advanced features of the language to make writing code easier and less error-prone by finding bugs at compile-time rather than at run-time. When you understand that C++ templates are far, far more than just “containers of T,” you have taken your first step into a larger world.

But what number of developers have made it to the second peak of C++ understanding vs. those who consider themselves “experts” when they are just using C++ as “C with classes”? Hard to say, but it’s understandable that most programmers on the second peak would find it implausible that he or she is meeting someone who has made the summit as well. And so despite 14 years of experience with C++, despite having written one’s own versions of std::string and std::vector, those unlucky few of us must still explain what a virtual function is.

There should be some questions from the other side: what types of questions would only a true expert know? Here are some thoughts:

1. Write out the pointer-to-member syntax from memory.

2. Give an example of partial template specialization.

3. What does SFINAE stand for, and what does it mean?

4. Explain what is meant by “two-phase name-lookup.”

I’m sure there are others. And perhaps your expert programmer wouldn’t know these off-hand, but would at least have had experience with them.

C++ isn’t the most glamorous or “in” language these days, and whatever “coolness” it may have had in the past has been supplanted by scripting languages like Ruby and Python, as well as functional languages like Scala and Erlang. So perhaps it is the fate of those who are truly proficient in C++ to remain a scattered lot, silently practicing and honing their craft, forever to be underestimated.

About

I like wearing different hats. Follow me on Twitter. Connect with me on Google+

Android Version Pains

Thursday, March 25th, 2010

Android’s growing pains are making it difficult for the hobbyist and part-time programmer to create quality software and make it available to everyone.

If you are using an HTC Tattoo, you currently can’t find the OneBusAway app on the Android Market. This is due to the confluence of two unfortunate circumstances: the Tattoo’s screen size and the prevalence of devices still running 1.5.

The Tattoo sports a QVGA screen (240×320), so it’s smaller than the G1. In order to declare support for those small screens (and larger screens as well), an application needs be built with the Android 1.6 SDK. That’s all well and good, but as of the last statistics available, 31% of devices in the wild run Android 1.5. So moving to the 1.6 SDK means cutting off 31% of your potential users. (For this reason, OneBusAway for Android is still compiled against the 1.5 SDK.)

QVGA Emulator

Secondly, just declaring support for small screens in your app doesn’t make it usable. When the app is put on the small screen, all the UI elements are “squeezed” so they will be physically smaller than on other screens, assuming the same or similar pixel density. The stop icons and some of the text on the OneBusAway app are already small on an HVGA (320×480) screen — if they get any smaller, they may be too difficult to use. So the application developer must make sure he or she tests on this screen size, and in particular test it on this screen size using an actual device. Using an emulator can only go so far — it can’t tell you whether or not a particular icon or piece of text is too small for the average person’s finger.

If you don’t do this testing, you’ll be releasing an unusable app on the Market, and users will certainly not be afraid to rate the app poorly, even if the experience is perfect on a larger screen.

All this adds up to mean that for a developer to support both 1.5 users and QVGA users, he or she must build and maintain two separate APKs, and be sure to test it on a physical QVGA device. This may be easy for a company with money and time to do, but it presents significant impediments to the hobbyist or part-time developer.

Hopefully soon there won’t be so many 1.5 devices and developers can make 1.6 the lowest common denominator. In addition, making tools that made it easier to test on multiple screens would be fantastic. Until that happens, Android development for the hobbyist programmer is not as easy as it should be.

About

I like wearing different hats. Follow me on Twitter. Connect with me on Google+

The Cafe Project

Monday, March 22nd, 2010

My usual

Living on Capitol Hill in Seattle, one can become fairly provincial. When you live in one of the more walkable neighborhoods in Seattle and you don’t own a car, it’s all too easy to stay in your own neighborhood and not venture off into other parts of the city you’ve been living in for the past 11 years. I can also be fairly habitual, so it’s all to easy for me to keep to what I am familiar with.

The Cafe Project puts a stop to all that. Once a week, I will venture by bus or train into a different neighborhood of Seattle, and visit a new cafe, hopefully with Wi-Fi. I need an opportunity to explore and to set aside to work on additions to this blog.

Zeitgeist Coffee

Admittedly, Zeitgeist Coffee in Pioneer Square is a bit of an exception to the rule. It’s my old stomping grounds and I’ve been here frequently enough that the baristas know my drink (which is always a great feeling). I have other reasons for being here today, and it makes a decent start because it’s a good cafe: friendly staff, good coffee, with a lively atmosphere fueled by the constant stream of people looking for their morning cup. King County Metro‘s office is just across the street, and I’ve seen people carry their mugs west across 2nd Ave and carry them east filled.

To get here, the 10 dropped me off at 5th and Pine, and from there I caught the first thing that came through the downtown bus tunnel — in this case, it was the route 150.

So far it’s a decent start to my project. I’m not certain where I’m going next week, but perhaps I’ll figure that out before next Monday. I don’t know if I’ll switch drinks yet — that’s a bit too much change for the time being.

About

I like wearing different hats. Follow me on Twitter. Connect with me on Google+

Broadway & John

Friday, March 12th, 2010

Kudos to Metro to reacting quickly to replace the closed stop at Broadway & John. It would seem that there’s more afoot than a simple lack of forethought, since Metro didn’t even have a chance to notify its drivers of the closure. So however it happened, Metro did a great job in working towards a remedy.

Unfortunately, I was riding the 8 today and the driver was still telling people to call Metro’s number to put in a stop at Harvard Ave, so the drivers apparently are still the last to know.

About

I like wearing different hats. Follow me on Twitter. Connect with me on Google+