7 Deadly Sins for Windows Phone Developers: Gluttony
Join the DZone community and get the full member experience.Join For Free
this is the 6th post in the article series “
7 deadly sins for windows phone developers!
what is gluttony?
gluttony is an inordinate desire to consume more than that which one requires.
why: because you were weaned improperly as an infant.
how does gluttony relate to windows phone development?
– over-indulgence/over-consumption ..
gadgets. they just keep coming .. new & improved, faster & better, smarter & more personal. tablets & computers of today easily match the computing & storage capabilities of super machines from a few years back. all this, in my opinion, is making us developers a little lazy. we are having to pay less attention to performance as the available horsepower simply swallows potential issues.
mobile development is a great leveler in that regard. just the constraints of the smartphone form factor give it limited resources and this brings our code closer to the metal & demands restraint. we need to worry about performance optimization, since lack of it leads to crappy user experience. let’s take a look at how we windows phone developers can avoid gluttony while developing for the windows phone ecosystem:
: overconsumption of phone’s resources is
bad. the windows phone team has worked very hard to make the core os
very very lean .. our resource hungry app will stick out even more in
this context. make sure your memory footprint is small; this ensures
that your app runs efficiently when loaded in device ram and stays
longer in memory as mango does
fast application switching
managed code helps; but make sure you do not have extra using
statements or referencing any library that you do not need. beware of
using multiple 3rd party toolkits, specially if there is overlapping
functionality. also, animations are nice & an integral part of
metro; but too much of it is not good. i have personally seen
performance degrade when swapping out the default
(one that houses your xaml pages) with 3rd party tooling for custom
animations; but that could be just me. anyways, point is, know exactly
what you need & don’t go over.
is an awesome checklist for performance tuning.
: surely no one needs to be told that
locking up the ui thread is just not an option on tablet/smartphone
applications. you may be counting national population/debt; but your app
ui needs to be responsive. most silverlight programming forces us to do
heavy-lifting asynchronously, by intelligent use of background threads
for processing, composite threads for animations & auto-merging with
ui thread. you may use an explicit
, if needed. hang tight as life is gonna get better when the now-supported async ctp is finalized .. no more gobblygowk
apm/eap patterns (details
) .. you should just be able to do
to achieve asynchrony.
: cache anything possible to prevent making
the same web http call twice. this specially applies to images/flat
data. check out the following resources to cache artifacts in isolated
: now that you know windows phone
mango supports fas through a in-memory application backstack, did you
stop caring to handle tombstoning? we cannot just write a resource-heavy
app and expect it to be held in memory for long. coming out clean from
tombstoning is a must .. this
on execution model could be a good place to start
: the new apis to create
are great; but please do not over-indulge in reaching anywhere close to
the limit of 50 or create them without user intervention.
- api exploitation : the new calendar & contacts apis are super handy, aren’t they? but again, with power comes responsibility. do not exploit them to do things without user intervention. uninstallation & bad reviews will follow.
that’s it for today. crux of this post: just because you can, doesn’t mean you should! hopefully, you come back soon for the 7th article in this series of “ 7 deadly sins for windows phone developers! “.
Published at DZone with permission of Samidip Basu, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.