Paul C. Williams

Interfacing Technology & Business
View Paul Williams's profile on LinkedIn
StackOverflow
 3.3k 

Thursday, May 15, 2014

Conversion rates desktop web vs. mobile

There's an interesting discussion going on regarding the fact that for online retailers the conversion rate for desktop web sites is 55-65%, and for the same retailers the mobile conversion rate is 35-45%.

Some people think that is a result of the screen differences and input difficulties.  With this mindset the response is to create accounts that allow purchases without (or with less) input.

I think it's just because people browse on mobile.  Browsing is fundamentally different from shopping.  Maybe the user is just killing a little bit of time, or is looking for a particular product ... in either of these cases the user doesn't really have the intention to purchase at that time.

So, in the browsing case, the response could be to take note of what the user appears interested in and make sure to follow up.

Tuesday, May 13, 2014

Java 1.7 features of note : try-with-resources and suppressed exceptions

In Java 1.7, a new feature called "try-with-resources" was introduced.  This is a specialized "try"/"catch" block that recognizes that you have a "closable" resource that must be closed.  Using this feature will ensure the resource is closed at the end of the statement.

static String readFirstLineFromFile(String path) throws IOException {
    try (BufferedReader br = new BufferedReader(new FileReader(path))) {
        return br.readLine();
    } // MAGIC! The resource is closed after this line!
}

You can create your own resources that can be managed using this method by implementing the "java.lang.AutoClosable" interface (or java.lang.Closable which extends AutoClosable), which has one method: void close()

Add this syntactic sugar to your code to produce tasty and un-polluted closing for all kinds of file or database resources.

http://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html

Also new in Java 1.7, the Throwable class includes a Throwable[] getSuppressed() method. This method allows a developer to access exceptions that were suppressed by a framework. The Java JRE uses this if there's a suppressed exception as part of the autoclose, but this feature could also be used by frameworks to aggregate exceptions that might have been encountered during batch or aggregate operations.