Jun 7 2009

Google IO 2009: Mobile

I, like many 10-5 developers not working directly with ajaxified web 2.0 applications, was not able to go to the Google I/O conference. I don’t feel so bad not going since Google has just released video recordings of over 80+ technical presentations from Google I/0. Most of the technical presentations are pushing Google’s APIs such as Android, Google App Engine, GWT, and Open Social.

As an aid for myself, and maybe other GWT developers, I have organized the pertinent Android and mobile talks as follows…

Turbo-charge your UI: How to Make your Android UI Fast and Efficient
Learn practical tips, techniques and tricks for making your Android applications fast and responsive. This session will focus on optimizations recommended by the Android framework team to make the best use of the UI toolkit.

Supporting Multiple Devices with One Binary
The Android platform is designed to run on a wide variety of hardware configurations. Learn how to take advantage of the application framework to make your application run on a wide variety of devices without having to build a custom version for each.

Coding for Life — Battery Life, That Is
The three most important considerations for mobile applications are, in order: battery life, battery life, and battery life. After all, if the battery is dead, no one can use your application. In this session, Android engineer Jeffrey Sharkey will reveal the myriad ways — many unexpected — that your application can guzzle power and irritate users. You’ll learn about how networking affects battery life, the right and wrong ways to use Android-specific features such as wake locks, why you can’t assume that it’s okay to trade memory for time, and more.

A General-purpose Caching Architecture for Offline-capable Web Applications with HTML 5 Databases or Gears
Puzzled by all the new architectural choices possible when trying to build an offline-capable web application? So were we until we decided to design the newly launched Gmail Mobile Web for iPhone and Android’s offline capabilities by analogy with microprocessor caches: offline via a portable write-through caching layer running on either HTML 5 or Gears databases.

Mastering the Android Media Framework
Some monks might take a vow of silence, but Android certainly hasn’t. Attend this session, and help your app find its voice. Android engineer David Sparks will explore the multimedia capabilities of the Android platform, lifting the covers on the infrastructure to show you how it works and the right (and wrong!) ways to use it. You’ll learn how things work under the hood, how to dodge the common media-related developer pitfalls, and how to write secure and battery-efficient media code.


May 31 2009

Retweet May 2009

From time to time I just blast tweets about software development, project planning, team dynamics, or whatever else comes to mind. Here is a synopsis of recent tweets and rants. If you want to follow the conversation follow me at techknow and I’ll be sure to follow back.

Programming

  • Some people expand their mind, I scale and then shard mine.
  • Scale your vision, your thoughts, and then yourself.
  • Refactor, reduce, rinse, and repeat.
  • Model your mind, debug your thoughts, and remove the printf statement from your comments.
  • If you perpetuate bad code, you might be a bad developer!
  • Code is about learning – If you are not learning you are doing it wrong.
  • It is not that an artist knows his tools well that makes him great, it is that he knows his media! As programmers, what is our media?
  • If the media of a programmer is the language, what is the media of the program user? The domain space? Should they be the same?
  • I am dumbfounded by the amount of repetitive, tedious, and manual work a programmer will endure before they even consider automating tasks.
  • Code talks, bugs walks.
  • There is a thin line between a solution and a hack…
  • The absence of a save button does not mean entities can not be saved.
  • Less code is the best code.
  • For any bug fix, all the debugging and all the time put into it is lost if you don’t add a test case for the root cause.
  • JavaScript + jQuery UI + bookmarklet + PHP + Twitter API = tweetmark. I wrote a bookmarklet to bookmark URLs to @juixe.
  • Don’t catch and release exceptions, exception handling is not a sport.
  • My job is to make software easier done than said.
  • DB Rule of Thumb: Don’t ever change the database schema without a second, third, and even fourth thought.
  • There is no magic in software development! Files don’t delete themselves out from version control out of electronic spontaneous combustion.
  • To avoid dubious verbose recursive repetition, variable names are not comments and comments should repeat variable declarations.
  • Debugging is not just about code, debug your process and focus on what works and remove and modify that which doesn’t have positive results
  • Just because you can teach end users new tricks does not get you off the hook from you learning to design an application with fewer tricks.
  • Even when saying the same words, it is possible, and not unlikely, that developer understand features differently than what clients expect.
  • Code can easily be refactored, but developer way of thinking is more difficult.
  • In programming you have to think outside the box and outside the stack.

Continue reading


May 28 2009

Programming Memes

Memes involving programming languages and technology in general are not updated once there is a new release. Java has been dogged with the perception that it is slow since Java 1.1, over ten years ago. Programming languages such as Perl, PHP, and Ruby have their share of FUDy memes. Here is a short list of programming memes…

  • Java is slow.
  • Perl is dead.
  • PHP is a not a proper language.
  • Ruby does not scale.
  • JavaScript is for script kiddies.

May 25 2009

Being a Better Developer

Search for the term ‘better developer’ and you find nearly 70 million results. It seems like everybody has an opinion on how to become a better developer, even the bad developers will tell you how to be a better programmer. After reading many of these programming self-help articles on being a better developer I found that the core message was all the same! If I could boil down the advice of all these results into a succinct list of how to be the best developer we are left with the following…

  • Read Everything
  • Learn Fast
  • Practice What You Know
  • Try New Things
  • Strive for Simplicity
  • Write and Teach
  • Assume Nothing
  • Question Everything
  • It is Not Personal
  • Know Your Tools
  • Rinse and Repeat

There is no one Golden Rule for becoming a better developer. Instead of single rule or a unifying theory of software development we have a set of core beliefs and best practices.

Here is the insight from many other developers on how to be a better software developer. In reading their advice, think what is universally true for all developers. What can we learn from each other, no matter the development platform or programming language we use?
Continue reading


May 14 2009

Lookup Pattern and Java Generics

In some situations I dislike the verbosity of declaring Java generics.

Map<Key<String, Integer>, List<Item>> m = getItemsMap();

But using Java generics reduces other forms of tedious class casting common when using List and Map objects. For example, in my current project their we use a Lookup pattern, used to locate concrete implementation to certain key services. For example, to read and write application data we use a FileService which we can get via the Lookup class.

FileService fs = (FileService)Lookup.lookup(FileService.class)

These services we lookup are stateless and we can switch the underlying implementation by modifying some configuration file. In terms of this discussion, I wanted to note that casting. Using Java generics that cast is not required if you use parameterized types. Notice that the key of the lookup is a Java type, in our application it is an interface which the underlying implementation class needs to implement. As you can imagine, the implmenation of the lookup method can be simplified to the following…

public static Object lookup(final Class type) {
    // compoments is a map of implementation service
    Object comp = components.get(type);
    return comp;
}

Using Java genetics we can use the class information in the parameter to cast the return type correctly. We can remove the required class cast by updating the code that locates the required concrete class for the service requested. Here is a simplified version of the lookup method which removes the need to cast.

public static <t> T lookup(final Class<t> type) {
    T comp = (T)components.get(type);
    return comp;
}

Now, using this updated lookup method and employing Java generics our lookup can be of the following form.

FileService fs = Lookup.lookup(FileService.class);

May 14 2009

Conference as a Business Model

There is an interesting rant over on Coding Context on how Joel Spolsky and Jeff Atwood are brilliant assholes because they are organizing Stackoverflow Dev Days. It may be true that Joel and Jeff are self obsessed ass wipes, but I am note sure it is because they are trying to cash in from the inadequacies and inferiority complex of other developers.

Micah, the guy behind Coding context, brought up the point that the guys behind the Stackoverflow Dev Days conference are exploiting their developer community to build their personal brand. According to Micah’s calculation, the series of six conferences can net nearly $200,000 and as of yet they don’t even have the presentations or speakers lined up!

Personally, I am put off by their floating point error size ego, dismissive attitude, and general writing style while a loyal following finds them eloquent. That said, Micah is totally right, they are building their brand! There two respective blogs attracts a large portion of developer eyeballs. Their joint venture, a question and answer site for developers, gets millions of hits monthly. In addition to this, Joel Spolsky runs a job board which he claims has made him over a million dollars. But is this all bad? Is this devexplotation?

In regards to their tech days, they are not the first to realize that there is good money in running a conference, look at Future of Web Apps, No Fluff/Just Stuff, and all the Web 2.0 O’Reilly conferences. A few years ago, I was part of the executive committee that put on a one day conference for a non-profit. With just corporate sponsorship alone, in a good year, we would net $35,000-$50,000 cold hard cash without even trying!!! And remember, in addition to money for ad space, conference organizers are able to get companies pay for printing material, goodie bags, giveaways, and even lunch. To a good organizer, everything including the Wi-Fi identification and mailing lists, can be had for the right sponsorship level.

From a conference like this, I would be concerned by the quality of speakers. What I feel happens, specially when there is corporate sponsorship, is that the sponsors will use the presentations to pitch their tools and try to up sell the audience to their proprietary tools and services. No matter what they say, Conferences like this are used as promotional tool, and they will sell out to sponsors to use their allotted time and space to pitch to a captive audience. Similar remarks have been said of JavaOne. One complain that I have heard of is that JavaOne is to Sun centric, even though they are the ones that put it together. There is a fine balance between corporate sponsorship and speakers so that the conference does not seem like one long infomercial. It always helps if there are different tracks!

In Slashdot style, here is the formula for a business model for running a conference!

  • Schedule a conference
  • Ask for volunteers in exchange for badges and shirts
  • Sellout presentations to sponsors
  • Give out sponsors’ marketing material in goodie bags
  • Have sponsors buy lunch and provide wi-fi
  • Charge per seat
  • Sell books, shirts, and anything else
  • ?????
  • Profit!!!

This is not all to different from the open source business model which includes building a community, charging for training, selling books, licensing technology, providing certification, and putting on a conference …. and profit!!!