Dear
Software Developers,
This CPTTM Software Developer newsletter is to bring useful news to
you, software developers in Macau, for references without obligations,
so that you can do your jobs easier and better! Hope you like it. if
you'd like to unsubscribe or recommend your friends to subscribe, just
email me at kent@cpttm.org.mo.
Old issues are available here.
Topics in this issue:
7
Rules for Software Programmers and Managers
Programming
is not easy, as you could not move on if you think the code you write
is not prefect. At the meanwhile, you start to think how to optimize
the code to run faster under some circumstances . Then you try to
rewrite it or do it in a tricky way. But later you will realize you
spend too much time on it and the code becomes hard to read.
Stop optimizing code during coding as Wittawat
Chaisaraseree told us sometimes it is meaningless. Because the software
could be developed entirely difference as your first idea after several
iteration cycles. Your optimization work might be useless as the code
could be dropped or the business requirement is changed.
The following 7 rules for Software programmer and
managers by the author listed the common mistakes during a software
development. The article shows why it doesn't make scene to do the
optimization before you measure it and find out the real bottleneck and
the rules to avoid software performance bottlenecks and where the
effects you should put on.
To get good performance from your software
applications, you might consider to follow Rules of Good Performance:
- Measure first and optimize second - find
bottlenecks and focus your efforts there.
- Use efficient patterns of access to data, aka
Use IO and other slow calls efficiently.
- Design for low concurrency contention for
shared resources.
- Learn how you are supposed to use APIs and
third party components.
- Use a realistic amount of data and users for
performance tests, aka don't test using an empty database.
- Do performance engineering work throughout the
project, starting with basic capacity planning.
- Don't 'optimizing code' while programming,
it's almost never helpful for performance. See rule 1.
Check out here for the full article:
http://software-document.blogspot.com/2010/08/software-performance-7-rules-for.html
Tim Ma
Apple Relaxes iOS App Store Restrictions to allow Third Party
Development Tools
If you really want to
dig some golds from App Store - the software market for iOS devices
(such as iPhone, iPad and iPod Touch). You should not miss to read and
know about App
Store Review Guidelines.
How come the guideline comes up? Back in 2010
April, Apple restricted iPhone development to only allow use of their
developer tools. It means you could not use some cross platform
development tools such as PhoneGap, Appcelerator and Adobe Flash. Also,
after a few months, Apple further blocked applications from sharing
data with many companies, blocking applications that "collect, use, or
disclose to any third party, user or device data" unless needed for the
application or to serve advertising through "an independent advertising
service provider whose primary business is serving mobile ads". That
means you could only advertise on your own or join Apple's iAd
advertising platform.
Finally in 2010 Sep, Apple has changed the policy
that they "listened to our developers" and "we are relaxing all
restrictions on the development tools used to create iOS apps, as long
as the resulting apps do not download any code.". At the same time,
Apple has also published App
Store Review Guidelines to help developers understand how
their applications are reviewed and then allowed or rejected by Apple.
So now developers are free to use third party
development tools and choose their advertising partners while they are
keeping the review guidelines in mind.
Much of the rules in the guidelines are
common-sense but some highlights noted by Rob Pegoraro of the
Washington Post that you might be careful, such as:
- 2.11 Apps that duplicate apps already in the
App Store may be rejected, particularly if there are many of them.
- 2.12 Apps that are not very useful or do not
provide any lasting entertainment value may be rejected.
- 3.1 Apps with metadata that mentions the name
of any other mobile platform will be rejected. ...
- 9.3 Audio streaming content over a cellular
network may not use more than 5MB over 5 minutes. ...
- 15.3 "Enemies" within the context of a game
cannot solely target a specific race, culture, a real government or
corporation, or any other real entity.
Now we could see that App Store seems to become a more open place.
Since there are already 400,000+ apps by 2011 Jan. Apple is now
sweeping out some low-quality apps and copycats from the store.
Tim Ma
Testing the performance of your web applications
Some
time ago I needed to ensure that a webapp on our server would run at
reasonable speed given a certain number of users. How to do that? I
used Apache
JMeter and it turned out to work very well. You can think of
it as a browser that can be controlled by a script we write. For
example, I created a script in the GUI (see the screenshot) to:
- Send a GET request to get the home page of that
webapp.
- Check if the page contains a certain keyword
(e.g., "welcome").
- Extract the URL in the Login link on that page
using a regular expression pattern.
- Send a GET request to that URL to display the
login page.
- Check if the page contains a certain keyword
(e.g., "login").
- Extract the URL in the Login button on that
page using a regular expression pattern.
- Send a POST request to that URL and include two
parameters: username=u1 and password=123.
- ...
This simulates the actions of a single user.
To load test the system, specify a "thread group" to wrap around the
actions above and set the thread count to, say, 99 to simulate 99
concurrent users.
BTW,
the result was very encouraging: given 99 concurrent users, it can
handle each request in 14ms on average.
Kent Tong
URL Design should be a requirement for a website
URL is a
very core part of the Internet. It is much more than a address or
resource locator. It doesn't like your mobile number which is just a
meaningless random numbers.
There's good URL design, there's bad URL design,
and there's everything in between – it's subjective. But it is quite
obviously to see which is good and which is bad.
For example, considering this: http://www.apple.com/iphone/how-to-buy/
And this: http://www.microsoft.com/windowsphone/en-us/buy/7/phones.aspx
It is clear that I don't need to tell you where
the first URL points to. But for the second one, it points to a list of
available Window Phone 7 phones. It's not about Apple and Microsoft but
obviously the first one is better because it is short and readable. The
second URL could be simplified or organized to :
http://www.microsoft.com/windowsphone/buy/en-us
or even get rid of default region: http://www.microsoft.com/windowsphone/buy
Why it does really matter? I couldn't tell you it
is a must but it makes sense for the eyeball economics. A beauty URL
has more chances to be tweeted or shared on the facebook. And you won't
click a strange or unknown URL.
If you are developing a website. You should take
time to design your URL structure. Don't leave it up to your framework.
Don't leave it up to chance. Think about it and craft an experience.
URL Design is a complex subject.
But that doesn't mean there aren't best practices for creating great
URLs. Kyle Neath has written a great article to show you some best
practices in URL design and explain why new HTML5 javascript history
APIs are so exciting to work with.
Source: http://warpspire.com/posts/url-design/
Tim Ma
Upcoming courses for software
developers
Feedbacks
Any questions, ideas or experiences to share? Contact me at 28781313
or kent@cpttm.org.mo. We also
have two other newsletters: CIO newsletter
and Network
administrator newsletter,
your friends may like to subscribe.
Until next time,
Kent Tong |