iPhone Tech Talks: Part 1 - Overview

Last Wednesday, I went to a one-day session in Chicago titled iPhone Tech Talks. I am currently taking the Cocoa Academy course, and thought that this would be a nice way to get some additional information. The conference had probably about 400 people or so. I was a bit worried because I have neither an iPhone nor a Mac, so I thought that I might have been out-teched. :) However, it seemed like most people did not bring their laptops, and some of the people that I talked to had as much or less experience developing for Apple platforms.

I took like fourteen pages of notes, so I will probably break it up into a few posts. This one, which gives an overview, one about usability (I was writing the entire hour and a quarter session) and one about performance and using different libraries.

What’s in it for you?

Hmm… Well, maybe you are doing or planning on doing some kind of iPhone development. That would be nice.

But I was talking with someone who has the G1, and the features are pretty much the same aside from native multi-touch, so most of the design principles and considerations will be present there. Indeed, any mobile device has at least some of the constraints that you need to think about when creating an iPhone app: usability, market reach, battery life, screen real estate, interrupts, performance, and more.

I would say that this was my first foray into mobile development, so it was definitely an eye-opener. If you have developed for a mobile platform before, then some of these comments will be old hat, but there still might be some gems in there.

Overview

The session lineup can be seen here. I figured that I had a moderate understanding of Room A or could read about it online, so opted to stick in Room B because the C room sessions just didn’t really seem all that interesting. You could mix and match, but conveniently the ones that I wanted were in the same room. I did sit in on the “Using Advanced Web Technologies on iPhone” session, but it was after lunch and not that interesting, so I ended up just going to the other room after about forty-five minutes. It was a lot more engaging. It’s interesting making decisions with very little information on what the actual session will be about. I’d be interested to hear if anyone else has rules of thumb for figuring out which sessions are going to be useful, or what kinds to avoid.

So everyone went to the general overview session at the beginning of the day. They started out with some “get pumped” videos with the standard Apple music, showing off some popular apps like MLB.com and Urbanspoon. Then they gave a business update. The iPhone platform is very vibrant, with four million iPhones purchased in the first 200 days, 13 million to date (not counting iPod Touch), and over 200 million App Store downloads in only 104 days. These are impressive numbers that seem to imply that if you create a good app, you won’t have trouble getting it into people’s hands. The iPod Touch mentioned earlier is significant because it also runs App Store apps and has the same features (even screen dimensions), save for things like phone capability. So that’s another thing to consider.

Next they gave an overview of ingredients for success with an iPhone project. If you have a product in mind, it’s recommended that everyone who will be giving input has at least some working experience with using the iPhone. This makes sense, because there are some pitfalls if you don’t consider what you have to work with. There is no mouse, so there are no rollovers or scrollbars. The metaphor of clicking doesn’t apply because you are actually tapping on the screen. The mouse offers continuous input, while the finger is discrete. The interface is quite a bit different because of user expectations and use conditions. Text input is accomplished with a soft keyboard rather than the traditional one. The iPhone only runs one app at a time.

These are things that are clear if you use the iPhone on a regular basis, but imagine working with people that have never used it before. There would some difference in ideas that would not be easy to overcome.

Also, you want your app to feel like it fits the iPhone, so you need to consider things that are already built-in: microphone, camera, location awareness, ubiquitous internet access.

Typically you should envision that your user will be using the iPhone under a table in a poorly lit room at about arm’s length. This severely alters your approach to designing the user interface and visual elements. The screen needs to have high contrast. There was a discussion about whether white text on a black background was better than black text on a white background. The thought was that you should consider where your user will typically use the app, and go from there. If they would typically use your app in a poorly-lit environment, then you should make it white on black. Conversely, if your app is only used out in daylight, consider using black text on a white background for better contrast with the environment.

As a programmer, you need to handle interrupts gracefully. Because the iPhone is a phone, you should expect it to ring at any time, and should test the behavior frequently. You need to save the state of your app somewhere, cut out your audio, pause the game, and so forth. When the phone call or other interrupt is done, you should also resume in an orderly fashion. Just unpausing the game when the phone call is over will lead to your user being unhappy.

Attributes of a successful iPhone app

Your app should be delightful. This means that it is inviting, intuitive, engaging, exciting, and enabling. It should be a pleasure to use, and is something you would consider remarkable. If your users are to remark positively to others, it must be remarkable.

Your app should be innovative. It should be revolutionary, inspirational, or fresh. This doesn’t mean that you have to create something new, just do it better than what is out there in some way.

Your app should be designed. This takes support from all levels of your organization, and works best with small teams.

Your app should be integrated with the iPhone’s many rich features. One of the strengths of the platform is connecting to other services, so your app should probably be connected.

Your app should be optimized for performance. They made a suggestion that you automate performance tests so that when code is checked in, the performance tests automatically run. If the test fails, the build should break so that the offending code can be cleaned up for better speed. This was a nice idea, and I had not heard it before. But with the importance of performance, it’s almost as important to get it fast as it is to get it right. So this matches up well with continuous integration. Consider it ‘continuous performance.’

Other miscellanea

Over lunch and between the rapid-fire sessions, I actually ran into many people that either had ties to Indianapolis, or actually worked or lived there. So that was pretty exciting. I figured that I would be the only one. There were others from Bloomington, etc.

I enjoyed the tech talks, although I didn’t really enjoy the driving in Chicago. :) It’s quite different beast from Indy. There are like horses and bikers and pedestrians and crazy taxis all over the place.

They gave out a free shirt that had some interesting packaging, which you can see here.

You can see the next part of this series here.

Review: Bull Moves in Bear Markets

Title: The Little Book of Bull Moves in Bear Markets: How to Keep Your Portfolio Up When the Market Is Down Author: Peter D. Schiff Published: 2008 Length: 263 pages

Overview

With the current state of the financial system, I was looking for a book to make sense of it all. I had been reading about the decline of the dollar, the poor state of the financial sector, and the huge deficit the United States is running, and thinking that there were still some people out there who thought that things were going to get better in the very near future. Although I don’t have all that much in long-term savings yet, I was wondering how to keep what I had in there and what markets might be nice to invest in given the current state of the US economy. In the introduction, Schiff states: “The goal [of this book] is to help you preserve and enhance wealth that can be reinvested in America after fundamental economic reform takes place.”

Context

The book was written in early to mid-2008 after Schiff’s book Crash Proof. That book accurately predicted what happened in the last year or so, even though various pundits scoffed at his work. I was excited to read something that contained timely information. One thing that Schiff did not talk about was a potential government bailout plan, although that is probably a subtext with inflation and other government manipulation. He does talk about the 2008 elections and how they might influence policy, and plugs Ron Paul because of his Austrian economic roots and the desire to return the gold standard. He correctly observed that the “smart money” was on Obama, and he indeed won.

Some of the ideas that Schiff presents are quite far out of the mainstream, but contrarian views seem like a good bet when no one else seems to be getting it right. He consistently paints a pessimistic view of the economy, but as he points out in the book, there are numerous entities that benefit from making the system appear rosier than it actually is.

Major Points

Schiff recommends adjusting your current portfolio first by getting out of things backed by the dollar (cash and bonds) and staying out of US stocks for the next three to five years. One reason is that the market is weak and you are not getting much return after real inflation. He then talks about investing abroad in emerging countries and growing markets, and especially in commodities since they will keep value and possibly rise with the effects of strong growing economies in Brazil, Russia, India, and China. He also discusses finding a job that is stable, and states that all service-based jobs will likely suffer since people will have less money to pay for the services. He even makes the claim that health care costs will go up so much that people in the health care industry will see cutbacks. This was a significant thing that I did not expect. He also mentions emigrating to save money and avoid possible political turmoil, which seems like a bit of a stretch. But while reading the book, it seemed like a reasonable consideration based on what he was saying. If you do, Mandarin might be a helpful language to learn. Schiff also advocates investing in gold and silver.

Biases

I especially enjoyed Schiff’s discussion of the biases present in the various institutions that are associated with the economy. Wall Street has an incentive to make it seem like the market is doing well or has bottomed out so that people keep investing so that they get a share of their money. So they encourage people to invest even when they should not encourage them. A mutual fund manager’s priority is to maximize quarterly profits, but this is not the same as maximizing long-term profits.

One of the major points that Schiff hits on is the fact that the US government will likely erode the purchasing power of the dollar further by creating inflation. This seems all the more apparent after seeing the bailout plan, which is essentially an attempt to inject money directly into the financial system through the banks, and support them in other ways financially. This is in direct contrast to the relief checks that Americans got earlier in the year to attempt to increase consumer spending to give more liquidity to the system. Since the dollar is no longer linked to gold, the government can do this transparently. It is basically a tax on everyone that is not well understood, so they can get away with it with less political backlash.

The government has incentive to create inflation for political reasons (stimulate economy, prevent normal, but unpopular, downturns), and also for financial reasons. Government debt becomes more manageable when using inflationary dollars, you can force people into higher tax brackets, and you can finance entitlement programs without resorting to tax hikes. I liked that Schiff talked about how the government tries to focus discussion on taxes instead of inflation. “By focusing attention on a red herring, the government is deliberately diverting attention away from the real rate of inflation and its role in creating it.” The government has this power because they directly influence the money supply through the Federal Reserve.

The government also misrepresents inflation by using bogus indexes to make it appear that inflation is lower than it really is. Plus, the GDP itself is a pretty shaky figure. For example, the GDP goes up when a building is destroyed and then rebuilt, even though there was not a net value gain. It just represents spending. Schiff states: “Uncle Sam is using GDP growth as evidence that a weak, dangerously overextended economy is strong, healthy, and growing, and that Americans should therefore keep spending.”

So what’s Schiff’s bias? For one thing, he’s owns an investment bank that specializes in foreign investments and emerging markets. One thing that I saw that was interesting in his Wikipedia article is that his father has served many years in prison for being a tax protester. This might lead to some of his negative views on government.

Experts Only

There were many strategies presented in the book that I have neither the time, attention, money, or knowledge to perform. I could have safely skipped various parts of the book. Schiff even points out that managing certain assets is a little like day-trading. You can get rich, but it takes a lot of time to pick winners, and the downsides are also large at times.

Worst-case Scenario

Toward the end of the book, Schiff paints a rather apocalyptic picture of how the standard of living in the United States is going to go down. He recommends stockpiling goods before inflation gets worse so that you can barter with goods or at least consume them at less cost. Consider a package of cigarettes that goes from $3 to $4. If you purchase it and then consume it, you saved quite a bit of money. This would be a better rate of return than you would get with most investments.

Accuracy

One assumption that seems to be inaccurate (at least in the short term at the time of writing) is oil prices rising through the roof.

I will say that I disagree with Schiff on some points, and don’t fully understand others. But overall, I felt that he made a compelling case, and based on the information that I have, much of it seems to be pretty smart. At the least you can say that he is a realist, which should go far in a post-bubble economy. There was a lot of history, and for that alone this book was an informative read. I liked reading this book, but it’s not for everyone. You definitely need to have a filter on when reading, and there are some parts that aren’t really that relevant to the average investor.

Some further notes I took are available here.

Vim Word Processing

I’ve been using Vim for about a year now, and am pretty much addicted. Once I reached a certain level of proficiency, no other editor seems to be even close. The keys are very intuitive to me now, as is modal editing.

Of course, there is a problem when I have to type in other programs. For example, in OpenOffice, I routinely hit j a few times, and am surprised when that letter actually pops into the screen instead of moving the cursor around.

To overcome this, I’ve been messing around with ways to make Vim more friendly to general writing. Here’s what I’ve done or found:

Autocorrect

This section outlines my major actual contribution. The rest are just tips. Autocorrect is a key feature of almost any word processing program, and it’s tough to do by default in vim. When you type ‘teh’ and then have to go back and fix it, you are much less efficient. Vim has the concept of abbreviations, where you can map one word to another.

Example:

iabbrev teh the

Then you when you type in the whole word that matches, it will magically be replaced with the correction. Unfortunately, this takes quite a bit of time to build up automatically. Plus, while you catch 'teh’ with this, 'Teh’ doesn’t get changed. So it seems like there needs to be a more systematic approach.

I was looking around, and couldn’t find a nice native file that had corrections out there. Fortunately, Wikipedia has a machine-readable list of common misspellings! So this was a great start. There were about 4000 changes that were in there. Here’s a sample:

aggreement->agreement
aggregious->egregious
aggresive->aggressive
agian->again
agianst->against
agina->again, angina
agin->again
aginst->against
agravate->aggravate
agre->agree
agred->agreed
agreeement->agreement

There are a few like 'agina’ that have multiple choices, so I picked the one that was most common. I don’t really type 'angina’ all that often. Then again, the string distance is pretty huge there. So there are probably some that are a stretch, but it’s a great start.

Then I created a script to parse this file and do some important changes. Essentially, if a word to be corrected starts with a lowercase letter, it also should be changed when the mistake is capitalized.

Here is the script, generator, and product.

The only limitation that I found is that dashes and apostrophes in the word to be corrected don’t seem to work, and I couldn’t figure out how to escape them. And obviously sourcing thousands of lines of Vim commands takes a noticeable amount of time.

Spelling correction

Built into Vim nowadays. Just need to type :set spell. If it complains, you might need to set the spelling language.

Spelling suggestions z=

Previous misspelling [s

Next misspelling ]s

Add current word to dictionary zg

Undo adding current word to dictionary zug

Word Processing Mode

I commonly use a few things when doing word processing, so here’s a handy function that you can add to your .vimrc and modify as you see fit.

cabbr wp call Wp()
fun! Wp()
  set lbr
  source $VIM/vimfiles/autocorrect.vim
  set guifont=Consolas:h14
  nnoremap j gj
  nnoremap k gk
  nnoremap 0 g0
  nnoremap $ g$
  set nonumber
  set spell spelllang=en_us
endfu

You can add the preceding block to your .vimrc, and then invoke it with :wp.

Review: Tribes

Title: Tribes: We Need You to Lead Us Author: Seth Godin Published: October 2008 Length: 160 pages, or 3:40 spoken

“A tribe is a group of people connected to one another, connected to a leader, and connected to an idea.”

This book is self-described by Seth as a book that was supposed to be about leadership that happens to have a lot of marketing information, or a book about marketing that happens to have a lot of leadership information. The main point is that with the advent of tools to facilitate interactions between groups of people with common interests, being a leader is easier but even more important than ever. Tribes can be smaller and more precise because geographical limitations are mostly gone now. Apart from others’ need for leaders, being a leader increases your happiness because you are in control of your destiny and are constantly challenging yourself. Seth makes an even bigger point: we need YOU to be a leader, and there are huge benefits to be gained from doing this. Sometimes the going can be tough, but if everyone were doing it, then it wouldn’t be worth as much when someone provided true leadership. Godin emphasizes creating a movemen and working with it to allow it to thrive.

Seth makes a distinction between managers and leaders, stating that the former are risk-averse because they are trying to meet goals and are typically rooted in the “factory” mindset. The latter go against the status quo by having a vision and passion for what they are working for. Seth consistently describes these people as heretics because they have a vision and are willing to commit to that vision, challenging authority and old ways of doing things if necessary. Deciding to lead and not manage is a critical choice that you must make in your life.

Being a leader is not about talking. It’s about listening and sometimes even stepping out of the way so that your tribe is empowered. Seth is clear several times that if you are not passionate about what you are trying to do, you should not lead. Just sit this one out and wait until it is your time. But if you need to and want to, then you must step up. The only thing holding you back are your own fears.

One of my favorite parts of the book (not necessarily a revelation) is when Godin describes the safest thing being the riskiest, and the riskiest as being the safest. With the world as connected, fast-moving, and ever-changing as it is now, it is actually less risky to innovate and be proactive. There might have been a time when a large establishment or bureaucracy could have been seen as a positive, but now it’s seen as restrictive. But Seth is clear that organizations are critical to getting important things done in a timely manner.

Tribes is kind of like Who Moved My Cheese for grownups. Seth constantly talks about not settling and rising above the status quo. He warns about “what everyone knows.” Often the best innovations are created when people disregard what “everyone knows.”

Godin also discusses risks, whether real or perceived, associated with assuming a leadership role. In the end, it boils down to there being little true risk and a large possible upside. Most of the time risks are all in your head. People don’t start things because they are afraid of failure or of being criticized by others. However, Godin makes it clear than anything worth criticizing is worth doing. It would be much worse to do something and be ignored than to do something and have half of the people hate it. At least they are talking about what you did. To further show that most risks have little foundation, let’s say that you are leading a project and things go horribly wrong. More than likely you will not be fired for having a cause go awry, and you will definitely learn from the experience. In the event that you get let go, it must be easier to find a job knowing that you have been trying to innovate and change things up.

It’s not all about companies though. Seth talks about local leadership and non-profits, as he has been involved with working with those groups. Another nugget that I enjoyed was the discussion of faith and religion and how they parallel leadership and management. Indeed, leadership takes a great deal of belief in what you are striving for.

Seth makes the point several times that everyone is now a marketer, whether you think you are or not. You need to be able to sell, whether for your personal ideas or for your company. Jeff Atwood describes a nice analogy for seeing how more balance can increase your effectiveness. I listened to the Steve Yegge podcast that Atwood references, and I’m inclined to agree with his Yegge quote: “If there was one thing I could teach every engineer, it would be how to market.”

There are numerous concrete examples in the book, which makes internalizing the concepts easier. I highly recommend reading or listening. It definitely fired me up. There is a whole lot that I’m missing, you can see an outline that I created for Tribes.

I learned about this book when Seth put links to an audio recording of him reading the book available for free or nearly free in his blog. Seth practices what he preaches, so he asked me to pass this information along. :)

IndyGiveCamp

Most charity events take manual labor, so maybe you had an excuse before. But “IndyGiveCamp Charity Challenge Weekend 2009 is an initiative designed to allow developers, designers, DBAs and web enthusiasts to donate their time and talent to developing applications for charities.” Hey, charities need software too!

You list your proficiencies, and are paired up with other developers (optionally of your choosing) and you work on a project for the weekend. With a schedule like this, you can be sure that you will be challenged. Heck, they say that “copious amounts of caffeine will be provided.” Don’t worry, you don’t have to participate the whole weekend. It happens on January 23-25, 2009, which comes sooner than you’d think due to the holidays and whatnot.

I’m definitely planning on going. It seems like a nice chance to work with people that I maybe haven’t worked with before or to work with people from other companies. I heard that a few other people from here were interested. If you’re planning on going, let me know and we can probably arrange to work together. I’ll probably sign up by the end of the month. See http://www.indygivecamp.org if you want even more details. I first heard about this at the Indy alt.net group.