Get your pen and paper ready. What do you think is the #1 ingredient for making the perfect team? Is it communication, technical expertise or a dash of something else. My slide deck with the answer to this golden question is available at bit.ly/the-perfect-team.
Is The Office a perfect team? The Office is classic TV series known for its slapstick comedy. However, it provides many anti-patterns of the perfect team. Let's start by discussing a few of those anti-pattern ingredients of the perfect team:
Fear - most of the employees in The Office went to work fearful if they made a mistake a co-worker would call them out and they may lose their job.
Bullying - Some employees took advantage of their power or intimidated the vulnerable characters in the office.
Name calling - Most employees were called names for their beliefs, habits or lifestyle.
Inappropriate jokes - These jokes made The Office a classic but are not meant for a "real" office.
Project Aristotle
Google's Project Aristotle was a research study to determine what makes a perfect team (see Figure 1). Project Aristotle analyzed data on inventive and productive teams. Their study spanned 2 years, 180 teams, 37,000 employees and they invested millions in the quest to find the answer to the golden question. With this much time and money invested my ears were wide open for the answer.
Figure 1. Google's Project Aristotle Study
Drum roll please... The answer is, psychological safety. Project Aristotle shows that the best teams at Google exhibit a range of soft skills: equality, generosity, curiosity toward the ideas of your teammates, empathy, and emotional intelligence. However, topping the list was emotional safety which has two key ingredients. 1) No bullying. And 2) to succeed, each and every team member must feel confident speaking up and making mistakes. They must know they are being heard. However, we desperately need the expertise of those who are educated to the human, cultural, and social as well as the computational.
Is your team perfect?
Take your team photo, place it in the picture frame in figure 2 and ask yourself, is this a perfect team? If not, share this study with your team, your department, or your company because the perfect ingredient is a handful of psychological safety.
Are efficient developers lazy or are lazy developers efficient? Ask this open ended question at your next interview and you will have an interesting conversation. While the goal is to improve performance, if we can do it in a lazy fashion (60 seconds or less) it's a win-win! This performance tip is rarely applied in our industry and we're all missing out! According to the 2019 State of the Web Report, only 14% of desktop site are using preload and about 1% are using prefetch.
preload
Preloading assets tells the browser to load critical assets earlier in the page loading lifecycle and as a result improves page load performance. Critical assets are the resources (JavaScript, CSS, images, fonts, etc) that are required to render the initial page or the displayable screen above the fold. For examples of preloading assets refer to Listing 1. It's very important to include the as attribute when preloading assets because it sets the content-type header, accept header, loading priority, and helps cache the asset for future requests.
A complete listing of the content types that can be preloaded are listed here.
Prefetching assets tells the browser to load these non-critical assets in the background after the page loading lifecycle has completed. As a result, these assets will be cached for future page navigations which greatly improves page load performance. For examples of prefetching assets refer to Listing 2.
How much can your site gain by preloading and prefetching assets? Find out using Lighthouse in Chrome's Dev Tools (see Figure 2). Check the "Performance" option and run the audit. Then refer to your estimated savings report to see your performance improvement opportunity (see Figure 3). A faster site will also boost your SEO score so this lazy technique has an additional benefit of boosting revenue!
Figure 2. Chrome's Performance Audit via Lighthouse Figure 3. Performance savings report by preloading and prefetching
How much can your company lose if your Search Engine Optimization (SEO) strategy is poorly designed? 87% in profit loss! That's right, Asos learned this lesson the hard way. Their root cause was attributed to a poor site redesign. Asos released 200 locale-specific versions of their site which negatively affected their search engine rankings and ultimately their profitability. How can we build an effective SEO strategy? Let's review a few basic and advanced techniques to keep our SEO and profits in the right direction.
SEO Fundamentals
Title tag - The most important SEO element is the <title>My page title</title> tag. The title's description becomes the pages title as shown in the search engine response page (SERP). The title tag may be up to 50 characters in length.
Meta description - The 2nd most important SEO element is the <meta name="description" content="My description text up to 155 characters..." > The meta content becomes your pages description as shown in the search engine response page (SERP).
Advanced SEO
We can now add structured data (JSON-LD) to our content which has multiple benefits: 1) It is an opportunity to show additional search engine response data. 2) It provides rich and meaningful information about our sites. For example, the new Software app component allows us to list our native mobile apps within our search results (see Figure 1).
Figure 1. Structured data for Software app listing (New)
The following are just a few of the structured data elements available today:
Will your site pass an SEO audit? Let's find out using Lighthouse in Chrome's Dev Tools (see Figure 2). Check the "SEO" audit option, run the audit, fix any errors, and your profits will soar!
How to Win Friends and Influence People by Dale Carnegie is one of the best-selling books of all time. I read this book in 2014 and since then I find myself referring to the notes from this book more than any book I own. The principles discussed within this book are timeless and apply equally well for teams as they do individuals. Why is this book so important for team health and team success? Dale Carnegie answers this question in his introduction when he explains why he wrote this book. He explains the #1 trait for success is human engineering or how well we work with people (see Figure 1).
Figure 1. Most valuable traits for success
Principles for Improving Team Health
The listing below contains all the principles Dale Carnegie discusses in his book. While each principle is very important I'm highlighting a few key points that also help grow healthier team relationships.
Part I - Fundamental techniques in handling people
Principle #1: Don’t criticize, condemn or complain.
Principle #2: Give honest, sincere appreciation.
Principle #3: Arouse in the other person an eager want.
Part II - Six ways to make people like you
Principle #1: Become genuinely interested in other people.
Principle #2: Smile
Principle #3: Remember that a persons name to them is the sweetest and most important sound in any language.
Principle #4: Be a good listener and encourage people to talk about themselves.
Principle #5: Talk in terms of the other persons interests.
Principle #6: Make the other person feel important and do it sincerely.
Part III - How to win people to your way of thinking
Principle #1: The only way to get the best of an argument is to avoid it.
Principle #2: Show respect for the other persons opinions. Never say you are wrong.
Principle #3: If you’re wrong admit it quickly and emphatically.
Principle #4: Begin in a friendly way.
Principle #5: Get the other person saying “yes, yes” immediately.
Principle #6: Let the other person do a great deal of the talking.
Principle #7: Let the other person feel that the idea is theirs.
Principle #8: Try honestly to see things from the other persons point of view.(Dale Carnegie said this was the most important thing to remember from the book!)
Principle #9: By sympathetic with other persons ideas and desires.
Principle #10: Appeal to the nobler motives.
Principle #11: Dramatize your ideas.
Principle #12: Throw down a challenge.
Part IV - Be a leader: How to change people without giving offense or arousing resentment
Principle #1: Beginning with praise and honest appreciation if you must find fault.
Principle #2: Call attention to peoples mistakes indirectly.
Principle #3: Talk about your own mistakes before criticizing the other person.
Principle #4: Ask questions instead of giving direct orders.
Principle #5: Let the other person save face.
Principle #6: Praise the slightest improvement and praise every improvement be hearty in your praise.
Principle #7: Give the other person a fine reputation to live up to.
Principle #8: Use encouragement and make the fault seem easy to correct.
Principle #9: Make the other person happy about doing the thing you suggest.
Favorite quotes for each highlighted principle
Don’t criticize, condemn or complain
When dealing with people we aren’t dealing with people of logic we are dealing with people of emotion.
Rewarding for good behavior is more productive than criticizing. Criticizing is futile.
Never insult or ridicule anyone. -Abraham Lincoln
Criticisms are like homing pigeons they always return home. Those you condemn will likely condemn you back.
If you want to gather honey, don’t kick over the beehive.
Don’t worry about the snow on your neighbors roof when your doorstep is unclean.
Give honest, sincere appreciation
There is only one way of getting someone to do something, make them want to do it.
Everyone likes a compliment. -Abraham Lincoln
The way to develop the best that is in a person is by appreciation and encouragement. Criticism from superiors kills ambition. -Charles Schwab
Lack of appreciation is why most people leave.
Appreciation is sincere. Flattery is telling people what they want to hear. Forget flattery, always use sincere appreciation.
Arouse in the other person an eager want
The only way to influence other people is to talk about what they want and show them how to get it.
Before you try to influence someone try to ask yourself, "How can I get them to want to do it".
The secret to success is to view things from the other person’s point of view as well as your own -William Ford
Arouse in the other person and eager want. Let them know how what I want will benefit them.
Smile
The expression you wear on your face is more valuable than the cloths you wear.
A smile says I like you or glad to see you. A babies smile has the same effect.
People rarely succeed at anything unless they have fun doing it. He said, one employee chose a small company because their voice on the phone was energetic and friendly.
Most people are as happy as they make their mind up to be. -Abraham Lincoln
Remember that a persons name to them is the sweetest and most important sound in any language
Personal story:
When I was an independent training consultant the first thing I did at the beginning of each class was write down the names of each student. Then, I'd refer to everyone by name via my hidden "name" cheatsheet. It was amazing how many positive comments I received in my evaluations in regards to this simple principle!
The only way to get the best of an argument is to avoid it
If you argue and win you'll never get your opponents good will. -Abraham Lincoln
If you win the argument you lose it. If you lose the argument you lose it. Always avoid an argument.
When two people always agree one of them is not necessary.
When we disagree we are communicating with someone that has similar interests.
Show respect for the other persons opinions. Never say you are wrong
If you can be right 55% of the time you can make a million dollars a day on Wall street. If you are only right 55% of the time how can you tell me I am wrong.
Be wiser than other people if you can but do not tell them so. -Lord Chesterfield
Never tell anyone they are wrong even if you know they are.
If you’re wrong admit it quickly and emphatically
Better to be told you’re wrong by yourself than from someone else.
Try honestly to see things from the other persons point of view
Try to honestly put yourself in the other persons shoes.
Ask why he or she would want to do it - this is thinking from their point of view.
For example, instead of yelling at boys for building an illegal campfire start by telling stories of your enjoyable campfire stories and then talk about how important it is to put the fire out afterwards. This approach is less threatening and is thinking from the others point of view.
Ask questions instead of giving direct orders
Say "You might consider this", or "What do you think of that"? Gives people a sense of pride.
People are more likely to accept an order if they have a say in the decision.
Give the other person a fine reputation to live up to
Give people a reputation to live up to and they will want to live up to that reputation.
For example, if you tell someone to keep up the great work they'll work hard to maintain that reputation.
The Vasa (see Figure 1) is one of the biggest architectural failures of all time. The Vasa was designed to be the most powerful armed vessel in the world - two full gun decks with 72 bronze cannons. Surprisingly, in 1628 this massive vessel sank only 1,400 yards into its maiden voyage because it was too top heavy. The Vasa was built for scale and power but had no agility. Structures built for scale or speed require different architectural strategies. Agile teams also require different team structures to achieve either scale or performance. Let's discuss the differences.
Scaling Agile
A Team of Teams strategy (see Figure 2) is an ideal structure for scaling agile. Refer to my 2-part series on Team of Teams to learn more about the key ingredients for scaling agile and several strategies we can implement to build more scalable agile teams.
Figure 2. Team of Teams structure for scaling agile
High-Performance Agile
Do you see any short-term limitations that will reduce performance in the Team of Teams diagram? It's the lines that represent communication. For example, would that diagram be easy to maintain if it was a dependency diagram? No, the overall coupling would be very high. That diagram violates the Law of Demeter and as a result becomes less efficient and more difficult to maintain. Am I saying a Team of Teams strategy is wrong? Not at all, the benefits out weight the disadvantages. However, if your organization has a business driver to complete a short-term project in record time our team structures must adapt to gain maximum team performance.
Figure 3. Decoupled team structure for high-performance agile
When speed becomes the #1 business driver for a short-term project a decoupled team structure (See Figure 3) promotes less distractions, more dedicated focus time, and higher quality. Furthermore, the team size is actually scaled down to reduce communication dependencies. To achieve more performance with fewer resources teams often employ higher skilled resources that are capable of handling multiple roles within the team.
How many concurrent users can your infrastructure handle? Do you know when your most critical features have regressed in performance? Will your website survive a Denial of Service attack? If you are unsure, Gatling's lightweight and powerful capabilities will help answer these questions.
Advantages of Gatling
Gatling is load testing as code which is ideal for integration with DevOps, Continuous Integration, and build tools.
Simulate thousands of requests per second against your APIs and applications.
Identify or troubleshoot performance and load issues.
Are your APIs and website C10k compliant? Determine how many concurrent users your infrastructure, APIs, and applications can handle.
Test your public APIs and applications against Denial of Service attacks.
Automatically generates an exhaustive, dynamic, and colorful report with high-precision metrics.
Performance is measured in percentiles which is more reliable than averages.
$GATLING_HOME/user-files/simulations (directory for your Scala load tests)
$GATLING_HOME/user-files/resources (directory for your users.csv file if you need a load test with multiple unique authenticated users)
Running your first load test (5 minutes)
Copy/Merge the user-files directory from my GitHub repo to your local $GATLING_HOME directory. The $GATLING_HOME directory will be your Gatling download directory. Refer to the user-files/simulations directory for tests.
Run Gatling locally as a standalone application by running the following command:
On Linux/Unix: $GATLING_HOME/bin/gatling.sh
On Windows: %GATLING_HOME%\bin\gatling.bat
Gatling will prompt a few questions:
Which test to run? Choose any test simulation to run.
Enter an optional test description? Hit enter to skip.
When the simulation is done, the console will display a link to the HTML reports.
Load Test Examples
Refer to the user-files/simulations directory for test examples. I have a few authenticated and unauthenticated load tests for REST APIs and a website. The authenticated tests refer to user data (users.csv). The Gatling installation also has several load tests for Web applications (refer to tests in $GATLING_HOME/user-files/simulations/computerdatabase).
Load test reports are automatically generated in $GATLING_HOME/results when your load test completes. Refer to the console when your test finishes for the full path. Gatling creates beautiful charts!
Feature flags are ways to control the full lifecycle of your features. They allow you to manage components and minimize risk. You can do pretty cool things like roll out features to certain users, exclude groups from seeing a feature, A/B test, and much more. Basically, deploy when you want and release when you’re ready. In this In this presentation we'll discuss the following topics:
If a Team of Teams methodology can win a war on terrorism imagine the benefits our IT organizations would gain by applying its principles to software development. This article is part 2 in my series on Team of Teams. Part 1 highlights General McChrystal's transformation to a Team of Teams and its benefits. Part 2 focuses on strategies we can adopt to help transform IT organizations into software development Team of Teams.
Which intersection below most closely resembles a Team of Teams? A free flowing intersection with self-driving cars (see Figure 1) or a traffic light controlled intersection with traditional cars (see Figure 2)?
Comparing self-driving vs traditional cars from a Team of Teams perspective
Self-drivingcars
Traditionalcars
Notes
SharedConsciousness
Yes
Limited
Self-driving cars are constantly communicating their route and speed in realtime. Traditional cars are limited because they can only communicate their route via turn signals.
Trust
Yes
No
Self-driving cars have trust because of their constant sharing of accurate information. It's difficult to trust traditional cars because they are unpredictable and have limited information sharing.
Empowerment
Yes
No
Self-driving cars are empowered to proceed full-speed through the intersection because of their shared communication and trust. Traditional cars must wait for a green light (command structure) to proceed due of their limited trust and information sharing.
Why Software Development Team of Teams?
How efficient is your team able to release a small task to production? After adopting a Team of Teams methodology the General’s teams were able to go from intel to strike within an hour. Their efficiency gains allowed them to execute 17 times more raids per month. Our goal should be the same - from requirement to release within a few hours resulting in 17 times more releases a month. Let's review the top strategies we can apply to build stronger and more efficient software development Team of Teams.
Bake craftsmanship (continuous improvement) into the process
Do you think the General's teams didn't train, condition or workout? It's part of their lifestyle and built into their process. I classify craftsmanship in two categories: training and refactoring (enhancements, defects). The The Phoenix Project ( p229) recommended an allocation of 20% for continuous improvement activities. Create a backlog exclusively for these types of tasks and empower your teams to continuously improve their skills, process, and software.
Reduce batch size
When the task force launched a mission their goals were small, precision strikes. Small strikes improved their frequency (10 strikes a day). If your teams are fortunate enough to have the efficiency of a CI/CD pipeline then the only limiting factor to daily releases is batch size. Try releasing at least every iteration or more often (daily). Frequent releases promote speed to market, reduce risk, are simpler to manage, and produce quick wins building team morale. Teams must be empowered to reduce batch size. CI/CD pipelines provide little value if releases are monolithic.
"Power up" to improve team health
Have you ever played Fortnite? Many of the team strategies applied in this battle royale game apply well to software development. One strategy in particular is the “power up” strategy or boosting your teammates health when they are running low. On a software development team we can boost the health of the overall team by information sharing and paired programming. The most effective team I have been on was a client project in 2003. This project had around 30 developers and we were required to pair program 100%. Pairs needed to rotate drivers and a new partner was required for the the morning and afternoon sessions. Software quality was very high and knowledge sharing with a new partner was an effective way to "power up" the resources across the team. Paired programming improves craftsmanship (continuous improvement), reduces defects, improves information sharing, and builds trust.
Transparent leadership
Having a transparent leader that posts frequently on Twitter isn't all bad. Has our president read Team of Teams? General McChrystal said his transparency (all calls on speakerphone and O&I briefings with thousands) saved many lives. In addition, his transparency greatly improved trust and shared consciousness across all teams. Perhaps we should try the same techniques. Would transparency and trust improve if we removed all cubicle walls, removed all office doors, replaced all phones with speakerphones, and made everyones calendar transparent?
Build a liaison program
A liaison program was General McCrystal's primary strategy for building trust across his teams. From a development perspective, liaison programs are opportunities to join other teams for short-term projects or assignments. In addition to improving trust these opportunities also expose developers to alternative coding practices, techniques, and team dynamics. Furthermore, moving cheese or trying new cheese often sparks new learning and growth opportunities from a team and individual perspective. Teams without a mature shared consciousness will be very resistant to this type of change highlighting a flaw within their own team. Anyone adopting new cloud or platform technologies? What better way to learn than actually join their teams for several iterations.
Continuous gardening
Managers have the most important role in regards to tending our Team of Teams. In particular, they need to provide water, fertilizer, and weed control for the resources across the teams:
Water - growing trust and transparency. Water is the most important ingredient. A garden will not survive without water and a Team of Teams will not exist without trust and transparency.
Fertilizer - building "power up" opportunities for resources to learn and grow. Resources won't reach their full potential if they are not given the opportunity to grow and learn. In addition, incentivize developers to attend conferences or meetups, watch YouTube developer channels, or contribute to open source.
Weed control - eliminate rubber stamps and command structures that reduce team productivity. Without weeds teams will become more empowered and efficient.
Build an empowerment radar
Does your team have high, medium or low empowerment? Document rubber stamps, command structure decisions, and shared consciousness limitations that impede a free flowing software development life cycle. Then, tend the garden to remedy those limitations. Remember, empowerment fuels motivation - an individual or team who makes a decision becomes more invested in its outcome. The goal is to eliminate these impediments so your team can become as efficient as self-driving cars.
A Team of Teams is, "An organization within which the relationships between constituent teams resembled those between individuals on a single team: teams that had traditionally resided in separate silos would now have to become fused to one another via trust and purpose” (p132). To win the war on terrorism General McChrystal was quick to realize their traditional management style and team dynamics (see Figure 1) needed to adapt to keep pace with the more agile and adaptive Al Qaeda enemy in Iraq. This article is part 1 in my series of Team of Teams. Part 1 highlights General McChrystal's transformation to a Team of Teams and its benefits. Part 2 focuses on strategies we can adopt to transform IT organizations into Software Development Team of Teams.
Figure 1. From Command to Team of Teams
Why Team of Teams?
General McChrystal's teams (SEALs, Army Special Forces, Rangers) were able to execute operations 17 times faster. With their old command structure they managed 18 raids per month; with a Team of Teams they preformed 300 raids a month. These efficiency gains were the direct result of their improved information sharing, trust, and empowerment resulting in more effective decision making.
The Ingredients
A Team of Teams strategy is built upon three key ingredients: shared consciousness, trust, and empowerment (see Figure 3). Let’s review each and highlight the implementation strategies General McChrystal’s adopted to transform an organization of thousands across 70 remote locations.
Figure 3. Team of Teams ingredients
Shared Consciousness
This ingredient is a generalized awareness about what other teams are doing and sharing information. The book reviewed two tragic examples that were direct results of failed shared consciousness - the Apollo project and GMs faulty ignition switch. Both examples highlight the importance of shared consciousness on critical projects.
How much time should we allocate to information sharing across teams? The best answer I found was this quote pertaining to the Apollo project, "Specialists continued to do specialized work, but they needed an understanding of the project as a whole, even if establishing that understanding took time away from other duties and was, in some ways, “inefficient”. NASA leadership understood that, when creating an interactive product, confining specialists to a silo was stupid: high-level success depended on low-level inefficiencies. Even the engineers most ardently opposed to systems management found that many technical problems could be solved only by sharing information" (p149).
Here are a few strategies General McCrystal applied to improve their shared consciousness:
They moved teams to open workspaces (p159).
General McCrystal never used his private office, instead he sat in their open workspace and took all calls on speakerphone for everyone to hear (p163).
They had a daily O&I (operations and intelligence) briefing that was the core of their transformation. This meeting pumped information about the entire scope of operations to all members of the Task Force and partner agencies. It also offered everyone the chance to contribute. The O&I was a hour and a half video conference across seventy remote locations with thousands of people (p171, p227-228).
They didn't want all teams to become generalists. Rather, they wanted to fuse generalized awareness with specialized expertise (p153).
Trust
Trusted relationships across teams is a positive enabler for information sharing and promotes team empowerment. Trust is the most important ingredient of the three. Without trust shared consciousness and empowerment will not exist.
Here are a few strategies General McCrystal applied to improve their trust:
To build trust between the different teams (SEALS, Army Rangers, Army Special Forces) they took one member from each team and embedded them on the others for 6 months. Each group was incentivized to send their best resource because they were representing their organization. There was great resistance to this but as a result the teams built stronger connections (p176).
More than directing, leaders must exhibit personal transparency. Team members must be allowed to monitor the leader. This is the new ideal (p232). The General's transparency was demonstrated during their O&I briefings, open workspace participation, and broadcasting calls on speakerphone.
Empowerment
Empowerment is when leadership gives the team approval in decision making. When Task Force units (SEALS, Army Special Forces, Rangers) would wake up General McChrystal for air strike approval he’d always ask if they wanted him to approve the strike. Life or death decisions confirmed the role as an important leader but the General often questioned his value in the process because he’d rarely have groundbreaking insight. His approval was a rubber stamp that slowed the process.
Here are a few strategies General McCrystal applied to enable empowerment:
With shared information teams could “do the right thing” rather than “do things right”. People at every level of the organization had the information and connectivity to determine what the right thing was, in real time. But, held back by their internal processes, they lacked the ability to act on that determination (p203).
The General was always ultimately responsible and more often than not those below him reached the same conclusion. This way their team would be empowered to do what was needed (p209).
Eventually a rule of thumb emerged: "If something supports our effort, as long as it is not immoral or illegal," you could do it (p214).
An individual or team who makes a decision becomes more invested in its outcome (p215).
Sustainable Garden
With our three key ingredients in hand, the most important step is growing and maintaining the sustainable garden (see Figure 4). This becomes the primary responsibility for leaders. General McChrystal spent most of his efforts growing and maintaining his Team of Teams. Without constant watering, fertilizing, and weeding the garden becomes unsustainable and breaks down.
Figure 4. Leaders tend the sustainable garden
With three key ingredients, cultural change, transparent leadership and continuous gardening the General's Task Force transformed itself into an organic entity that dramatically improved their speed and precision. In part 2, we'll focuses on strategies we can adopt to transform IT organizations into Software Development Team of Teams.
What are the characteristics of a successful app? Is it revenue, number of downloads, app rating, active user count, or your crash-free rating? While each metric plays a role in overall success the important factor is we have the ability to improve the metrics that are most valuable to us. For example, a primary goal for our HealthPartners app this year was to improve our 3.8 app rating. Let's explore the strategy we applied at HealthPartners that improved our app rating to 4.6 in just 12 days. This strategy is actually easier done than said.
Identify the top 3 'Make Good Happen' moments in your app
The most important tip for a successful user review is a timely prompt after the user has finished a simple and valuable workflow. For example, in our HealthPartners app we identified these following workflows as our top 'Make Good Happen' moments:
After a user refills a prescription
After a user schedules a clinic appointment
After a user submits an account reimbursement
After users complete these simple and valuable workflows they will be more likely to submit a positive app review. According to our iTunes Connect metrics 93% of our reviews have been 4 stars or higher.
App ratings
Trigger app review prompt
Prompting an app review requires minimal code.
if #available(iOS 10.3, *) {
SKStoreReviewController.requestReview()
}
Apple released their rating and review capabilities in iOS 10.3. Therefore, a version check is necessary if you support a prior iOS version. Otherwise the requestReview() trigger is quite simple. However, Apple will only trigger a prompt within your shipped app 3 times a year. Apple's requestReview() algorithm ultimately determines the frequency and timing of the actual prompt.
Limit app review prompt to core users (optional)
Since it's not clear when Apple may display the review prompt I wanted to avoid an app review prompt for first time users. A core user or returning user is more likely to provide positive feedback. Therefore, I limited the review prompt to core users.
App rating trends mashup
Appbot recently published an article comparing app rating trends titled, "Has iOS 11 really affected star ratings?". I performed a mashup and included HealthPartners within their rating diagram to gather a greater perspective of the improvement our app has experienced.
Are these tasks easier done than said? Simply add review prompts to your apps top 3 'Make Good Happen' moments and your ratings will improve dramatically too.
Imagine eating all the ice cream you ever wanted and not gaining a pound. There's a classic Seinfeld episode about this dream and they eventually learned it was too good to be true. If you've ever used Apple's subtitle cell you may have experienced similar disappointment. The default subtitle cell is adaptive but it does not support self sizing and therefore it is not accessible. If accessibility is a requirement on your projects then the only option is to create a custom Subtitle cell that supports both adaptability and self-sizing.
Adaptive & Self-Sizing Custom Subtitle Cell
An ideal subtitle cell should be both adaptive and self-sizing (see Figure 1). As shown, this custom subtitle cell adapts to support many different configurations. Most importantly, it supports self-sizing - the cell automatically grows to fit the available content and it will grow based on font size adjustments. Now that our cell is also accessible we can certify it fat free!
Figure 1. Adaptive and self-sizing subtitle cell examples
Default Subtitle Cell
In comparison, the default subtitle cell when loaded with the exact same content as shown previously is not accessible (see Figure 2). Unfortunately, this option doesn't pass the fat free certification test.
Figure 2. Non-accessible Default Subtitle Cell
Custom Subtitle Cell Layout
The auto layout configuration for the custom subtitle cell is very lean (see Figure 3). The Stack Views implicitly manage adaptability and the text labels are configured to support self-sizing.
Figure 3. Custom Subtitle Cell Layout
Custom Subtitle Cell Configuration
The custom subtitle cell will adapt based on its configured cell data (see Figure 4). This custom subtitle cell and entire demo is available on my GitHub repository.
Want to learn quick tips that will improve your apps performance and load time? In this presentation, we’ll explore the latest Swift techniques we can apply to create faster iOS apps. Topics discussed will include:
The three dimensions of performance:
Allocation (stack vs heap)
Reference counting (less vs more)
Method dispatch (static vs dynamic)
Is Swift faster than Objective-C?
Are structs faster than classes?
Is inheritance faster than protocol extensions?
Grand Central Dispatch patterns
Whole module optimization and more
Source Code and Demos
Many of my performance tests are available as Gists. Refer to the slides "Gist" Link in the lower left - Enjoy!
Slide Deck Sneak Peek
Dimensions of performanceEnable Whole Module Optimization
Avoid for-inGrouping work requests
Looking for even more performance tips? The Swift team has an excellent post with even more Swift Performance Tips.
"It’s time to upgrade". That’s a common theme you’ll hear if you watch Street Outlaws on the Discovery Channel. Their goal is simple - be the fastest car on the street or it’s time to upgrade. They are continuously looking for ways to boost the performance of their cars (nitrous, turbos, fiberglass panels, etc). Some performance mods are quick and others take time to implement and refine. In this post, let's focus on Swift performance improvements we can implement and release rather quickly. In fact, most of these improvements should only cost a story point or two:
Mark classes final
A final class will explicitly enable static dispatch for all methods which allows the compiler to optimize methods at compile time resulting in more efficient method invocation at runtime. There are two types of method dispatch: static and dynamic. Dynamic dispatch (the default type of method dispatch) is not as efficient because its dispatch isn’t known until runtime. Dynamic dispatch provides runtime conveniences like polymorphism, inheritance, and overloading but incurs a higher performance penalty. Therefore, by simply marking classes final we get a minor performance boost rather quickly. Refer to Apple’s Understanding Swift Performance talk for additional details.
Prefer isEmpty over count > 0
The native isEmpty method is more efficient because it only verifies one element exists where as the count property iterates the entire collection. Want to enforce this efficient practice within your codebase? SwiftLint has a static analysis check for this rule.
When creating Swift objects it’s important to understand how much an object or property weighs in regards to these three dimensions. For example, a String is not an efficient type because it is allocated on the heap and it incurs a reference count. Comparatively, Enums are much more efficient because they are allocated on the stack, do not incur a reference count, and as a bonus they are type safe resulting in a win-win-win. Interested in automatically converting your localizable strings, asset names, or storyboard names to enums? SwiftGen has accomplished this task nicely on my projects.
Import existing images from the file navigator into an asset catalog
An asset catalog is preferred because it caches images, optimizes memory consumption, and enables lightweight App Store downloads via App Thinning - unnecessary image densities are not downloaded. Xcode has a wizard for automatically importing images into an asset catalog rather quickly. Refer to Apple’s Improving Existing Apps with Modern Best Practices talk for additional details.
Parse JSON on a background thread
This allows the main thread to remain idle to serve other threads while the JSON is transformed to an object. Refer to Apple’s Concurrent Programming with GCD in Swift 3 talk for more details.
let json = [String : Any]()
let dataTrasformQueue = DispatchQueue(label: “my.data.trasform.queue”)
dataTrasformQueue.async {
let result = T(json: json) // Transform JSON to object on background thread
DispatchQueue.main.async {
completionHandler(result) // Return control to main thread after object is parsed
}
}
Prefer structs over classes (until you reach their point of diminishing returns)
Structs have many advantages over classes: they are allocated on the stack, they prevent unintended sharing, their memberwise initializer is a nice convenience, and a struct by itself doesn't incur reference counting. However, a structs properties will incur reference counting when they are reference types like String. Therefore, structs have a point of diminishing returns in regards to reference counting that multiplies proportionally by their number of properties which are reference types. A struct containing more than 2 reference types begins to incur a higher reference count than a comparative class. Refer to Apple’s Understanding Swift Performance talk for additional details.
Rewrite Objective-C objects in Swift
Refactoring Objective-C objects to Swift was the primary theme in Apple’s Optimizing App Startup Time talk. This tip barely makes the list for “busy developers” because the scope of this task may be large depending on your codebase but it’ll become more manageable by focusing on converting one Objective-C class per week or iteration.
Summary
The fastest car doesn't always win. The quickest car from start to finish does. A driver and the adjustments they make to their car has a huge impact on their performance. The tips above are quick adjustments we can make to our Swift code so our apps will be more efficient from point A to point B.