Wednesday, October 26, 2016

This Week in Mobile Web Development (#131)

Read this on the Web

Mobile Web Weekly October 26, 2016   #131
Peter Cooper recommends
Adapting to the Mobile Web F̶u̶t̶u̶r̶e̶ Present — A fascinating talk where you’ll learn how to diagnose bloat, techniques for attacking it, and how to keep your app under a reasonable performance budget from start to finish.
Alex Russell
Peter Cooper recommends
It’s Game Time for the Web — Powerful opinions from Dion Almaer on the importance of elegantly dealing with mobile Web constraints, whether through aggressive build solutions, client-side technology or ‘tricks and illusions.’
Dion Almaer
Brian Rinaldi recommends
Platforms Like Facebook's Instant Articles and Google AMP Are Making It Harder to Publish to The Web — The author argues that these formats have introduced additional coding complexity that makes it more difficult for smaller publishers to compete.
Jan Dawson
Sponsored
Build your gem of an app on our jewel of a server. Linode: Simple. Reliable. Powerful. Fast. — Create your ultimate app using the cloud’s fastest, most scalable, powerful and reliable SSD servers: Linode. Use promo code MOBILEWEB20 for a $20 credit.
linode

Holly Schinsky recommends
The Best Mobile Interaction Designs of 2016 — A showcase of 15 apps and interaction design concepts that have been recognized as some of the best so far in 2016.
Proto.io
Brian Rinaldi recommends
Progressive Web Apps: Bridging the Gap Between Web and Mobile — An overview of progressive web apps and their advantages and disadvantages.
Mark Pedersen
Peter Cooper recommends
Google Update: The Great Index Divide “In the next few months, Google is planning on dividing their index between mobile and desktop. But here’s the kicker, the MOBILE index will be the primary index.”
Ryan Shelley
Brian Rinaldi recommends
Why Do Websites Publish AMP Pages? — Gruber worries that using AMP traps users by not easily offering them an obvious way to get back to the canonical version of the article. Chris Coyier follows up.
John Gruber
Holly Schinsky recommends
Hybrid App Development: How Do I Get Started? — Resources and information to help you get started building hybrid apps quickly.
Jorge Vergara
Brian Rinaldi recommends
You Can't Detect A Touchscreen — A look at various options for detecting a touchscreen from the browser, each with their own caveats, and why you shouldn’t rely on them.
Stu Cox
Peter Cooper recommends
Android Pay Partners with Visa and Mastercard to Bring Simple Checkout to Mobile Web — Google announces strategic partnerships with Visa and Mastercard to bring Android Pay to more places on the mobile web.
Google
Chris Brandrick recommends
How To Poison The Mobile User — Want to avoid annoying your users? Here’s a sarcastic run down of things not to do.
Martin Michálek
Holly Schinsky recommends
Love Pokémon Go? Create Your Own AR App in Monaca with Wikitude — How to build an app enabling Augmented Reality to draw 3D objects in real-time using the Cordova Wikitude plugin, Monaca and Onsen UI.
Onsen UI
Brian Rinaldi recommends
Responsive Images in CSS — A look at the available options for supporting responsive images, how they work and where they are supported.
Chris Coyier
Holly Schinsky recommends
AtoZ CSS Quick Tip: Achieving Cross Browser Support — How to achieve the best cross browser support for your apps by starting with a good baseline experience for as many devices as possible.
Guy Routledge
Holly Schinsky recommends
Comparing Frameworks with a 'Hello World' — A comparison of apps built using Onsen UI and various popular JS frameworks to help you see the differences and choose your favorite.
Onsen UI
Peter Cooper recommends
Why LTE Has Slowed by 50% in the US This Year — Usage levels are outpacing infrastructure improvements.
Twin Prime
Holly Schinsky recommends
Using iOS Image Picker with React Native — Building a simple app that will prompt the user to pick an image, and then display that image.
Gosha Arinich
Peter Cooper recommends
Google Struggles with Accreditation for Mobile Web Metrics
MarketingDive
Sponsored
Don't Get Frustrated - Get Hired — Sick of pushy recruiters, and dead end interviews? Try Hired to hear from top tier companies, and only talk to relevant companies.
Hired

Curated by Brian Rinaldi and Holly Schinsky for Cooper Press.
Cooper Press is located at Office 30, Fairfield Enterprise Centre, Louth, LN11 0LS, UK
Update your email address
or stop receiving MWW here


by via Mobile Web Weekly

Fuel Your Titan

We worked with MTN DEW and Doritos to create a digital experience to let fans redeem product codes for exclusive Titanfall 2 in-game rewards—developing the first ever DOM rendered in WebGL site along the way.
by via Awwwards - Sites of the day

4 Ways to Use Instagram Stories for Business

nc-instagram-stories-business-600

Want to incorporate Instagram Stories into your marketing? Wondering how other businesses are using Stories? Instagram Stories let you engage your customers and prospects with a more complete message than a single image can provide. In this article, you’ll discover four ways to use Instagram Stories for business. Why Instagram Stories? Instagram Stories lifts its [...]

This post 4 Ways to Use Instagram Stories for Business first appeared on .
- Your Guide to the Social Media Jungle


by Nathan Chan via

Tuesday, October 25, 2016

How To Make Your Very Own WordPress Website or Blog (Infographic)

How To Make Your Very Own WordPress Website or Blog (Infographic)

Definitely, the popularity of WordPress today has grown tremendously compared to when it was first released in 2003 by Matt Mullenweg and Mike Little. Breaking into the CMS spotlight, WordPress has since known to the industry as the most common platform for anyone who wants to start their own website.

With its almost unlimited number of plugins and functional yet visually stunning themes to choose, a lot of people will argue that WordPress indeed is a good place to start when you want to established your own online identity in the vast world of internet.

That being said, a lot of people are still hesitant to make their very own WordPress website despite the fact that it is the most user-friendly CMS available in the market today. The reason for this is that they hold this belief that this CMS requires some intense coding skills or deep knowledge about stuff like web hosting and analytics.

Though it’s somewhat true since there are some internal functions of WordPress that need some coding skills, and you need to choose a reliable hosting provider, this CMS has a very intuitive user interface that let even the most novice users to tweak it in every way possible. With its low learning curve, one can surely get the hang of it in the in just a couple of days.

Here are some of the benefits of using WordPress as your website platform

  1. An easy to use interface which allows all users- from novice to experts- to manage their website easily and hassle-free.
  2. It’s a browser-based system so you can access your Website from any computer you want.
  3. It doesn’t require HTML editing, allowing you to create a new post in a breeze.
  4. Its structure can be easily understood by search engines.
  5. Wide Array of Plugins
  6. Many more

If you’re planning to take your business to the next level, then introducing it into the world wide web is the most sensible step you need to take. To do that here is an infographic from WP Shrug that covers all the basic steps on how you can build your own WordPress site today.

by Irfan Ahmad via Digital Information World

Combining Spring Boot and JDBI

I recently found myself architecting yet another microservices REST backend. Within the past few years I've written from-scratch backends in Spring, Dropwizard and even in Python using web.py but each has left me wanting more. In this article I’ll show how and why I settled on Spring Boot and JDBI as a combination of frameworks which allows me to easily develop REST services backed by a relational datastore.

REST Frameworks

Let’s compare and contrast some of the modern REST frameworks that can be used today in order to build REST services. There are some obvious ones missing (e.g. Ruby on Rails, Flask, Django, NodeJS) but I’m going to focus on the frameworks that I’ve personally used to build significant production-grade service tiers.

Spring

The grandaddy of modern microservices backends, Spring has great dependency injection (DI) and a large extensive library of addons, but it tends to have long startup time and feels quite heavy and enterprisey when compared to some of the newer microservices frameworks. Spring.io itself recently posted this good article drawing out some of the concerns they’ve heard from developers regarding the Spring framework.

It also features out of the box support for Hibernate as an ORM layer, which (feel free to flame me in the comments) in my experience gets in the way as often as it doesn't. It's great for simple relational structures and is quick to bootstrap solutions but as soon as you're dealing with complex data structures or want specific types of queries (say for efficiency) it becomes quite cumbersome.

Dropwizard

A light-weight Jersey container which provides great support for JDBI as an ORM-light solution. I've found JDBI to be a simple way to interact with a DB. Yes, you have to bind your ResultSets to your model objects manually but I've found it a small price to pay for the great flexibility it provides by allowing me to generate the exact queries I want without having to rely on (and trust) SQL auto-generated by an ORM. In my opinion it's a really nice solution that sits somewhere between JDBC and a full-blown ORM.

What Dropwizard doesn't do well is DI. There is support for Guice via extensions like dropwizard-guice but I have found these to be clunky at best. My biggest issue with all of these solutions is that you end up with separate DI graphs for each module. This isn't a problem for simple applications but I've experienced in complex applications that dropwizard-guice becomes quite unwieldy and the separate DI graphs end up having the same class being injected with a different instance/state which can start producing unintended results.

I really just want out of the box DI that is easy to use and gets out of the way. This should be plumbing, not an application feature.

web.py

Well, clearly one of these things is not like the other. I included web.py because I have written a full-featured rest tier in it and if your religion is Python then it's a good choice. If you're actually contemplating a Java-based framework then this obviously isn't your cup of tea.

Spring Boot

Spring Boot is a lightweight version of Spring that is focussed on creating Spring-like applications that "just run". If you're new to Spring Boot there are some excellent getting started guides in the Spring Boot reference guide.

Whereas Spring can feel quite enterprisey, Spring Boot both feels and performs like a true first-class microservices framework due to it’s quick learning curve and snappy startup. It has the same great support for DI as Spring and also features an extensive library of spring-boot-starter-* maven dependencies that you can use to add support for a great many things.

It still, however, uses Hibernate as it's "native" ORM tier. Now if that's fine for you then go for it, Spring Boot out of the box is a great solution but for me I just find Hibernate too cumbersome.

Hibernate vs JDBI

I've stated that Hibernate "gets in the way" and that JDBI is "a really nice solution", which bears further discussion to draw out a few points. Firstly, there are many Hibernate applications which operate well at scale (and I have developed many), however, there is very much a trend to move away from heavy ORM solutions for some of the following reasons:

  • Hibernate can generate large numbers of unnecessary queries, even due to minor misconfigurations (e.g. here and here, just to illustrate a few). When properly configured it still often performs worse than simple SQL queries.
  • Hibernate is opinionated about your data structure. When you have a data structure that doesn't folow it's notion of keys and relationships the Object-relational Impedance Mismatch is going to hit you even harder. Hybrid-ORM frameworks, such as JDBI, allow more flexibility when mapping to objects and thus provide more runway before you have to start coding significant work arounds for this issue.
  • You don't see the performance problems until you scale! When your application is small and simple everything seems to go along smoothly, then you scale and all of a sudden hibernate queries are the root of your performance problems. I've myself hit this situation many times and it's always taken significant rework to fix the issues.

This quora post is an excellent discussion that reinforces some of the points I make above and also touches on others. Note that I am not trying to hate on Hibernate here. It’s a good tool and when configured correctly can have great performance in a number of situations (I have personally written high scale solutions using Hibernate as the ORM).

So this certainly isn't a right-or-wrong discussion and I do not want to suggest that JBDI is the cure to all evils. But it is an alternative to a "heavy" ORM like Hibernate and can make your life easier as a developer. I have personally encountered many tech companies which are happily using JDBI inside Dropwizard and would not move back to using Hibernate.

So what's a savvy software engineer to do?

Continue reading %Combining Spring Boot and JDBI%


by Damian Hagge via SitePoint

7 Morning Rituals to Kickstart Your Creative Productivity

Morning rituals to kickstart your creativity

Time is the most important asset an entrepreneur can have, but it can seem like there aren’t enough hours in the day. Even if you sit at your desk for 12 hours straight, if you’re not using this time efficiently, you’re going to end the day feeling unaccomplished.

For most people, the morning is the most important time of day ⏤ your actions in the morning set the tone for the rest of the day. Unfortunately, most of us wake up feeling stressed, tired and overwhelmed by the endless number of tasks on our to-do lists. This negative mindset at the beginning of the day will only set you up for failure.

Having a positive start to the day will ensure that the rest of your day follows suit. Even if you’re not really a morning person (honestly, who is though?), simply having a routine in place can be the difference between a wasted day and a creative day. Being organized decreases stress and leaves your mind clearer in the morning, ready to work on those ideas you already have and generate more.

Here are 7 morning rituals to kickstart your creative productivity!

1. Exercise

Getting active in the morning is one of the best things you can do for creativity. Whether you go for a run, squeeze in a few yoga poses, or you do some quick push ups, you’re breaking that dreaded cycle of waking up and traveling to work ⏤ the excitement of doing something active (or just something different) can lead to more creative insights. Vogue’s Anna Wintour plays tennis for an hour almost every morning at exactly 5:45!

Scientifically, exercise also encourages creativity in our minds by helping the blood flow to our brains and releasing endorphins, a neurotransmitter that leaves you feeling euphoric. A happy person is a creative person!

Morning exercise routines

2. Have a Shower

You may be one of those “wash the night before” types who would rather stay in bed for an extra 30 minutes, but what if showering in the morning could make you more creative?

Having a hot shower in the morning not only gives you that energy-boosting wake-up call, but it also releases dopamine, another neurotransmitter that increases our adrenaline and creativity. When we get in a hot shower it relaxes us and we become absent-minded to a degree, soaking up the pleasure we feel from the warm water.

This relaxed state of mind encourages the release of dopamine and gets our creative ideas flowing.

Alternatively, if you're brave enough, cold and contrast (hot for 2-3 minutes then cold for 1 minute and repeat) showers have also been suggested to boost creativity.

When cold water is poured onto our bodies, we get a shock and a rush of adrenaline. We take in more oxygen to try to warm ourselves and our heart rate also increases. This results in blood rushing through our bodies and giving us that energy boost and invigorated feeling we need to start the day with a buzz.

3. Open-Monitoring Meditation

Our interactions and experiences with the environment around us is what fuels us creatively, and inspires us, but sometimes we’re too overwhelmed and anxious to take notice of it. One type of meditation can change that.

Continue reading %7 Morning Rituals to Kickstart Your Creative Productivity%


by Rebeka Bergin via SitePoint

A Guide to Building Quality Angular 1.5 Components

In Angular 1, components are the mechanism which allows you to create your own custom HTML elements. This has been possible with Angular directives in the past, but components build on the various improvements that have been made to Angular and enforce best practices in how they are built and designed.

[author_more]

In this article, we're going to dig into the design of components and how to put them to use inside of your applications. If you haven't already started to use components in Angular 1, you can read about their syntax and design in one of our recent tutorials. My goal is to outline some best practices that will improve the quality of your application.

It should also be noted that many of the best practices of Angular 2 are brought into Angular 1 through the new components API, allowing you to build applications that are more easily refactored later. Angular 2 has influenced the way that we think about and design Angular 1 components, but there are still a number of distinct differences. Angular 1 is still a very powerful tool for building applications, so I believe it is worthwhile to invest in improving your applications with components even if you aren't planning or ready to migrate to Angular 2.

What Makes a Good Component?

Components should be designed with a number of key characteristics in mind to make them a powerful building block for your application. We'll dig into each of these in more detail, but here are the primary concepts components should adhere to.

  • Isolated - The logic of the component should be encapsulated to remain internal and private. This helps create less coupling between components.
  • Focused - Components should act as a single unit for one primary task, which makes them easy to reason about and often more reusable.
  • One-Way Binding - When possible, components should leverage one-way binding to reduce the load on the digest cycle.
  • Use Lifecycle Events - The lifecycle of a component starts with instanciation and ends with removal from the page. It is to best to hook into these events to maintain the component over time.
  • Well Defined API - Components should accept configuration as attributes in a consistent manner, so it is easy to know how to use them.
  • Emit Events - In order to communicate with other components, they should emit events with appropriate names and data.

Now let's start by looking at why and how components should be isolated and encapsulated from the rest of the application.

Components Should Be Isolated

The evolution of Angular 1 capabilities has been to enable isolated and encapsulated components, and for good reason. Some of the early applications were highly coupled with the use of $scope and nested controllers. Originally Angular didn't provide a solution, but now it does.

Good components do not expose their internal logic. Thanks to the way they are designed, this is pretty easy to accomplish. However, resist any temptation to abuse components by using $scope unless absolutely necessary, such as emitting/broadcasting events.

Components Should Be Focused

Components should take on a single role. This is important for testability, reusability, and simplicity. It is better to make additional components rather than overload a single one. This doesn't mean you won't have larger or more complex components, it simply means each component should remain focused on its primary job.

I've classified components into four primary groups based on their role in the application to help you think about how you design your components. There is no different syntax to build these different types of components — it is just important to consider the specific role a component takes.

These types are based on my 5+ years of Angular experience. You may choose to organize slightly differently, but the underlying concept is to ensure your components have a clear role.

App Components

There can be only one app component that acts like the root of your application. You can think of it like having only one component in the body of your web application, and all other logic is loaded through it.

<body>
  <app></app>
</body>

This is recommended primarily for Angular 2 design parity, so it will be easier to migrate some day should you wish. It also helps with testing by moving all of the the root content of your application into a single component, instead of having some of it in the index.html file. The app component also gives you a place to do app instantiation so you don't have to do it in the app run method, enhancing testability and decreasing reliance upon $rootScope.

This component should be as simple as possible. It probably will contain just a template and not contain any bindings or a controller if possible. It does not replace ng-app or the need to bootstrap your application, however.

Routing Components

In the past, we've linked controllers and templates in a ui-router state (or ngRoute route). Now it is possible to link a route directly to a component, so the component is still the place in which a controller and template are paired, but with the benefit of being also routable.

Continue reading %A Guide to Building Quality Angular 1.5 Components%


by Jeremy Wilken via SitePoint