My friends at Sepia Labs have just released the version 2 of Glassboard, their app for sharing privately and securely with people you know on iOS, Android and now the web. Also it’s gorgeous. The app is free, so you should check it out. Brent has a lot more to say about it.
A Glitch or Two
This Is What Developing For Android Looks Like | TechCrunch:
Siu is nonplussed though. He’s told me in the past that thorough QA testing makes Animoca’s apps retain users better because so many other Android developers do a bad job at it. Unlike iOS users who throw up their hands in frustration, write bad reviews and just leave, Android users tend to be delighted when they find apps that work even if they have a glitch or two.
So Android users are more tolerant than iOS users of crappy apps because more apps are crappy? Sounds great.
Building a Desk
The past couple of weeks I’ve been considering the possibility of buying a new desk. The problem I’ve had is that while there’s some that I love the look of, they all come about 29″ high, which is really not ideal for typing. The ideal position when is to have your elbows at at least a 90° angle and your feet flat on the ground. Maybe someone a few inches taller (I’m 5’8) wouldn’t have this problem, but for me I either have to get a chair which puts me so high off the ground my feet dangle, put my keyboard on a tray or get a shorter desk. Up until now I’ve been using a laptop table under the desk as a keyboard stand, but it gets in the way of my feet and I’m sick of it. Since I can’t find a desk that I’m in love with which also is at the right height, I’m building my own.
The idea — which I found on a blog — is to use hairpin legs with any piece of wood you like. I ordered the legs in the 24″ height, which when paired with a 1″ top will lower my desk height by around 4″. It doesn’t sound too hard to do, and the result will hopefully be a gorgeous looking desk at exactly the right height for about $150. If my monitor sits too low I can always build a little table top stand for it the same way using 2″ legs or so.
Motivations for Decorating Instance Variables
Mark Dalyrymple on the Big Nerd Ranch Blog:
These synthesizes tell the compiler that each property should be backed by an instance variable whose name is prefixed by an underscore. The compiler names the backing instance variable after the property if you don’t provide an alternative.
OK, so why do programmers do this? Seems like it’s just extra busywork. I see two main reasons: one involves style, and one involves safety.
I’m amazed at the number of bugs I see in people’s code that’s due to not using properties consistently. Please do this.
I sort of disagree with this part though:
Some people use a trailing underscore (that’s Google’s style), and folks also prefix or suffix with “m” for “member”. It’s all fine. One nice thing about the leading underscore is that it automatically participates in Key-Value Coding.
Just use an underscore — Apple says to.
MarsEdit 3.5
MarsEdit is the final destination for almost everything I post here, and version 3.5 is a really nice update. The improved full screen mode is something I’ve wanted since Lion came out.
Going With Xcode’s Code Style Flow
If there’s one thing I’ve spent way too much time thinking about, it’s the way I format code (bracing and spacing). I know eventually I could get used to any reasonable style, so the time I spend reformatting Xcode’s generated code is useless busy work. All I really want is Apple to tell me “this is the way we want you to do it.” While Apple’s example projects don’t really have a consistent style, the code that Xcode generates for file templates and autocompletion does — the one true brace style.
So my style has evolved from something like this when I started working for myself last September:
- (void) myMethod: (id) sender
{
for( int i; i < 10; 1++ )
{
printf( @"%d", i );
}
}
To something more like Allman style:
- (void)myMethod:(id)sender
{
for (int i; i < 10; i++)
{
printf(@"%d", i);
}
}
And finally to K&R / 1TBS
- (void)myMethod:(id)sender
{
for (int i; i < 10; i++) {
printf(@"%d", i);
}
}
So braces for method and function definitions go on the next line, everything else goes on on the same line. Are there practical reasons this style is better or worse than others? I’m sure. The style I was using before going independent spaces everything out a lot, so whatever reason to like it or not, there’s a lot of reformatting that’s going to occur, so moving to the second style was mostly to avoid that.
Always putting braces on the next line didn’t always work well either though, particularly with blocks. I just couldn’t find a way to make blocks look passably decent or work with Xcode’s auto-indenting while putting their opening brace on the next line.
Xcode’s autoindenting turns what would be this:
dispatch_async(dispatch_get_main_queue(), ^{
// do something here
});
Into this:
dispatch_async(dispatch_get_main_queue(),
^{
// do something here
});
But the biggest reason for making this switch is that’s the closest thing to a supported-style Xcode has — all of the file templates lay method definitions out this way, and so does autocomplete. I’m not working against my tools anymore, I don’t need to waste time reformatting, and that becomes time I can spend getting real work done.
Prioritizing Active Transportation in the United States
I live in Portland Oregon, a place that’s often referred to as the Cycling Mecca of the United States. Indeed, it is relatively easy to get around by bike here compared to other cities I’ve lived in, but even here there seems to be a feeling by some that good enough is good enough, and it’s not. The fact that we have gotten as far as we have in Portland has more to do with the demand of the people who live here than anything else. You only need to compare pictures of bike roads in Amsterdam and compare it to a street heavily trafficked by bikes in Portland to see that. In one bikes are treated as equal and separated from cars, in the other we’re expected to take back streets, usually ride in traffic, and in all cases end up very close to cars. In the best cycling city in America, cyclists are second class citizens. Where does that put everywhere else in the country?
I do not believe there is anything inherently different about cities in the United States that mean we can’t do as good as countries in Europe — I think we lack political will. Prioritizing more motor vehicle infrastructure over cycling (and public transit) is short term thinking: we are running out of fossil fuels, we do have an obesity epidemic and we are destroying the environment. If you prioritize building infrastructure to encourage active transportation in the United States — and de-prioritize single occupant motor vehicle traffic — it helps all these things. There’s no reason to believe Americans inherently hate biking or walking — I think it’s just that only the very motivated one’s will to do it if it means riding next to cars in traffic.
What got me thinking about this was an article on the Bike Portland website about a woman who was hit by a car on her bike and could have easily died:
Indeed, I was lucky. Others, like Hank Bersani, have not been. And what is our government doing to prevent these tragedies? What has been done to protect our health and safety? A sharrow here or there, bike lanes that end randomly and traverse road debris and metal sewer grates, a few bike lights and yield signs… nothing of substance. Nothing that actually treats people, not vehicles, as a vested interest.
All of what she said is true. In the best bike city in the country we don’t have bike lanes on most major streets, and where they do exist they’re rarely — if ever — physically separated from motor vehicle traffic. How is that supposed to encourage anyone but the bravest and most confident cycles to get on a bike as a main form of transportation?
The author goes on quote a study which laid out the relative economic cost to society — through lowering costs of health care, infrastructure and road maintenance — of motor vehicle traffic vs bicycle traffic.
Bike infrastructure costs less to build and less to maintain than car infrastructure. There is a reduction in healthcare costs associated with regular cycling, and a recently reported study showed an equivalent $0.42 economic gain for every mile biked compared to a $0.20 economic loss for every mile driven. Supporting and encouraging citizens to bike is an investment that pays off, all while leaving extra funds for education and other basic services.
Who wouldn’t want to fight obesity (the Surgeon General estimates 300,000 people who die each year may be attributable to obesity), help the environment and save money that can be used elsewhere?
The article ends by calling out who’ve called building bike infrastructure frivolous, by bringing up the death of a local cyclist:
And even in these tight times, the funding is there. We just choose to do nothing. We choose to treat the loss of Hank Bersani, the devastation of his family and friends, and preventing the torment of the next family who will receive a similar solemn phone call as a “waste” of taxpayer resources.
The idea that doing things which can save lives, and also pays off economically, would be called frivolous or a waste by anyone is hard for me to get my head around.
I’m not a hippie, I’m not an environmental activist and I know that motor vehicles cannot be entirely replaced by biking and public transit. I’m a realist, and the more I think about this the more I see treating alternative forms as equal — and preferable when possible — is the kind of investment we’d all like to make, and that as a society we should make: low risk and high payout. We can do better.
A 2008 Ad From Portland Mayor Sam Adams
Sam Adams is the person who isn’t running for mayor again due to having a consensual relationship with an adult. He was nice enough to once let me hang out with him and his colleagues without knowing me when I first moved here, and has responded to me directly on Twitter before to answer questions about the city.
Watching this ad from 2008, I can’t help but feel he still represents what Portland is about, and that we’re better for having him. Sad to see him go so soon.
The Verge: “Next iPhone to Be Weirdly Proportioned”
Colin’s idea was to keep the shorter side of the iPhones screen the same, i.e. 640 pixels at 1.94 inches. With that in mind how much would the longer side need to increase so the that diagonal measurement was 4 inches. The answer, derived using simple algebraic rearrangement of Pythagorus’s theorem, 1152 pixels and 3.49 inches. That leaves the the diagonal length measuring a little over 3.99 inches, I’m sure Apple PR could round this 4.
An iPhone proportioned this way would be weirdly tall — and Apple is not known for making things that are badly proportioned. This Colin person pulled this out of his ass, and I don’t know why The Verge would bother publishing an article about it.
Boosh. Called It.
Simpsons creator explains Springfield reference:
Simpsons creator Matt Groening revealed to Smithsonian magazine which Springfield the Simpsons’ Springfield is named after.
(Via The Loop)
It was Springfield Oregon all along. Suck it every other state. Another interesting fact is that pretty much everything you know from The Simpsons is named after something in Portland — Matt Groening grew up here with his father Homer, mother Margaret, and sisters Lisa and Maggie.