Google Play Store rating/recommendation system is broken and how to fix it

The Google Play store has an app rating/recommendation system. When you are on the main screen of the store it will show you an app you have installed and ask you to rate it using a star rating (no need to type in a textual review) so that it can recommend you other applications.

I used to be eager to fill these in, hoping it would find some gem that would suit my tastes. Sadly, I now realize the mechanism is fundamentally broken.

Here are two recent experiences I’ve had with this feature:

In the first case I had installed two weather applications on my phone. I tried both and didn’t like them. For one of these I wrote a negative review. I removed both and installed a third one. After a couple of days Google asked me to rate this new app. I gave it a four star rating. Google Play then prompted me to try some more weather apps.

This scenario has me, the user, searching for a specific kind of application and settling on one I like. My search for such an application has ended in a satisfactory way. Signaling my satisfaction shouldn’t prompt Google Play to suggest more alternatives.

In another case, the Play Store asked me to rate the to-do list app I have been using for the past few months. Since I really like it I also give it a strong rating.

Again the Play Store suggested more to-do list apps to install. A to-do list app is really something you only need one of.

How to fix it

The solution for this problem is to look at the type of app or product that is being rated. Is it a game, a widget, a productivity app, a book, a magazine?

Each of these broad categories could then be assigned a value indicating whether a good rating from the user would preclude the recommendation of similar apps or promote it.

So if I give a good rating, say 4 or 5 stars, to a weather widget the recommendation system would not suggest me another app with the same functionality.

On the other hand, if I give a poor rating to such an app, I would want Google Play to suggest some highly rated and popular alternative. I took the time to install and try out a particular type of app and clearly I’m not satisfied by it. Chances are I’ll be interested to find a better one.

Similarly, if I give a good rating to a sci-fi book or action movie it should offer more of the same. Movies, books, magazines and certain types of apps should continue to work the way they do now.

The system could be further expended to classify different types of apps or products. Rather than bunch all non-gaming apps in the same category it could be further improved by using the existing sub categories and even making finer distinctions amongst these existing sub categories.

It should also drill down further by using collected user data.

Do users of this app install similar apps in the same sub category after rating positively or not? This information could be collected (it probably already is) and then used to calculate the value of whether to preclude or promote similar results on a positive review.

This modification would make the current system much more useable.

Rust: enums

Rust 0.10

Enums in Rust behave like you would expect in most C based languages. You can also implement methods on enum types. Both instance and “type” methods.

You declare these methods in the same way that you declare methods on a struct, using the impl keyword followed by the enum’s name.

Here is an example of an enum with a constructor-like method and two instance methods.

Compiling and running this program would output the following result:

Initial
Initial
NonInitial

Now let’s try something a little bit more complex. The following is a enum type I wrote for an actual application. To get more familiar with Rust, I am porting my height map generator that I used for my Ruby game project.

The following enum generates random coordinates for a particle drop point (the algorithm I use for generating the map is the particle deposition algorithm). The formula to calculate the coordinates varies depending on how many times we have called it.

Here is the enum type:

And here is how it’s called:

Contrary to the first example, when I change the state of the enum I return a new instance instead of mutating the current one.

Rust: Pattern Matching

Rust 0.10

One of Rust’s feature is pattern matching. Pattern matching is also available in languages such as Prolog, Erlang and Haskell.

In Rust you do pattern matching with the match expression. You can use pattern matching as a basic switch statement:

Here the underscore can be interpreted to mean anything. Since there is no fall through between the cases and the last one will match any values which haven’t been matched yet, it will act like a default case.

match let’s us do so much more than in many traditional C based languages.

For instance:

This example introduces variables and conditionals as well as ranges.

With variables and conditionals you can also start writing recursive matching functions. These might seem odd if you aren’t used to such constructs, but once you do you’ll find them very expressive and powerful.

Here are two simple examples, defining a factorial function and a Fibonacci function:

Pattern matching also allows us to do destructuring, which I will talk about in a later post.

Rust: Expressions

Rust 0.10

In the context of a programming language, an expression is something that can be evaluated and returns a value.

ie:

1 == 1

Is an expression that evaluates to the boolean value true.

In Rust many things are expressions; litterals, match (think pattern-matching), tuples, structs, if/else conditionals and loops are all expressions.

They will all return a value that can be used to initialize a variable or anywhere else where a value is needed.

The ; is used to suppress the return of the expression’s value and instead return (), which is known as the unit value.

Here are a couple of examples:

The first code block (delimited with brackets) will return the value of it’s last expression, inner * inner, which will be the value of the block expression itself (the whole block).

The value returned will be 4.

In the second case, the semicolon ;, symbol will suppress the value of the last statement and the value of the block expression will be ().

Here is another example:

This will print hello since the last value of the last expression in the function will be returned. Again this could be suppressed with a semicolon.

The return keyword could optionally have been used. return works as you would expect when placed anywhere within a function.

Finally here is an example of an if conditional acting as an expression:

In other languages you would have probably seen something like:

if (bool_value == true)
  int_value = 1;
else
 int_value = 0;

Here is the full code sample: