Native or Mobile Web App

Computer with codeShould you create a mobile web app or native mobile app? Or both? Each has advantages and disadvantages. Mobile Web Apps allow you to use the current web development tools and languages that you currently know. This makes them scalable, affordable and cross platform. However, people need to use a browser to access them. A native mobile app can take advantage of the features of the phone. You don’t need a browser to run them. In order to develop them, you must use the language and tools that the phone maker specifies. Most developers are taught DRY or Don’t Repeat Yourself. If you choose to make it native, you have to repeat yourself for every smart phone you want your app on.

Who wants to do that? In Making It A Mobile Web App, Kim Pimmel argues why you might want to choose a mobile web app over a native one.

Update Feb 3, 2011: 37 Signals launched Basecamp as a mobile web app and not native. They decided that native mobile apps requires too much specialization and they are “anti-specialization when it comes to development”.

Why you shouldn’t use var in C#

C#Microsoft says that the var keyword can be used to instruct the compiler to “infer the type of the variable from the expression on the right side of the initialization statement”. You can use var for a built-in type, a user-defined type, an anonymous type or type that is defined by the .Net framework library.

You should reconsider using var because of:

  1. Readability
    It makes your code harder to read. You or another developer may have a difficult time figuring out what you were doing.
  2. Mistakes
    You could change the inferred value of your variable and have to spend more time debugging your code.
  3. More Typing
    You may have to type a few more characters when using string or double over var. How much time does it save?

Just because C# allows you to use var doesn’t mean you should. Even Microsoft suggests using var for anonymous types. To help keep your code consistent and readable, use var when necessary.