Home Blog Page 28

Building Habit Forming Behavior Into Apps


Hi, this is episode 4 of CronDose, I’m your host Jordan Hudgens, I’m a Ruby dev and CTO of DevCamp.com

On Thursdays I cover an item in the news for the tech sector, and specifically discuss how it relates to developers. Today I’m going to discuss the announcement by Facebook’s CEO Mark Zuckerberg told the world,

“Today, people around the world spend on average more than 50 minutes a day using Facebook, Instagram and Messenger…and that doesn’t count WhatsApp.”

Depending on your own usage of this social channels that number may or may not surprise you and it may say something about how the world is transitioning towards a different type of social interactivity. However the topic for this video is how to build that same type of habit forming behavior into your own applications.

Last month I read Charles Duhigg’s book “The Power of Habit: Why We Do What We Do in Life and Business” on habits as they relate to technology where he explains some of the key elements that drive our addiction to applications like Facebook, Instagram and Twitter. Most of the features that get us to stay on these applications so much are focused on the reward and convenience centers of our brains.

Our brains like things that are easy, and checking our what our friends are doing on Instagram doesn’t require much work, and since it’s on our phone it’s pretty convenient to pop the app open a few times an hour to see what everyone is up to. For the reward portion of our brain, even though it may not seem like a big deal, each time we get a new follower or a few more likes on a picture it triggers the reward section of our brains, which functions in many ways like a drug and drives us to want more followers and more likes.

Based on some of this research I wanted to present the following recommendations for building features into your own applications that will help drive habit driven behavior, some features that could be built in would be:

  1. If you are trying to teach users a topic, show them a progress bar and increment it each time they finish a lesson or quiz, them seeing the progress bar slide up closer to 100% will give them a mental reward and make them keep coming back for more.
  2. For a mobile application make sure you take advantage of notifications, most brains have a hard time ignoring notifications on an app, the curiosity makes us want to click on it to see what it says, which will continue to drive users back to the application.
  3. Give rewards for completing tasks, Foursquare, Yelp, and even the Apple Watch’s exercise application give our badges for successfully finishing undertakings, creating awards for streak based behavior, such as exercising for 5 days in a row, are very powerful motivators.

Hopefully those ideas will help give you a start on how to build habit forming behavior into your own applications, good luck with the coding!

Inspirational Programming Quote from The Fountainhead


On Wednesdays on CronDose I cover a random programming topic and today I’m going to discuss one of the quotes that I’ve always turned to for inspiration. It’s from Ayn Rand’s book, The Fountainhead. The main character in the book, Howard Roark, is a skilled architect and typifies the concept of being a true craftsman, in the same way that all of us, as developers, should approach our own projects. This quote discusses how every project is special and deserves a unique implementation, and it goes as follows:

“Rules? Here are my rules: what can be done with one substance must never be done with another. No two materials are alike. No two sites on earth are alike. No two buildings have the same purpose. The purpose, the site, the material determine the shape. Nothing can be reasonable or beautiful unless it’s made by one central idea, and the idea sets every detail. A building is alive, like a man. Its integrity is to follow its own truth, its one single theme, and to serve its own single purpose.” Howard Roark, The Fountainhead

Even though this was written in the early 1900s and was for the architecture industry, Roark’s approach to craftsmanship can be applied just as easily to programming. It can be easy to fall into the trap of staying in a comfort zone and simply duplicating implementation and functionality from project to project, however that can create two problems:

  1. You don’t grow as a developer, the only way to get better is to step out of your comfort zone and build features that you’ve never done before so you can learn new concepts.
  2. Projects suffer, becoming square pegs in round holes. Each application has its own set of unique requirements and therefore should have a custom implementation.

I hope that you found Roark’s wisdom inspirational and that you can apply it to your own development projects.

Programming Interview Question: Differences Between Class and Instance Methods


On Tuesdays at CronDose we talk about coding interview strategies and today we’re going to discuss the difference between class and instance methods.

I’m a Ruby developer and this episode’s answer will be addressed from the Ruby perspective, however it’s a concept that can be important to know in other languages as well, for example Objective C and Java have class and instance method options.

So what do you do when the interviewer asks the difference between class and instance methods?

From a practical perspective a class method can be called by itself, for example, if you had a class that handled sending SMS messages, you could call the class method by itself and simply pass in the values that you want to send in the SMS message.

An instance method is a function that requires an instance of the class to be created. In the SMS example we didn’t need to create an SMS instance, we only cared about the system sending the text message. An example of an instance method would be something like a full name method in a Customer class. If you want to know the full name of a customer you most likely have a customer in mind and Already instanciated the class into an object with a specific Customer selected.

In summary, I typically use instance methods since I’m usually calling methods on objects, class methods are helpful from time to time, but in many cases they can be a sign of poorly constructed code since many class methods could be refactored into modules and out of classes.

Dead Simple Explanation of MapReduce


Today in Manageable Monday we’re going to walk through the MapReduce process and how I could potentially use it for the CronDose website.

For the case study we’re going to imagine that my tutorial suggestion page has millions of content suggestions (not really, but let’s pretend).

It would take too long to look at each suggestion manually, so I’m going to use a mapreduce algorithm to analyze and organize the data.

I’d follow the steps below:

  1. Pass each suggestion to the map method to tokenize (convert each suggestion into an array of words)
  2. This map method will return a series of key/value elements (“algorithms”, suggestion_1, “Ajax”, suggestion_2, etc)
  3. The mapreduce framework would sort the returned values
  4. The reduce method would iterate over each of the values and tally up the popularity of each word.

So a final result could potentially be:

“Algorithms” -> 500 times
“OOP” -> 300
“Pagination” -> 200 times

Deep Dive