Introduction to Scrum and Management (Part 4 of 5 or 6)

Our story so far: in part 3 I described the Scrum team as a data structure—an undirected graph. I tried to show how the properties of an undirected graph predict how a Scrum team behaves and how it can be optimized for productive behavior. Part of that optimization is keeping teams small, eliminating hubs, and breaking the sprint if anything doesn’t go as planned. Undirected graphs are harsh but if we respect them, they will reward us.

Today we’re looking at the third major data structure of Scrum: the story point. OMG! Let me just say that story points are the most powerful and most misunderstood idea in Scrum. Because story points are expressed as integers, its hard for even for experience engineering managers like me not to mistake them for integers.

The story point

This series of blog posts has become for me, my own A Song of Ice and Fire. Author George R.R. Martin originally estimated that he was writing a trilogy. But as Martin started writing, the series became six and now seven books. Honestly, I don’t trust Martin’s estimate of seven books. Given how popular “Game of Thrones” has become, if Martin lives forever, I expect he will be writing ASOIAF books forever.

When I started out writing an Introduction to Scrum and Management, I took my detailed notes from reading Jeff and JJ Sutherland’s book Scrum: The Art of Twice the Work in Half the Time and estimated I could express myself in three blog posts, maybe four just to be on the safe side. I need to time box my projects as spending too much time on any one project steals valuable time from others. As you can see from the subtitle of this post (Part 4 of 5 or 6) my estimate of the number of parts continues to increase. My project is over budget and the final post is delayed!

Jeff Sutherland, a good engineering manager, knows that people are terrible at estimating effort. Sutherland knows that less than one third of all projects are completed on time and on budget. He also knows that there are many reasons for this (poor work habits, under- or over-resourced teams, impediments that never get addressed) but the root cause is our inability to estimate timing (unless we have done the task before and have transformed it into a repeatable process).

The problem with writing fantasy novels and software is that they are not repeatable processes.

This is why Sutherland invented story points and George RR Martin still write his novels with WordStar running on a DOS PC. Since Sutherland and Martin cannot control the creative process, they put constraints around it.

The story point was invented by Jeff Sutherland because human beings really can’t distinguish between a 4 and 5. Jeff was looking for a sequence of numbers where the difference between each value was intuitive. Jeff realized that the Fibonacci numbers, a series of numbers that are known as the Golden Ratio, were the perfect candidates to do the job of estimating work. Art lovers, architects, mathematicians, and scientists, all agree that the world around us is built upon a foundation of Fibonacci numbers.

I could muse for endless paragraphs on how Fibonacci numbers are so elegant that they enable artists and artichokes alike to create beautiful compositions. But let’s just take Fibonacci numbers for granted and see how they are used to implement story points.

Here are the first eight Fibonacci numbers. It is easy to see that as the numbers increase in value the difference between each number increases. This acceleration in difference is in harmony with our ability to detect fine differences at a small scale but not a large scale.

1, 1, 2, 3, 5, 8, 13, 21

Each number in the sequence is the sum of the pair of numbers that immediately proceed it. You can do the math if you don’t want to take my word for it!

A diagram of Fibonacci squares shows the magnitude of Fibonacci progression nicely.

But let’s back up a bit. Why do we need Fibonacci numbers? We’re developing software not paintings or artichokes!

In Scrum a story is a simple description of a chunk of work to do. A sprint is a repeating and limited duration of time in which to do work. Since the work to be done is creative, it can’t fully be understood until the worker is doing it. Thus Scrum constrains process of doing the work but not the work itself.

In summary

  • Stories constrain the definition of work
  • Sprints constrain the time allotted to work
  • Story points constrain the amount of work based on a story that is planned to be executed during a sprint.

If you have done something before, and absolutely nothing has changed, then you don’t need story points. But almost all software development projects involve new requirements, new technologies, and new techniques. When planning a software development project, the big problem is where to start. It’s hard to know how to break down a big project into nicely workable chunks.

Story points get the developers and product owner talking about where to start and how to break the problem down. In discussion during the sprint planning meeting, 13-point stories are broken into several 8-point stories. 8-point stories are broken down into many 5-pointers. And so on until all that is left are dozens if not hundreds of 1-point stories (which are, by their nature, very well understood stories).

Scrum masters and engineering managers know that a 13-point story isn’t dividable into one 5-pointer and one 8-pointer! A backlog of story points is not communicative, associative, or distributive like the ordinary numbers we grew up with. Story points can’t be added, subtracted, multiplied or divided together.

We also know that one team’s 13-point story is another team’s 21-point story. Story points are relative to the team, they change in value as the team gets better (or worse), and are not comparable unless the same people have worked together on the same project for hundreds of sprints.

As a data structure the enumerated values of story points are a wonderful set of flags, where the different between each flag is intuitive. Story points are signals not units.

Alright, this blog post was a bit long but in my defense story points are a nuanced concept. I think we’re just about at the end–which should be a relief to all of us. The good news is that my ability to estimate has significantly improved by doing the work. In the next blog post I’m going to talk about the Algorithms of Scrum.

Introduction to Scrum and Management (Part 3 of 5 or 6)

Ah, I can see from those weary, sleepy eyes, that like me, you are obsessed with improving your team’s WIP (work in progress). Stick with me and we’ll get to the bottom of the productivity conundrum with the power of our computational thinking!

In part two, I listed the three data structures and four algorithms of Scrum as described in Jeff and JJ Sutherland’s book Scrum: The Art of Twice the Work in Half the Time. I also dug deeply into the first data structure, the prioritized backlog, which from a computer science POV looks a lot like a sorted queue. I explained that if you don’t treat the backlog exactly like a queue you break your sprint and have to throw your sprint planning away and start over. Accessing an end of a queue enables O(1) efficiency. Accessing some random element in a queue… well let’s just say there be dragons of O(unknown).

In today’s blog post we’re going to look at the second data structure of Scrum, the team (an undirected graph). Like a queue, I’ll show that if you don’t treat this data structure with respect your Scrum process will fail, your sprints will leave story points on the table, and your stakeholders will demand status reports and commitments to dates!

The team

Every Scrum team is a communications network where the nodes are the people and their communication patterns are an undirected graph. Undirected here means there is no direction to the edges between nodes. Undirected communication is what you want in a Scrum team.

In the Waterfall days a manager would get all the requirements, analyze the work, and dole it out to the team members. If a team member had a question, she had to ask the boss for clarification. That kind of communications network is known as a directed graph and in particularly bad organizational patterns it becomes hub and spoke where bosses talk to bosses and team members talk to bosses and all communications require one or more hops before an answer arrives. This creates latency (delays in responses) and error (as each hop adds the opportunity for misunderstanding). 

Scrum avoids the hub and spoke model by eliminating the manager role. Any team member can talk to any other team member. Manager approval is not needed or even available. There are no hops and questions can be answered in real-time.

There is, however, a downside to a communications network based on an undirected graph model: limited scale.

Growth of Nodes and Edges in an Undirected Graph

If the team has 1 person, she only has to communicate with herself—which I assume is a low latency, high bandwidth connection. If the team contains 2 people, there is 1 bi-directional communication connection, or edge, between person 1 and person 2. 

So far so good! But as you add people to the team the number of potential connections between them increases with an accelerating growth rate of n * (n-1)/2. If we drop all the constants, we get O(n^2)—quadratic complexity. This means with each additional team member, communications become more and more difficult—if not impossible.

A team of 10 people creates an almost intolerable communications situation! There are 45 possible edges in an undirected graph with 10 nodes. This means a great deal of potential chatter, as many as 45 conversations happening simultaneously, with each person having to juggle threads with up to 9 other people. This also means treaded conversations in a large chat room become unreadable.

Large Team Communications Scale

Jeff Sutherland knows all this. He’s a CTO. Scrum, as Jeff created it, requires you to keep the team small. As small as possible. 

This is also why you can often speed up a project by reducing the number of people involved. If a team of 10 is reduced to 8, then there are roughly 38% less possible conversations and each team member only has to ask up to 7 people (in the worst case) a question before she finds someone who can give her the answer. Theoretically, 8 people will accomplish less story points per sprint than 10 people. In practice communication efficiency gives a real-world advantage to the smaller team.

Small Teams Communications Scale

I want to empathize that not having a hub (a boss) and keeping the team small (less than 10) are hard requirements of Scrum. If you need a bunch of managers (engineering manager, project manager, scrum master, product owner) supervising the team you’re adding latency, error, and hops to your undirected graph. This is also why the ideas that the “product owner is the CEO of the team” or that the “Scrum master is the Engineering Manager” are bad ideas.

Now wait a minute, Mr. Pavley! We need all these bosses! What if something goes wrong during the sprint? What if a story is wrong? What if new work comes in? What if an engineer needs help that her team members can’t supply?

Break the sprint. Redo the plan. Start over. Design a new team and a new backlog. Before and after the sprint bring in all the bosses you want! Just leave the team alone during the sprint.

If you are still as excited as I am about getting Scrum to actually work as advertised, the next installment of Introduction to Scrum and Management will explore story points and Fibonacci numbers, the best numbers in the whole world!

And here is part 4!

Introduction to Scrum and Management (Part 2 of 4 or 5)

Welcome back! In part one, I expressed my dismay that Scrum was conceived with no formal role for management, especially not Engineering Management. I also claimed that Scrum is Agile, that Scrum is not dead, and that Scrum was created long before the hyperconnected Internet we now inhabit came into being. I found that Jeff and JJ Sutherland’s book, Scrum: The Art of Doing Twice the Work in Half the Time, helped me, after years of supporting Scrum, actually understand Scrum.

In this blog post I want to dig a little deeper into how Scrum works from an engineering perspective. When I told my team (in our internet chat room) that I was reading the Sutherlands’ book, one of the comments I got went something like this: “2x the work in 1/2 the time… that sounds too good to be true!”

And you know something? The that engineering manager was right: “Twice the work in half the time” is what a gonzo diet supplement promises. Any engineer with good critical thinking skills is going be skeptical of a process that promises to break the laws of Physics.

But Scrum is not snake oil. I’ve seen it work time and time again. I’ve also seen it fail. What separates a successful Scrum process from an unsuccessful one? And by what mechanism does Scrum accelerate work? Let’s find out!

As an engineer I think of any system, even a human run system like Scrum, in terms of data structures and algorithms. These are the building blocks that determine how a system will scale deal with bottlenecks. We can even apply Big O analysis to Scrum and see if we can predict where it will be efficient, O(1), and inefficient, O(n!).

Scrum at its heart is a computational model for work. In this model Scrum has three primary data structures and four primary algorithms.

Data StructuresAlgorithms
The prioritized backlog (a sorted queue)Sprint (outer loop)
The team (an undirected graph)Planning Poker (pre-condition)
Story points (a set of Fibonacci values)Daily Standup (inner loop)
Retrospective (post-condition)

The well-known properties of these data structures and algorithms help Scrum operate efficiently but also point to why Scrum is hard to scale. 

The prioritized backlog

A sorted queue is very fast to access: no searching needed. You dequeue one end to get the current element and enqueue the other end to add a new element. As long as you don’t randomly access elements in the middle of the queue you are always assured to get the element with the highest priority–If the elements are added to the queue in order of priority during the sprint planning process. Access is O(1), aka constant time, whether there is one or one million stories.

This is why Scrum requires the backlog to be locked during the sprint: any addition or subtraction means that all your planning efforts were for naught. Changes to the backlog during the sprint is like randomly accessing the elements of a queue. It means that your story points are no longer relative, the team’s rhythm is broken, and predictability is compromised. This is why, if the backlog must change during the sprint, the sprint is “broken” and must be started over with a new queue of work to do. Range out of bounds error

I don’t know about you, but it’s hard to get the team, including the Scrum Master and Product Owner, to break a sprint. We all just sheepishly adjust the backlog. This is especially true when a high priority story becomes blocked and an engineer is sidelined. Instead of breaking the sprint and re-planning, the engineer is usually told to just grab the next story in the backlog–which ruins the whole queue. Access out of bounds error

Right here we can see a hint of a deep computer science basis to Scrum as it was originally conceived by Jeff Sutherland and his co-creators. We can also see why it’s important to stick to the original conception to get the benefits. If you’re not breaking sprints and if you’re access stories randomly during a sprint the efficiency of this part of the process jumps from 0(1), which is a good as it gets, to some other O(n) like O(n^2) or the dreaded O(n!). Take it from an Engineering Manager: you don’t want to go there!

In the next post we’ll take a hard computational look at the scrum team and prove that less team members is always better than more. If you want to speed up, remove members from the team!

Onwards to part 3!

Introduction to Scrum and Management (Part 1 of 3 or 4)

I just finished reading Scrum: the Art of Doing Twice the Work in Half the Time by Jeff and JJ Sutherland . Jeff Sutherland co-created Scrum in the 90s. JJ Sutherland is the CEO of Scrum Inc and works closely with his father. 

Prior to this, I’ve read the big thick technical tomes on Scrum, mostly published in the early 00s, and more blog posts than I care to admit. I’ve also practiced Scrum, at some level and in some form, for the last 15 years. I’ve adopted Scrum and adapted Scrum leading dev teams startups and large enterprises. But I’m not a Scrum master. I’m not trained or certified in Scrum. As is clear from Sutherland’s book, I’m the person in the role that Scrum wants to replace: the engineering manager. 

Even though the father-son team that wrote this less technical and more introspective Scrum book and run Scrum Inc have little use for managers like me, I like Scrum. I’ve seen amazing results from each Scrum practice that I’ve  supported. I was part of the management team at Spotify when we developed the famous Tribes, Squads, Chapters, and Guilds strategy of scaling an engineering culture. From my perspective, when Scrum works, it works well in every dimension. Developers and stakeholders are happy, work is visible and predictable, and products better fit their purpose. 

Curiously Scrum doesn’t like me and my kind—as a manager. And Scrum’s dislike is not unfounded: Most of the resistance to Scrum comes from management. As the Sutherlands note, even after a wildly successful Scrum implementation, it’s usually the managers who “pull back” from Scrum and return an org to “command and control”. I have personally not tried to claw back Scrum but I understand and sympathize with the impulse. 

In this series of blog posts I’m going to explore the relationship of managers and management to scrum masters and Scrum. I want to explore why Scrum left the management role out of the equation and why an elegant and powerful algorithm and data structure like Scrum is so hard to implement without destroying the aspects that make it work in the first place. Finally, I will give some tips to improve the Scrum process so that managers are not the enemy but rather the friend of Scrum.

Before we go I just want to point out that while I’ve read and watched plenty of blog posts, tweets, and YouTube Videos declaring that Agile is dead and that Scrum is Not an Agile Framework neither of these sentiments are true!

Agile and Scrum have problems, mostly because both were conceived with particular aspects of work culture ignored: like managers, governance, telecommunications, and large teams. Agile and Scrum were also cooked up before today’s highly mobile, remote-mostly, co-working culture became popular/possible. That Agile and Scrum have survived these transformations mostly intact points to the strength of these methods of human collaboration.

Agile is not dead and Scrum is a flavor of Agile. Let’s help them live up to their ideals!

Click here for Part Two

Big O Primer

This is what happens when you don’t know Big O

Introduction

Big O is all about saving time and saving space, two resources that computer algorithms consume to do repetitive jobs (like sorting strings, calculating sums, or finding primes in haystacks). Big O analysis is required when data points grow very numerous. If you need to sort thousands, millions, billions, or trillions of data points then Big O will save you time and/or space, help you pick the right algorithm, guide you on making the right trade-offs, and ultimately be enable you to be more responsive to users. Imagine if Google Search told users to grab a cup of office while searching for the best coffee shop… madness would break out!

You could argue that Big O analysis is not required when filling a few dozen rows with fetched data in a web view. But it’s a good idea to understand why a naive user experience can create a backend scaling nightmare. Product Managers, Designers, and Frontend Devs will want to understand and be able to discuss why fetching a fresh list of every customer from the database for every page view a bad idea. Even with caching and CDNs Big O leads to better system design choices.

Properties

There are three points of view on algorithm complexity analysis:

  • Big O: upper bounds, worst case estimate.
  • Big Ω: lower bounds, best case estimate.
  • Big Theta: lower and upper, tightest estimate.

The distinctions are literally academic and generally when we let’s do a Big O analysis of algorithm complexity we mean let’s find the tightest, most likely estimate.

There are two types of algorithm complexity analysis:

  • Time complexity: an estimation of how much time source code will take to do its job.
  • Space complexity: an estimation of how much space source code will take to do its job.

Most of the time we worry most about time complexity (performance) and we will happily trade memory (space) to save time. Generally, there is an inverse relationship between speed of execution and the amount of working space available. The faster an operation can be performed the less local space your source code has to work with to do it.

CPUs have memory registers that they can access quickly but only for small amounts of data (bytes and words). CPUs also have access to increasing slower but larger caches for storing data (L1, L2, L3). You, as a coder, usually don’t worry about CPUs, registers, and level 1, 2, or 3 caches. Your programming language environment (virtual machine, compiler) will optimize all this very low-level time and space management on your behalf.

Modern software programs, which I will call source code, live in a virtual world where code magically runs and memory is dutifully managed. As a coder you still occasionally have to step in and personally manage memory, understand what data is allocated to the stack versus the heap, and make sure the objects your source code has created have been destroyed when no longer needed.

Modern software applications, which I will also call source code, live in a virtual world where apps magically run and storage is autoscaled. As a system designer you’ll have to choose your virtual machines and storage APIs carefully—or not if you let managed app services and containerization manage all your code and data as a service.

Usage

Big O will help you help you make wise choices with program design and system design. Big O, like other dialects of mathematics, is abstract and applies to wide range of software phenomenon. Using Big O to optimize your source code means faster web pages, apps, and games that are easier to maintain, more responsive to the users, and less costly to operate.

Big O reminds me of Calculus and Probability! It’s all about estimating the rate of change in how your source code processes data over time. Will that rate of change get slower with more data? That answer is almost always yes! Big O helps you identify bottlenecks in your source code, wasted work, and needless duplication. Big O does this through a formal system of estimation, showing you what your source code will do with a given algorithm and a given set of data points.

There are even more bottlenecks that will slow down your app even if your algorithms are optimized using Big O. The speed of your CPU, the number of cores it contains, the number servers, the ability to load balance, the number of database connections, and the bandwidth and latency of your network are the usual suspects when it comes to poor performance in system design. Big O can help with these bottlenecks as well so remember to include these conditions in your circle of concern!

Big O estimated are used to:

  • Estimate how much CPU or memory source code requires, over time, to do its job given the amount of data anticipated.
  • Evaluate algorithms for bottlenecks.

Big O helps engineers find ways to improve scalability and performance of source code:

  • Cache results so they are not repeated, trading off one resource (memory) for another more limited resource (compute).
  • Use the right algorithm and/or data structure for the job! (Hash Table, Binary Tree, almost never Bubble Sort).
  • Divide the work across many servers (or cores) and filter the results into a workable data set (Map Reduce).

Notation

Big O notation is expressed using a kind of mathematical shorthand that focuses on what is important in the execution of repeated operations in a loop. The large number should be really big, thousands, millions, billions, or trillions, for Big O to help.

Big O looks like this O(n log n)

  • O( … ) tell us there is going to be a complexity estimate between the parentheses.
  • n log n is a particular formula that expresses the complexity estimate. It’s a very concise and simple set of terms that explain how much the algorithm, as written in source code, will most likely cost over time.
  • n represents the number of data points. You should represent unrelated, but significant, data points with their own letters. O(n log n + x^2) is an algorithm that works on two independent sets of data (and it’s probably a very slow algorithm).

Big O notation ignores:

  • Constants: values that don’t change over time or in space (memory).
  • Small terms: values that don’t contribute much to the accelerating amount of time or space required for processing.

Big O uses logarithms to express change over time:

  • A logarithm is a ratio-number used to express the rate of change over time for a given value.
  • An easy way to think of rate-of-change is to image a grid with an x-axis and a y-axis with the origin (x = 0, y = 0) in the lower left. If you plot a line that moves up and to the right, the rate of change is the relation between the x-value and the y-value as the line moves across the grid.
  • A logarithm expresses the ratio between x and y as a single number so you can apply that ration to each operation that processes points of data.
  • The current value of a logarithm depends on the previous value.
  • The Big O term log n means for each step in this operation the data point n will change logarithmically.
  • log n is a lot easier to write than n – (n * 1/2) for each step!
  • Graphing logarithmic series makes the efficiency of an algorithm obvious. The steeper the line the slower the performance (or the more space the process will require) over time.

Values

Common Big O values (from inefficient to efficient):

  • O(n!): Factorial time!
    Near vertical acceleration over a short period of time. This is code that slows down (or eats up a lot of space) almost immediately and continues to get slower rapidly. Our CPUs feel like they are stuck. Our memory chips feel bloated!
  • O(x^n): Exponential time!
    Similar to O(n!) only you have a bit more time or space before your source code hits the wall. (A tiny bit.)
  • O(n^x): Algebraic time!
    Creates a more gradual increase in acceleration of complexity… more gradual than O(x^n) but still very slow. Our CPUs are smoking and our memory chips are packed to the gills.
  • O(n^2): Quadratic time!
    Yields gradual increase in complexity by the square of n. We’re getting better but our CPUs are out of breath and our memory chips need to go on a diet.
  • O(n log n): Quasilinear time!
    Our first logarithm appears. The increase in complexity is a little more gradual increase but still unacceptable in the long run. The n means one operation for every data point. The log n means diminishing increments of additional work for each data point over time. n log n means the n is multiplied by log n for each step.
  • O(n): Linear time!
    Not too shabby. For every point of data we have one operation, which results in a very gradual increase in complexity, like a train starting out slow and building up steam.
  • O(n + x): Multiple Unrelated Terms
    Sometimes terms don’t have a relationship and you can’t reduce them. O(n + x) means O(n) + O(x). There will be many permutations of non-reducible terms in the real world: O(n + x!), O(n + x log x), etc….
  • O(log n): Logarithmic time!
    Very Nice. Like O(n log n) but without the n term so it a very slow buildup of complexity. The log n means the work get 50% smaller with each step.
  • O(1): Constant time!
    This is the best kind of time. No matter what the value is of n is, the time or space it takes to perform an operation remains the same. Very predictable!

Analysis (discovering terms, reducing terms, discarding terms):

  • Look for a loop! “For each n, do something” creates work or uses space for each data point. This potentially creates O(n).
  • Look for adjacent loops! “For each n, do something; For each x, do something” potentially creates O(n + x).
  • Look for nested loops! “For each n, do something for each x”. This creates layers of work for each data point. This potentially creates O(n^2)
  • Look for shifted loops! “For each decreasing value of n, do something for each x”. This creates layers of work that get 50% smaller over time as the input is divided in half with each step. This potentially creates O(log n).

Yet Another Book Binder Update

Hey! Who remembers that comic book manger app I was writing a few months ago?

Not me! Actually I didn’t forget about Book Binder–I just smacked into my own limitations. I had to take a break and do a bunch of reading, learning, and experimenting.

And now I’m back. Look at a what I did…

Xcode storyboard

My problem with Book Binder was creating a well designed navigation view hierarchy and wiring it all together. And so I dug in and figured it out (with a lot of help from Ray Wenderlich and Stack Overviewflow. Thanks Ray, Joel, and Jeff!)

You’ll find the new codebase here: Comic Keeper

But let’s talk about view controllers, show segues, and unwind segues for a few minutes. In the image above I have tab bar controller as my root with three tabs. The 2nd and 3rd tab are trivial. It’s the first tab that is entertaining! I have a deep navigation view hierarchy with 8 view controllers linked by 15 show segues, 6 unwind segues, and 4 relationship segues.

What I like about storyboards and segues is Xcode’s visualization. It’s a nice document of how an iOS app works from main screen to deeply nested supporting screens. Once you learn the knack of it of it, control-dragging between view controllers to create segues is easy. Unfortunately creating a segue is the also the least part of the effort in navigating from one iOS view to another.

Given the number of screens and bi-directional connections I have in this foolish little app, navigation management consumes too much of my coding. And these connections are fragile in spite of all the effort UIKit puts into keeping connections abstract, loose, and reusable.

Let’s take a quick look at what have to do each time I want to connect a field from the EditComicBookViewController to one of the item picker view controllers:

  • Update EditComicBookViewController:prepare(for:sender:) method with a case for the new show segue. I need to know the name of the segue, the type of the destination view controller, and the source of the data I want to transfer into the destination. I have a giant switch statement to manage the transactions for each show segue. I did create a protocol, StandardPicker, to reduce the amount of boilerplate code generated by each show segue.
  • Update EditComicBookViewController unwind segue for each particular type of item picker I’m using. I have four reusable item pickers (edit, list, dial, and date) and four unwind segues (addItemDidEditItem, listPickerDidPickItem, dialPickerDidPickItem, datePickerDidPickDate). A function corresponding to each unwind segue is better than having one method for all show segues. But I still have conditionals that choose the EditComicBookViewController field to update based on the title I gave to the picker. This view controller/segue pattern is not really set up for reuse.
  • I have to create a show segue from the source view controller to the destination and an unwind segue from the destination back to source. This is all assuming these views are embedded in the same UINavigationViewController. Each segue needs it’s own unique ID and its pretty easy to confuse the spelling of that ID in the supporting code.

How could navigation be better supported in Xcode and UIKit?

First, I’d like to bundle together the show and unwind segues with the IDs and the data in a single object. I’m sure this exists already, as it’s pretty obvious, but Apple isn’t providing an integration for storyboards. Ideally, I would control-drag to connect two view controllers and Xcode would pop-up a new file dialog box to create a subclass of StoryboardSegue and populate it with my data. The IDs should be auto-generated and auto-managed by Xcode. That way I can’t misspell them.

Second, I’d like the buttons in the navigation bar to each trigger separate but standard events:

  • goingForward(source:destination)
  • goingBackward(source:destination)
  • going(source:destination)

Right now you have to build your own mechanism to track the direction of navigation in viewWillDisappear(). In the navigation hierarchy of every app there is semantic meaning to moving forward and backward through the hierarchy similar to but potentially different from the show/unwind segue semantics. Tapping the back button might mean oops! Get me out of here while tapping a done button might mean I’ve made my changes, commit them and get me out of here!

Third, I’d like Xcode’s assistant editor view to show the code for a segue when I click on a segue. The navigation outline and storyboard visualization is a great way to hop from view controller to view controller. While Xcode knows about the objects that populate controllers, it doesn’t navigate you to any of them. Clicking on a connection in the connections inspector should load the code for that connection in the assistant editor. Xcode does highlight the object in the storyboard but I want more.

As my apps get more ambitious and sophisticated I’m probably going to abandon storyboards like the Jedi Master iOS developers I know. That’s sad because I feel I’ve finally figured out how to wire-up a storyboard-based view controller hierarchy and I’m already leveling out of that knowledge as the Jedi Masters smile smugly.

FizzBuzz Still Hard… and Still Useless

FizzBuzz Xcode Playground

I hear that many of the applicants we interview still have a hard time with FizzBuzz and other simple examples of looping, testing, and printing integers. This was true in 2007 when Coding Horror wrote this a famous blog post on Fizz Buzz, true in 2010 when DanSignerman famously asked StackOverflow about it, and true in 2017 when Hannah Ray answered the same question again on Quora. And today in 2019 I watched a video by Lets Build That App that explained how do solve FizzBuzz using fancy features of Swift 5.

So, yes, by external and internal validation FizzBuzz is still hard for software developers in an interview context to perform on demand.

In a quiet room with a clear set of requirements FizzBuzz is no problem. But under the pressure of an interview where the spotlight is on every misstep on the whiteboard FizzBuzz becomes something like the Great Filter of Software Interview Questions—Maybe we have not found intelligent life out in the stars because alien civilizations can’t pass the job interview!

Filtering numbers (so you can print “fizz” on multiples of 3 and “buzz” on multiplies of 5) is great for making sure you understand how language features work and that division by zero is bad.

Filtering numbers was probably a meaningful interview question in the 1980s and 1990s, when I learned to code, because it was a major pain with Assembly, C, and C++ (but not LISP). Today’s languages like Java, C#, Swift, Kotlin, and Python take all the challenge out of FizzBuzz.

Doing FizzBuzz in Swift 5--too easy!

The new Swift 5 language feature, isMultiple(of:) doesn’t even crash when you give it a zero! Where is the fun in that? And who knows if this advanced Swift switch statement with assignments as case expression is executing in constant time or blowing up the stack?

(Somebody knows all these things but software development is so routine now as most VMs and IDEs have airbags and baby-bumpers around your code.)

And yet many software developer interviews crash and burn on the FizzBuzz question! I think it’s because as team leads and employers we are rooted in the past. More and more code is being written from well engineered frameworks and yet we act is if knowing everything from first principles at the start of a developers career is critical for success. It’s not.

A good developer matures over time and has to start somewhere. There are better tests than FizzBuzz for filtering integers and engineers. It’s best to look for potential, the ability to learn, work well with others, and passion for coding, when interviewing candidates!

The Cost of Doing Internet Business

Screenshot of Netscape Navigator browser

A couple decades ago the costs of putting up a website seemed really reasonable–especially as compared to pre-Internet media like books, newspapers, and encyclopedias. A lone webmaster toiling away in the wee hours of the night could get a site up and running with HTML and CGI by the break of dawn. Pages were static, served directly from a server’s hard disk, and JavaScript and CSS non-existent.

iOS 6 TableViewController example app

Mobile apps were in a similar state a decade ago. The costs were small as compared to full featured desktop and web applications and there wasn’t much a mobile app could do that a simple table view controller couldn’t do. A lone mobile dev toiling away in the wee hours of the night could get almost any app ready for release to any app store in a few weeks. Back then most mobile apps were under the constraints of low-powered processors, limited memory, and ephemeral battery life. These constraints required mobile apps to be more like single-purpose widgets than multifunction applications.

Today it’s a more complex world for web and mobile apps. We have seriously sophisticated tech stacks that include the Cloud, HTML5, and advanced mobile operating systems that target screens of every size and devices without any screens at all. We don’t create websites or apps, we build multi-sided networks with so many features that vast teams of developers, scrum masters, product managers, designers, data scientists, and service reliability engineers are required.

In the modern world of 2019 no developer works alone in the wee hours of the night.

This hit home to me when I met a talented Google Doodle developer with amazing JavaScript skills. This dev explained that thier code was not allowed to go into production without a dozen teams looking it over, testing it, and beating it up. Because, you know, scale, performance, and security. By time the Google Doodler’s code appeared on the Google Search home page it was unrecognizable.

In my own work as a software developer and software development leader I’ve seen the rise in complexity and cost hit web and mobile development hard. GDPR, PII, COPA, OWASP, and other standards have added hundreds of dollars of cost to the development of iOS and Android apps. So has the proliferation in diversity of mobile devices. Are these pocket super computers with super high-resolution screens, prosumer cameras, always-hot microphones, machine learning chips, GPS, motion sensors, and unlimited cloud storage still phones? I don’t think so. Some are as big as coffee table books and others can be strapped to a wrist. When they start folding up into intelligent origami I don’t think we can call them phones anymore.

If you are not a developer, imagine trying to writing a book for new kind of paper that can change its shape, size, and orientation at a reader’s whim. Sometimes this paper has no visual existence and the user can choose to listen to your writing instead of reading. This protean piece of paper has all sorts of sensors so you, as the author, can know in real time where you reader is and what your reader is doing (if your reader accepted the EULA). How do you write a book for paper like this? It refuses to be any one thing and requires you, as the author, to image every possible configuration and situation. This is what software development is like today!

With 5G, Blockchain, AR/VR, and AI just around the corner the business of web and mobile development will become an even more unconstrained hot mess.

As developers we have gone from being lone wolves working independently to two-pizza teams collaborating in agile to multiple feature teams networked globally. It’s all we can do to just keep up with advances in hardware, software, operating systems, communications, and regulations.

We, as an industry, have not recognized the costs of software eating the world.

The hidden costs and ignored costs of crafting software for consumption on the Internet has grown non-linearly and I don’t think it’s stopping anytime soon. These costs are disrupting almost everybody everywhere. It’s gotten so bad that the generally favorable view of the Internet has soured.

So there are a few things we need to do!

Hold honest conversations about the costs of open and connected Internet software. We can’t keep throwing apps out into the wild and expect them to be safe and reliable. Cloud computing has solved this problem for the backend services as we now accept that servers are not pets and because we aggregate the costs and leverage expertise of giants like Google, Amazon, and Microsoft.

While we have learned to treat servers like machines, we still treat apps like pets, grooming them and agonizing over their look and feel while ignore our duty to make sure these apps are not vectors for malware and malcontents.

We need new software development tools and services that give cloud-like benefits to the mobile side. I’d love to have a CodePen or a Glitch for native mobile apps that aggregate costs and expertise required for responsible mobile app development. Apple and Google should not only give developers open SDKs and dev kits but something like a Swift Playground that we can release enterprise and consumer apps on top of. Yes, I’m asking Apple and Google to be gatekeepers, but we’re too irresponsible to abandon gatekeepers.

Finally, I would like to see a return to physical books, newspapers, and encyclopedias (insert your favorite old-school media product here) for the public mainstream use case. Digital-only isn’t yet the best way to communicate and express ideas for the commonweal. A paper publisher can at the very least assure us media experiences without any Momo Challenges inserted between the pages. Even more importantly a paper publisher has a name, an address, a phone number, and a way for us to legally hold them responsible.

We shouldn’t put the digital genie back in the pre-Internet bottle. We should be extremely realistic about the costs and responsibilities of developing software applications that users must depend on and trust.