&

Upper Yosemite Falls & Half Dome Moonbow

This past week was the optimal time to photograph moonbows in Yosemite Valley. I revisited photographing the moonbow at Upper Yosemite Falls as I had last year, but this time there was considerable more water and as a result the moonbow (rainbow by moonlight) was more easily seen. It was considerably larger, more vivid in color and wider arching. Conditions were great and at times a little too good as the 3 cameras I set up were completely drenched. If you’d like to read about what it took to get this photo be sure to check out my last blog post, Upper Yosemite Falls Moonbow – Getting The Shot, as it goes into a lot of detail about the hike and the challenges I faced.  If you’re curious about gear and settings this was taken with a Canon 5D Mark IV and Canon 11-24mm f/4 lens. Settings were ISO 640, 15 seconds at f/4.





&

Top 15 Digital Scrapbooking Downloads (Free & Paid)

Scrapbooking can be a fun way to capture important moments in life and with our list of the Top 15 Scrapbooking Resources, you can start right away!




&

How to Master the Elevator Pitch & Leave a Great First Impression

Want to master the elevator pitch and leave a great first impression? Use this easy formula to help communicate what you do in a concise pitch!




&

Top 20 Photoshop Actions (Free & Premium)

Photoshop is an amazing program and with our list of the 20 best free & premium Photoshop Actions, you can start creating incredible work immediately.




&

The Strategic Pyramid – Brand Purpose, Mission, Vision & Values

Do you know the difference between a mission and a vision? Or the difference between a purpose and a goal? Don’t worry, you’re not the only one. Let's clarify!




&

Web Design & CRO – A Checklist for Designers

Designing is often as much as a science as it is an art. Using specific knowledge of human psychology & online behaviour, the science of creating effective websites that are optimized for business...




&

Loosening the Caregiver's Grip

It happens slowly, like that metaphorical frog you’ve heard about. Possessiveness and controlling behavior in TBI caregivers is something that creeps up on you, and I suspect it is common — not because people are trying to be annoying, but because they care so much and want to see that their loved one is treated well in every respect.




&

Never Stop Asking 'What If?'

We imagine the what-ifs as a worst case scenario, our worst nightmare happening to us, our life falling apart. But here’s another way of looking at it.




&

Concurrency & Multithreading in iOS

Concurrency is the notion of multiple things happening at the same time. This is generally achieved either via time-slicing, or truly in parallel if multiple CPU cores are available to the host operating system. We've all experienced a lack of concurrency, most likely in the form of an app freezing up when running a heavy task. UI freezes don't necessarily occur due to the absence of concurrency — they could just be symptoms of buggy software — but software that doesn't take advantage of all the computational power at its disposal is going to create these freezes whenever it needs to do something resource-intensive. If you've profiled an app hanging in this way, you'll probably see a report that looks like this:

Anything related to file I/O, data processing, or networking usually warrants a background task (unless you have a very compelling excuse to halt the entire program). There aren't many reasons that these tasks should block your user from interacting with the rest of your application. Consider how much better the user experience of your app could be if instead, the profiler reported something like this:

Analyzing an image, processing a document or a piece of audio, or writing a sizeable chunk of data to disk are examples of tasks that could benefit greatly from being delegated to background threads. Let's dig into how we can enforce such behavior into our iOS applications.


A Brief History

In the olden days, the maximum amount of work per CPU cycle that a computer could perform was determined by the clock speed. As processor designs became more compact, heat and physical constraints started becoming limiting factors for higher clock speeds. Consequentially, chip manufacturers started adding additional processor cores on each chip in order to increase total performance. By increasing the number of cores, a single chip could execute more CPU instructions per cycle without increasing its speed, size, or thermal output. There's just one problem...

How can we take advantage of these extra cores? Multithreading.

Multithreading is an implementation handled by the host operating system to allow the creation and usage of n amount of threads. Its main purpose is to provide simultaneous execution of two or more parts of a program to utilize all available CPU time. Multithreading is a powerful technique to have in a programmer's toolbelt, but it comes with its own set of responsibilities. A common misconception is that multithreading requires a multi-core processor, but this isn't the case — single-core CPUs are perfectly capable of working on many threads, but we'll take a look in a bit as to why threading is a problem in the first place. Before we dive in, let's look at the nuances of what concurrency and parallelism mean using a simple diagram:

In the first situation presented above, we observe that tasks can run concurrently, but not in parallel. This is similar to having multiple conversations in a chatroom, and interleaving (context-switching) between them, but never truly conversing with two people at the same time. This is what we call concurrency. It is the illusion of multiple things happening at the same time when in reality, they're switching very quickly. Concurrency is about dealing with lots of things at the same time. Contrast this with the parallelism model, in which both tasks run simultaneously. Both execution models exhibit multithreading, which is the involvement of multiple threads working towards one common goal. Multithreading is a generalized technique for introducing a combination of concurrency and parallelism into your program.


The Burden of Threads

A modern multitasking operating system like iOS has hundreds of programs (or processes) running at any given moment. However, most of these programs are either system daemons or background processes that have very low memory footprint, so what is really needed is a way for individual applications to make use of the extra cores available. An application (process) can have many threads (sub-processes) operating on shared memory. Our goal is to be able to control these threads and use them to our advantage.

Historically, introducing concurrency to an app has required the creation of one or more threads. Threads are low-level constructs that need to be managed manually. A quick skim through Apple's Threaded Programming Guide is all it takes to see how much complexity threaded code adds to a codebase. In addition to building an app, the developer has to:

  • Responsibly create new threads, adjusting that number dynamically as system conditions change
  • Manage them carefully, deallocating them from memory once they have finished executing
  • Leverage synchronization mechanisms like mutexes, locks, and semaphores to orchestrate resource access between threads, adding even more overhead to application code
  • Mitigate risks associated with coding an application that assumes most of the costs associated with creating and maintaining any threads it uses, and not the host OS

This is unfortunate, as it adds enormous levels of complexity and risk without any guarantees of improved performance.


Grand Central Dispatch

iOS takes an asynchronous approach to solving the concurrency problem of managing threads. Asynchronous functions are common in most programming environments, and are often used to initiate tasks that might take a long time, like reading a file from the disk, or downloading a file from the web. When invoked, an asynchronous function executes some work behind the scenes to start a background task, but returns immediately, regardless of how long the original task might takes to actually complete.

A core technology that iOS provides for starting tasks asynchronously is Grand Central Dispatch (or GCD for short). GCD abstracts away thread management code and moves it down to the system level, exposing a light API to define tasks and execute them on an appropriate dispatch queue. GCD takes care of all thread management and scheduling, providing a holistic approach to task management and execution, while also providing better efficiency than traditional threads.

Let's take a look at the main components of GCD:

What've we got here? Let's start from the left:

  • DispatchQueue.main: The main thread, or the UI thread, is backed by a single serial queue. All tasks are executed in succession, so it is guaranteed that the order of execution is preserved. It is crucial that you ensure all UI updates are designated to this queue, and that you never run any blocking tasks on it. We want to ensure that the app's run loop (called CFRunLoop) is never blocked in order to maintain the highest framerate. Subsequently, the main queue has the highest priority, and any tasks pushed onto this queue will get executed immediately.
  • DispatchQueue.global: A set of global concurrent queues, each of which manage their own pool of threads. Depending on the priority of your task, you can specify which specific queue to execute your task on, although you should resort to using default most of the time. Because tasks on these queues are executed concurrently, it doesn't guarantee preservation of the order in which tasks were queued.

Notice how we're not dealing with individual threads anymore? We're dealing with queues which manage a pool of threads internally, and you will shortly see why queues are a much more sustainable approach to multhreading.

Serial Queues: The Main Thread

As an exercise, let's look at a snippet of code below, which gets fired when the user presses a button in the app. The expensive compute function can be anything. Let's pretend it is post-processing an image stored on the device.

import UIKit

class ViewController: UIViewController {
    @IBAction func handleTap(_ sender: Any) {
        compute()
    }

    private func compute() -> Void {
        // Pretending to post-process a large image.
        var counter = 0
        for _ in 0..<9999999 {
            counter += 1
        }
    }
}

At first glance, this may look harmless, but if you run this inside of a real app, the UI will freeze completely until the loop is terminated, which will take... a while. We can prove it by profiling this task in Instruments. You can fire up the Time Profiler module of Instruments by going to Xcode > Open Developer Tool > Instruments in Xcode's menu options. Let's look at the Threads module of the profiler and see where the CPU usage is highest.

We can see that the Main Thread is clearly at 100% capacity for almost 5 seconds. That's a non-trivial amount of time to block the UI. Looking at the call tree below the chart, we can see that the Main Thread is at 99.9% capacity for 4.43 seconds! Given that a serial queue works in a FIFO manner, tasks will always complete in the order in which they were inserted. Clearly the compute() method is the culprit here. Can you imagine clicking a button just to have the UI freeze up on you for that long?

Background Threads

How can we make this better? DispatchQueue.global() to the rescue! This is where background threads come in. Referring to the GCD architecture diagram above, we can see that anything that is not the Main Thread is a background thread in iOS. They can run alongside the Main Thread, leaving it fully unoccupied and ready to handle other UI events like scrolling, responding to user events, animating etc. Let's make a small change to our button click handler above:

class ViewController: UIViewController {
    @IBAction func handleTap(_ sender: Any) {
        DispatchQueue.global(qos: .userInitiated).async { [unowned self] in
            self.compute()
        }
    }

    private func compute() -> Void {
        // Pretending to post-process a large image.
        var counter = 0
        for _ in 0..<9999999 {
            counter += 1
        }
    }
}

Unless specified, a snippet of code will usually default to execute on the Main Queue, so in order to force it to execute on a different thread, we'll wrap our compute call inside of an asynchronous closure that gets submitted to the DispatchQueue.global queue. Keep in mind that we aren't really managing threads here. We're submitting tasks (in the form of closures or blocks) to the desired queue with the assumption that it is guaranteed to execute at some point in time. The queue decides which thread to allocate the task to, and it does all the hard work of assessing system requirements and managing the actual threads. This is the magic of Grand Central Dispatch. As the old adage goes, you can't improve what you can't measure. So we measured our truly terrible button click handler, and now that we've improved it, we'll measure it once again to get some concrete data with regards to performance.

Looking at the profiler again, it's quite clear to us that this is a huge improvement. The task takes an identical amount of time, but this time, it's happening in the background without locking up the UI. Even though our app is doing the same amount of work, the perceived performance is much better because the user will be free to do other things while the app is processing.

You may have noticed that we accessed a global queue of .userInitiated priority. This is an attribute we can use to give our tasks a sense of urgency. If we run the same task on a global queue of and pass it a qos attribute of background , iOS will think it's a utility task, and thus allocate fewer resources to execute it. So, while we don't have control over when our tasks get executed, we do have control over their priority.

A Note on Main Thread vs. Main Queue

You might be wondering why the Profiler shows "Main Thread" and why we're referring to it as the "Main Queue". If you refer back to the GCD architecture we described above, the Main Queue is solely responsible for managing the Main Thread. The Dispatch Queues section in the Concurrency Programming Guide says that "the main dispatch queue is a globally available serial queue that executes tasks on the application’s main thread. Because it runs on your application’s main thread, the main queue is often used as a key synchronization point for an application."

The terms "execute on the Main Thread" and "execute on the Main Queue" can be used interchangeably.


Concurrent Queues

So far, our tasks have been executed exclusively in a serial manner. DispatchQueue.main is by default a serial queue, and DispatchQueue.global gives you four concurrent dispatch queues depending on the priority parameter you pass in.

Let's say we want to take five images, and have our app process them all in parallel on background threads. How would we go about doing that? We can spin up a custom concurrent queue with an identifier of our choosing, and allocate those tasks there. All that's required is the .concurrent attribute during the construction of the queue.

class ViewController: UIViewController {
    let queue = DispatchQueue(label: "com.app.concurrentQueue", attributes: .concurrent)
    let images: [UIImage] = [UIImage].init(repeating: UIImage(), count: 5)

    @IBAction func handleTap(_ sender: Any) {
        for img in images {
            queue.async { [unowned self] in
                self.compute(img)
            }
        }
    }

    private func compute(_ img: UIImage) -> Void {
        // Pretending to post-process a large image.
        var counter = 0
        for _ in 0..<9999999 {
            counter += 1
        }
    }
}

Running that through the profiler, we can see that the app is now spinning up 5 discrete threads to parallelize a for-loop.

Parallelization of N Tasks

So far, we've looked at pushing computationally expensive task(s) onto background threads without clogging up the UI thread. But what about executing parallel tasks with some restrictions? How can Spotify download multiple songs in parallel, while limiting the maximum number up to 3? We can go about this in a few ways, but this is a good time to explore another important construct in multithreaded programming: semaphores.

Semaphores are signaling mechanisms. They are commonly used to control access to a shared resource. Imagine a scenario where a thread can lock access to a certain section of the code while it executes it, and unlocks after it's done to let other threads execute the said section of the code. You would see this type of behavior in database writes and reads, for example. What if you want only one thread writing to a database and preventing any reads during that time? This is a common concern in thread-safety called Readers-writer lock. Semaphores can be used to control concurrency in our app by allowing us to lock n number of threads.

let kMaxConcurrent = 3 // Or 1 if you want strictly ordered downloads!
let semaphore = DispatchSemaphore(value: kMaxConcurrent)
let downloadQueue = DispatchQueue(label: "com.app.downloadQueue", attributes: .concurrent)

class ViewController: UIViewController {
    @IBAction func handleTap(_ sender: Any) {
        for i in 0..<15 {
            downloadQueue.async { [unowned self] in
                // Lock shared resource access
                semaphore.wait()

                // Expensive task
                self.download(i + 1)

                // Update the UI on the main thread, always!
                DispatchQueue.main.async {
                    tableView.reloadData()

                    // Release the lock
                    semaphore.signal()
                }
            }
        }
    }

    func download(_ songId: Int) -> Void {
        var counter = 0

        // Simulate semi-random download times.
        for _ in 0..<Int.random(in: 999999...10000000) {
            counter += songId
        }
    }
}

Notice how we've effectively restricted our download system to limit itself to k number of downloads. The moment one download finishes (or thread is done executing), it decrements the semaphore, allowing the managing queue to spawn another thread and start downloading another song. You can apply a similar pattern to database transactions when dealing with concurrent reads and writes.

Semaphores usually aren't necessary for code like the one in our example, but they become more powerful when you need to enforce synchronous behavior whille consuming an asynchronous API. The above could would work just as well with a custom NSOperationQueue with a maxConcurrentOperationCount, but it's a worthwhile tangent regardless.


Finer Control with OperationQueue

GCD is great when you want to dispatch one-off tasks or closures into a queue in a 'set-it-and-forget-it' fashion, and it provides a very lightweight way of doing so. But what if we want to create a repeatable, structured, long-running task that produces associated state or data? And what if we want to model this chain of operations such that they can be cancelled, suspended and tracked, while still working with a closure-friendly API? Imagine an operation like this:

This would be quite cumbersome to achieve with GCD. We want a more modular way of defining a group of tasks while maintaining readability and also exposing a greater amount of control. In this case, we can use Operation objects and queue them onto an OperationQueue, which is a high-level wrapper around DispatchQueue. Let's look at some of the benefits of using these abstractions and what they offer in comparison to the lower-level GCI API:

  • You may want to create dependencies between tasks, and while you could do this via GCD, you're better off defining them concretely as Operation objects, or units of work, and pushing them onto your own queue. This would allow for maximum reusability since you may use the same pattern elsewhere in an application.
  • The Operation and OperationQueue classes have a number of properties that can be observed, using KVO (Key Value Observing). This is another important benefit if you want to monitor the state of an operation or operation queue.
  • Operations can be paused, resumed, and cancelled. Once you dispatch a task using Grand Central Dispatch, you no longer have control or insight into the execution of that task. The Operation API is more flexible in that respect, giving the developer control over the operation's life cycle.
  • OperationQueue allows you to specify the maximum number of queued operations that can run simultaneously, giving you a finer degree of control over the concurrency aspects.

The usage of Operation and OperationQueue could fill an entire blog post, but let's look at a quick example of what modeling dependencies looks like. (GCD can also create dependencies, but you're better off dividing up large tasks into a series of composable sub-tasks.) In order to create a chain of operations that depend on one another, we could do something like this:

class ViewController: UIViewController {
    var queue = OperationQueue()
    var rawImage = UIImage? = nil
    let imageUrl = URL(string: "https://example.com/portrait.jpg")!
    @IBOutlet weak var imageView: UIImageView!

    let downloadOperation = BlockOperation {
        let image = Downloader.downloadImageWithURL(url: imageUrl)
        OperationQueue.main.async {
            self.rawImage = image
        }
    }

    let filterOperation = BlockOperation {
        let filteredImage = ImgProcessor.addGaussianBlur(self.rawImage)
        OperationQueue.main.async {
            self.imageView = filteredImage
        }
    }

    filterOperation.addDependency(downloadOperation)

    [downloadOperation, filterOperation].forEach {
        queue.addOperation($0)
     }
}

So why not opt for a higher level abstraction and avoid using GCD entirely? While GCD is ideal for inline asynchronous processing, Operation provides a more comprehensive, object-oriented model of computation for encapsulating all of the data around structured, repeatable tasks in an application. Developers should use the highest level of abstraction possible for any given problem, and for scheduling consistent, repeated work, that abstraction is Operation. Other times, it makes more sense to sprinkle in some GCD for one-off tasks or closures that we want to fire. We can mix both OperationQueue and GCD to get the best of both worlds.


The Cost of Concurrency

DispatchQueue and friends are meant to make it easier for the application developer to execute code concurrently. However, these technologies do not guarantee improvements to the efficiency or responsiveness in an application. It is up to you to use queues in a manner that is both effective and does not impose an undue burden on other resources. For example, it's totally viable to create 10,000 tasks and submit them to a queue, but doing so would allocate a nontrivial amount of memory and introduce a lot of overhead for the allocation and deallocation of operation blocks. This is the opposite of what you want! It's best to profile your app thoroughly to ensure that concurrency is enhancing your app's performance and not degrading it.

We've talked about how concurrency comes at a cost in terms of complexity and allocation of system resources, but introducing concurrency also brings a host of other risks like:

  • Deadlock: A situation where a thread locks a critical portion of the code and can halt the application's run loop entirely. In the context of GCD, you should be very careful when using the dispatchQueue.sync { } calls as you could easily get yourself in situations where two synchronous operations can get stuck waiting for each other.
  • Priority Inversion: A condition where a lower priority task blocks a high priority task from executing, which effectively inverts their priorities. GCD allows for different levels of priority on its background queues, so this is quite easily a possibility.
  • Producer-Consumer Problem: A race condition where one thread is creating a data resource while another thread is accessing it. This is a synchronization problem, and can be solved using locks, semaphores, serial queues, or a barrier dispatch if you're using concurrent queues in GCD.
  • ...and many other sorts of locking and data-race conditions that are hard to debug! Thread safety is of the utmost concern when dealing with concurrency.

Parting Thoughts + Further Reading

If you've made it this far, I applaud you. Hopefully this article gives you a lay of the land when it comes to multithreading techniques on iOS, and how you can use some of them in your app. We didn't get to cover many of the lower-level constructs like locks, mutexes and how they help us achieve synchronization, nor did we get to dive into concrete examples of how concurrency can hurt your app. We'll save those for another day, but you can dig into some additional reading and videos if you're eager to dive deeper.




&

Why's it so hard to get the cool stuff approved?

The classic adage is “good design speaks for itself.” Which would mean that if something’s as good of an idea as you think it is, a client will instantly see that it’s good too, right?

Here at Viget, we’re always working with new and different clients. Each with their own challenges and sensibilities. But after ten years of client work, I can’t help but notice a pattern emerge when we’re trying to get approval on especially cool, unconventional parts of a design.

So let’s break down some of those patterns to hopefully better understand why clients hesitate, and what strategies we’ve been using lately to help get the work we’re excited about approved.

Imagine this: the parallax homepage with elements that move around in surprising ways or a unique navigation menu that conceptually reinforces a site’s message. The way the content cards on a page will, like, be literal cards that will shuffle and move around. Basically, any design that feels like an exciting, novel challenge, will need the client to “get it.” And that often turns out to be the biggest challenge of all.

There are plenty of practical reasons cool designs get shot down. A client is usually more than one stakeholder, and more than the team of people you’re working with directly. On any project, there’s an amount of telephone you end up playing. Or, there’s always the classic foes: budgets and deadlines. Any idea should fit in those predetermined constraints. But as a project goes along, budgets and deadlines find a way to get tighter than you planned.

But innovative designs and interactions can seem especially scary for clients to approve. There’s three fears that often pop up on projects:

The fear of change. 

Maybe the client expected something simple, a light refresh. Something that doesn’t challenge their design expectations or require more time and effort to understand. And on our side, maybe we didn’t sufficiently ease them into our way of thinking and open them up to why we think something bigger and bolder is the right solution for them. Baby steps, y’all.

The fear of the unknown. 

Or, less dramatically, a lack of understanding of the medium. In the past, we have struggled with how to present an interactive, animated design to a client before it’s actually built. Looking at a site that does something conceptually similar as an example can be tough. It’s asking a lot of a client’s imagination to show them a site about boots that has a cool spinning animation and get meaningful feedback about how a spinning animation would work on their site about after-school tutoring. Or maybe we’ve created static designs, then talked around what we envision happening. Again, what seems so clear in our minds as professionals entrenched in this stuff every day can be tough for someone outside the tech world to clearly understand.

    The fear of losing control. 

    We’re all about learning from past mistakes. So lets say, after dealing with that fear of the unknown on a project, next time you go in the opposite direction. You invest time up front creating something polished. Maybe you even get the developer to build a prototype that moves and looks like the real thing. You’ve taken all the vague mystery out of the process, so a client will be thrilled, right? Surprise, probably not! Most clients are working with you because they want to conquer the noble quest that is their redesign together. When we jump straight to showing something that looks polished, even if it’s not really, it can feel like we jumped ahead without keeping them involved. Like we took away their input. They can also feel demotivated to give good, meaningful feedback on a polished prototype because it looks “done.”

    So what to do? Lately we have found low-fidelity prototypes to be a great tool for combating these fears and better communicating our ideas.

    What are low-fidelity prototypes?

    Low fidelity prototypes are a tool that designers can create quickly to illustrate an idea, without sinking time into making it pixel-perfect. Some recent examples of prototypes we've created include a clickable Figma or Invision prototype put together with Whimsical wireframes:

    A rough animation created in Principle illustrating less programatic animation:

    And even creating an animated storyboard in Photoshop:

    They’re rough enough that there’s no way they could be confused for a final product. But customized so that a client can immediately understand what they’re looking at and what they need to respond to. Low-fidelity prototypes hit a sweet spot that addresses those client fears head on.

    That fear of change? A lo-fi prototype starts rough and small, so it can ease a client into a dramatic change without overwhelming them. It’s just a first step. It gives them time to react and warm up to something that’ll ultimately be a big change.

    It also cuts out the fear of the unknown. Seeing something moving around, even if it’s rough, can be so much more clear than talking ourselves in circles about how we think it will move, and hoping the client can imagine it. The feature is no longer an enigma cloaked in mystery and big talk, but something tangible they can point at and ask concrete questions about.

    And finally, a lo-fi prototype doesn’t threaten a client’s sense of control. Low-fidelity means it’s clearly still a work in progress! It’s just an early step in the creative process, and therefore communicates that we’re still in the middle of that process together. There’s still plenty of room for their ideas and feedback.

    Lo-fi prototypes: client-tested, internal team-approved

    There are a lot of reasons to love lo-fi prototypes internally, too!

    They’re quick and easy. 

    We can whip up multiple ideas within a few hours, without sinking the time into getting our hearts set on any one thing. In an agency setting especially, time is limited, so the faster we can get an idea out of our own heads, the better.

    They’re great to share with developers. 

    Ideally, the whole team is working together simultaneously, collaborating every step of the way. Realistically, a developer often doesn’t have time during a project’s early design phase. Lo-fi prototypes are concrete enough that a developer can quickly tell if building an idea will be within scope. It helps us catch impractical ideas early and helps us all collaborate to create something that’s both cool and feasible.

      Stay tuned for posts in the near future diving into some of our favorite processes for creating lo-fi prototypes!



      • Design & Content

      &

      So You've Written a Bad Design Take

      So you’ve just written a blog post or tweet about why wireframes are becoming obsolete, the dangers of “too accessible” design, or how a certain style of icon creates “cognitive fatigue.”

      Your post went viral, but now you’re getting ratioed by rude people on the Internet. That sucks! You were just trying to start a conversation and you probably didn’t deserve all that negativity (except for you, “too accessible” guy).

      Most likely, you made one of these common mistakes:

      1. You made generalizations about “design”

      You, a good user-centered designer, know that you are not your user. Nor are you every designer.

      First of all, let's acknowledge that there is no universal definition of design. Even if we narrow it down to software design, it’s still hard to make generalizations. Agency, in-house, product, startup, enterprise, non-profit, website, app, connected hardware, etc. – there are a lot of different work contexts and cultures for people with “designer” in their titles.

      "The Design Industry" is not a thing, but even if it were, you don't speak for it. Don’t assume that the kind of design work you do is the universal default.

      2. You didn’t share enough context

      There are many great design books and few great design blog posts. (There are, to my knowledge, no great design tweets, but I am open to your suggestions.) Writing about design is not well suited to short formats, because context plays such an important role and there’s always a lot of it to cover.

      Writing about your work should include as much context as you would include if you were presenting your portfolio for a job interview. What kind of organization did you work for? Who was your client and/or your stakeholders? What was the goal of the project? Your timeline? What was the makeup of your team? What were the notable business rules and constraints? How are you defining effectiveness and success?

      Without these kinds of details, it’s not possible for other designers to know if what you’ve written is credible or applicable to them.

      3. You were too certain

      A blog post doesn’t need to be a dissertation. It’s okay to share hunches and anecdotes, but give the necessary caveats. And if you're making claims about science, bruh, you gotta cite your sources.

      Be humble in your takes. Your account of what worked for you and why is more valuable to your peers than making sweeping claims and reheating the same old arguments. Be prepared to be told you’re wrong, and have the humility to realize that your perspective is just your perspective. Real conversations, like good design, are built on feedback and diverse viewpoints.

      Together, we can improve the discourse in our information ecosystems. Don't generalize. Give context. Be humble.




      &

      "I always hated that word—marketing—and I hate it now. Because for me, and this may sound simplistic,..."

      ““I always hated that word—marketing—and I hate it now. Because for me, and this may sound simplistic, the key to marketing is to make something people want. When they want it, they buy it. When they buy it, you have sales. So the product has to speak. The product is what markets things.””

      - Interview with Tom Ford.




      &

      "What is deceptive, especially in the West, is our assumption that repetitive and mindless jobs are..."

      What is deceptive, especially in the West, is our assumption that repetitive and mindless jobs are dehumanizing. On the other hand, the jobs that require us to use the abilities that are uniquely human, we assume to be humanizing. This is not necessarily true. The determining factor is not so much the nature of our jobs, but for whom they serve.

      ‘Burnout’ is a result of consuming yourself for something other than yourself. You could be burnt out for an abstract concept, ideal, or even nothing (predicament). You end up burning yourself as fuel for something or someone else. This is what feels dehumanizing. In repetitive physical jobs, you could burn out your body for something other than yourself. In creative jobs, you could burn out your soul. Either way, it would be dehumanizing. Completely mindless jobs and incessantly mindful jobs could both be harmful to us.



      - Dsyke Suematsu from his white paper discussed at Why Ad People Burn Out.




      &

      "In conceptual art the idea or concept is the most important aspect of the work. When an artist uses..."

      “In conceptual art the idea or concept is the most important aspect of the work. When an artist uses a conceptual form of art, it means that all of the planning and decisions are made beforehand and the execution is a perfunctory affair. The idea becomes a machine that makes the art. This kind of art is not theoretical or illustrative of theories; it is intuitive, it is involved with all types of mental processes and it is purposeless. It is usually free from the dependence on the skill of the artist as a craftsman.”

      - Artist Sol Lewitt on conceptual art.




      &

      Squared Circle Pit #54 - AVATAR Frontman Johannes Eckerström Talks Wrestling Unlocking His Love of Metal Frontmen

      We're back and this week, we're talking to Avatar's colorful frontman Johannes Eckerström. If you've ever seen the band live,...

      The post Squared Circle Pit #54 - AVATAR Frontman Johannes Eckerström Talks Wrestling Unlocking His Love of Metal Frontmen appeared first on Metal Injection.




      &

      METAL INJECTION LIVECAST #535 - Liddle' Ditch

      We kick things off with Rob talking about his favorite albums of the year. We then discuss the shocking news...

      The post METAL INJECTION LIVECAST #535 - Liddle' Ditch appeared first on Metal Injection.



      • Metal Injection Livecast





      &

      METAL INJECTION LIVECAST #554 - Rob's Nolita

      We kick things off talking about the Rage Against the Machine reunion. We then discuss the summer touring season and...

      The post METAL INJECTION LIVECAST #554 - Rob's Nolita appeared first on Metal Injection.



      • Metal Injection Livecast

      &

      The Chart Guide v4.0 - Interview & Giveaway

      Michiel Dullaert, data visualization expert and trainer from the Netherlands, has updated his Chart Guide poster to version 4! A free PDF is available for download from his website, and introduces a new category, 19 new charts and 4 extra design tips. You can also purchase a full-size printed poster version.

      As the November 2019 Giveaway, I have a pair of Chart Guide posters, that will be shipped to one lucky winner. That way you get one for yourself, and one you can give to a friend or coworker.

      Register HERE by November 30, 2019 at 11:59pm CT, and the winner will be randomly chosen on December 1st!

      This poster shows 84 charts to choose from and includes 16 chart design tips to help you make the Perfect Chart. The poster is available as a big poster or you can download the PDF file for free. Let this ChartGuide poster help you choose and design your Perfect Chart.

      You can see his complete write-up about the new version HERE. I was able to ask Michiel a few interview questions about developing the posters:

      Cool Infographics: What’s your background and how did you get into visualizing data?

      Michiel Dullaert: Years ago I have been working in the boardgame and puzzle industry. Part of my work was discovering new boardgames and puzzles and introduce them to the market. I was working for two different companies, both at the time that a new product of theirs really changed the market. For the boardgame industry I worked for the company that introduced a new type of boardgame (the game of Catan) that made playing boardgames a popular hobby. After that, I worked for a company that created puzzle magazines at the time the Sudoku puzzles was introduced. And here the same happened again, a new type of puzzle that changed the way people would puzzle and talk about puzzles. Both were very nice jobs, with a lot of enthusiastic conversations with customers about new products.

      In both companies I was working in the product development. I always had a large personal interest in the data behind the products. So it felt logic to do more with data, and I changed careers. I started working for a large company as an analyst. And it was not long that I found out that my colleagues were not interested in my reports. Although the reports contained interesting information it was shown in large tables and busy charts. People seemed to be not interested and if the looked into the numbers, they did not seem to understand them. My work did not seem to matter. The contrast between my previous jobs and the work as an analyst could not have been bigger. At that time I decided I would try to find a way to make people as enthusiastic about data as they were about boardgames and Sudoku puzzles. 

      The first step was reading books on the topic of data visualization. Because I was working in the business intelligence field, the most logic choice were the books of Stephen Few. I bought them all and a whole new world opened for me. When Few was in the Netherlands to give a course I felt very lucky I could join. The workshops inspired me to learn more on this topic. So I bought more books and the next year I joined a class of Alberto Caïro. This gave me multiple perspectives on the same topic. The things I learned were applied to my work, and I was getting more and more responses on my visualizations. People actually started to read and understand them. 

      My manager asked me to explain my choices in visualizations to my colleagues, so they could learn from me. And then I discovered how great it is to teach about data visualisation. I met a couple of UX designers and they inspired me learn more about that topic and to get an UX certification. The knowledge I gained in learning UX helped me in developing my own perspective on good data visualization. And in my workshop I try to inspire others to create such. For these workshops I wanted an overview of charts. Although there were already some great overviews, none of them had the point of view I was teaching in class. So I decided to design my own. That’s how Chart.Guide started. 

      Cool Infographics: Who is the Chart Guide poster intended for?

      Michiel Dullaert: The website and the posters are intended for everyone who makes charts. For me it does not matter if you are working as a data-journalist or a data scientist, a infographic designer, project manager or a financial analyst. As long as you need help or inspiration when making charts or tables, Chart.Guide can help you. Online in the form of the website and offline in the form of the poster. Because I want to inspire as many people as possible I made the PDF of the poster free to download. I know that the poster is used in business departments, newsrooms and in school classrooms.

      Cool Infographics: What was your design process for the poster?

      Michiel Dullaert: The main source for updates to the poster or website, is the conversations I have with people I teach or work with. If they have a need for certain chart types, or make design mistakes, I try to add that topic. 

      DPG Chart Chooser

      The first poster edition (picture DPG Chart Chooser) was just a collection of charts I created for my students. For each chart a few words on when to use the chart and, more important, it gave advice on what charts were not recommended. On the second edition (the first under the Chart.Guide brand) I added chart design tips.  The reason, I saw people choose a good chart but then mess up the design. Last year, I got questions about maps, so I decided to add them on poster edition 4. 

      Rearranging the layout of the Chart Guide

      The design process starts with insight I get from conversations I am having. Next step is cutting the old poster and rearranging everything. (see picture ChartGuide rearrange) now, will lead to more insights on the poster in the future. Although it make take some time to transform everything to the screen or paper. I still need to find some time to explain on the website why some charts are “not recommended”. 

      Cool Infographics: You asked your followers to help choose the design of the new poster. How did that go?

      Michiel Dullaert: The poster is made to help people. So it seems to be logic to give them a role in the design process. As a UX designer I like to test my designs before releasing them. Most of these tests are done in class, because I like to observe the users in how they use the new design. The online voting was suggestion of a student. It did give me a lot of useful feedback. Especially when people wrote a lot of text explaining their choice. For future editions I will do the same.

      Cool Infographics: How can people follow you for updates?

      Michiel Dullaert: People who have downloaded the PDF will get an email when a new poster is available, or when something interesting is added to the website. For this and more chart related inspiration, they can follow me on Twitter: @Chart_Guide or on facebook: /ChartGuide1.

      This helpful reference guide is one of over 25 FREE data visualization guides I maintain links to in the Cool Infographics Tools pages. See them all on the DataViz Reference Guides page, and let me know if I’m missing any.




      &

      What's Inside the White House?

      Visual explanations are a big part of data visualizations, and this video exploration of What’s Inside the White House? by animator Jared Owen gives viewers a great perspective of where the major rooms are located in context with the rest of the building. I would bet that most people don’t know that the Oval Office isn’t in the main, center building.

      The White House is full of lots of interesting rooms. A lot of people don't realize that this information is public! Please join me as we take a walk through the different rooms and what they are used for.

      Found on Core77




      &

      SS Peter & Paul

      Andrew Rickmann posted a photo:

      SS Peter and Paul in Wantage, Oxfordshire.




      &

      'And the award goes to...' How to avoid winning a Procrustes Award for bad UX

      We're familiar with awarding prizes for excellence, from the Oscars to The International Design Awards. But what if we started giving prizes to shame bad examples of design? Enter the Procrustes Awards.




      &

      The future of UX research is automated, and that's a problem

      If you compare the UX research methods we use today with the methods we used 16 years ago, something interesting emerges. We see that UX research is becoming increasingly remote and increasingly unmoderated. In other words, we're moving to a world where UX research is becoming automated. We can learn a lot from automated research. But it comes at the price of understanding our users.




      &

      The minimalist field researcher: What's in my bag?

      When carried out in a lab, user experience research is gear heavy. You need technology to record audio, video and the screen of the device under test. In contrast, when carried out in the field, user experience research is more lightweight. Even so, there are a few non-obvious items of kit that I find essential on a field visit.




      &

      Illustrations for Demetre's Winter Sweet Menu

      Illustrations for Demetre's Winter Sweet Menu

      AoiroStudioMay 04, 2020

      It’s a bit of an old project by Sean Lewis but I thought it was perfectly suited for ABDZ. During these pandemic times, we had to find ways to be more creative with our daily lives. I think we all did somehow. For my case, now I am currently living in Switzerland, I still remember the simple walks that I would take with the family especially early in the morning. And I remember having conversations with my oldest kid who never saw huge mountains covered in snow, and he kept saying that it looked like ice cream (being a huge fan of ice cream). That’s why I thought about sharing Sean’s work, the little but simple memories that goes through your mind. Life is simple and filled with opportunities to be remembered. Thank you Sean.

       

      About Sean Lewis

      Sean is a fellow Canadian (hi!) and is an illustrator based in Toronto, Canada. Make sure to check out his work for more illustrations via his Behance profile.




      &

      It’s A Living Mural for X-Games China & Innersect

      It’s A Living Mural for X-Games China & Innersect

      AoiroStudioMay 05, 2020

      I think Fabio and I are on a challenge to keep the ABDZ homepage in color tones of 'pastel visuals'. It's perfect because I stumbled across the new project from It's A Living aka Ricardo Gonzalez for X-Games China & Innersect 2019 in Shanghai, China. I don't know if you are familiar or not by Ricardo's distinct lettering style but it's just plain beautiful and vibrant. INNERSECT is the biggest street culture convention in China, a street fashion project founded by celebrity icon Edison Chen in 2017. Feast your eyes!

      About It’s A Living

      AKA Ricardo Gonzalez is an incredible artist who has worked through many collaborations and his lettering style is so unique. Make sure to check out his links.




      &

      Surf Jæren

      Yesterday turned out to be a crisp, sunny, minus 5 degrees day with an awesome swell. I took the Mavic out for a spin before a 2 hour session at Steinen.




      &

      12 Best GoDaddy Alternatives for Domain & Web Hosting (2020)

      Are you looking for the best GoDaddy alternative for domain registration and web hosting? Without a doubt, Godaddy is one of the most popular names when it comes to registering domain names and hosting your business online. Over the last 22 years, GoDaddy has managed to establish a stronghold in the market. In this article, […]

      The post 12 Best GoDaddy Alternatives for Domain & Web Hosting (2020) appeared first on IsItWP - Free WordPress Theme Detector.




      &

      Don't Let Your Diagnosis of TBI and/or PTSD Define You

      Adam shares a message of hope to those diagnosed with TBI and/or PTSD: Your life may be different, but you are still the driver and in control.




      &

      Want to help the USPS and vets? Buy a &#039;Healing PTSD&#039; stamp

      Support two entities with the price of one.





      &

      McDonald's Workers in Denmark Pity Us

      Nicholas Kristof: Before the coronavirus pandemic, I crept behind [expletive] Danish lines to explore: How scary is Denmark? How horrifying would it be if the United States took a step or two in the direction of Denmark? Would America lose its edge, productivity and innovation, or would it gain well-being, fairness and happiness?




      &

      Video Shows a Man Screaming 'Fake Pandemic' at a Florida Officer

      A nearly two-minute, profanity-laced tirade at a code officer at a Miami Beach grocery store is the latest example of mounting tensions in the US over wearing masks to stem the spread of the coronavirus.




      &

      Judge Could Hold Up Trump Administration's Bid to Clear Flynn, Legal Experts say

      The notoriously independent-minded federal judge who once said he was disgusted by the conduct of Michael Flynn could block the administration's bid to drop criminal charges against the former adviser to President Donald Trump, legal experts said.




      &

      The DOJ's Lawless Reversal on Michael Flynn

      Randall D. Eliason: The government's motion to dismiss the case against former national security adviser Michael Flynn is like nothing I've ever seen. It's a political screed dressed up as legal analysis, promoting the "deep state" conspiracy fantasies of President Trump. It epitomizes the politicization of the Justice Department under Attorney General William P. Barr. It is, in the truest sense of the word, lawless.




      &

      Mysterious Sharks Dance Away Bethel's COVID-19 Blues

      A couple of mysterious sharks have caught the fancy of the town. Maybe it's the cabin fever finally setting in, or perhaps this is what happens when you go too long without washing your mask, but Bethelites are going wild for two people in inflatable shark suits who pop up randomly around town.




      &

      Trump Declares, 'I Learned a Lot from Nixon'

      During an interview on "Fox and Friends," Trump explained why he chose not to go on a firing spree amid Special Counsel Robert Mueller's Russia investigation a la Nixon's Saturday Night Massacre during the Watergate scandal. "I learned a lot from Richard Nixon: Don't fire people," the President said. "I learned a lot. I study history, and the firing of everybody ... .I should've, in one way," he continued. "But I'm glad I didn't because look at the way it turned out."




      &

      Scientists Obtain 'lucky' Image of Jupiter

      Astronomers have produced a remarkable new image of Jupiter, tracing the glowing regions of warmth that lurk beneath the gas giant's cloud tops. The picture was captured in infared by the Gemini North Telescope in Hawaii, and is one of the sharpest observations of the planet ever made from the ground.




      &

      Roy Horn of 'Siegfried and Roy' Dies of COVID-19 Complications

      Roy Horn, famed tiger handler and co-star of the magic duo known as Siegfried and Roy, died of complications from the coronavirus in a hospital in Las Vegas on Friday. He was 75 years old. "Today, the world has lost one of the greats of magic, but I have lost my best friend," Siegfried Fischbacher said in a statement. "From the moment we met, I knew Roy and I, together, would change the world." "There could be no Siegfried without Roy, and no Roy without Siegfried." This is a developing story. Please check back for updates.




      &

      Intuition, Creative Freedom & Doing What You Love with Chris Ballew

      Today’s episode is going to rock your world … pun fully intended because today’s guest is an actual rock star. You may remember a band called Presidents of the United States of America. They took the world by storm in 1995 with their self titled album, Presidents of the United States of America playing songs like Lump and Peaches. Yes, that’s right. My guest today is frontman Chris Ballew. Chris and I have been friends for years, including collaborating on a music video together and at least one live performance (gotta listen to find out ;). Of course we get into his musical journey, a meteoric rise to success, and then realizing something was missing. We take some deep dives into Chris’ creative process, including his method for capturing his small bits and later using those to write new works, including his new project Casper Babypants. In this episode: Consider what kind of artist you are and how you relate to other artists. For years Chris played in bands, but what he learned about himself is his work is actually solo. Don’t censor yourself while you’re creating. Get it out, no matter how crazy or ridiculous or unusual and then […]

      The post Intuition, Creative Freedom & Doing What You Love with Chris Ballew appeared first on Chase Jarvis Photography.




      &

      Independence and the Art of Timeless Work with Zoë Keating

      A cellist since the age of eight, Zoë Keating pursued electronic music and contemporary composition as part of her Liberal Arts studies at Sarah Lawrence College in New York. I came across her music almost 10 years ago and love it so much I reached out to see if she would be interested on being on the show. Not only did she respond, she left us reeling from her incredible live performance and chat on art + entrepreneurship. Now she’s back on tour with her latest album Snowmelt. In this episode, we go deep into personal growth, dealing with incredible loss, balancing parenthood and career, and landscape for independent artists. Enjoy! FOLLOW ZOË: instagram | twitter | website Listen to the Podcast Subscribe   Watch the Episode  This podcast is brought to you by CreativeLive. CreativeLive is the world’s largest hub for online creative education in photo/video, art/design, music/audio, craft/maker, money/life and the ability to make a living in any of those disciplines. They are high quality, highly curated classes taught by the world’s top experts — Pulitzer, Oscar, Grammy Award winners, New York Times best selling authors and the best entrepreneurs of our times.

      The post Independence and the Art of Timeless Work with Zoë Keating appeared first on Chase Jarvis Photography.




      &

      Harmony > Balance with Jason Calacanis

      Today we’re going back to San Francisco with myself and Jason Calacanis on stage during my tour stop for my book Creative Calling. Jason is an investor and long time host of the This Week in Startups podcast. And, of course, Jason wastes no time in our conversation. He goes right to the heart of the matter by getting into failure, venture capitol, knowing when to quit, and when to push through. Enjoy! FOLLOW JASON: facebook | twitter | website Listen to the Podcast Subscribe   This podcast is brought to you by CreativeLive. CreativeLive is the world’s largest hub for online creative education in photo/video, art/design, music/audio, craft/maker, money/life and the ability to make a living in any of those disciplines. They are high quality, highly curated classes taught by the world’s top experts — Pulitzer, Oscar, Grammy Award winners, New York Times best selling authors and the best entrepreneurs of our times.

      The post Harmony > Balance with Jason Calacanis appeared first on Chase Jarvis Photography.




      &

      Concurrency & Multithreading in iOS

      Concurrency is the notion of multiple things happening at the same time. This is generally achieved either via time-slicing, or truly in parallel if multiple CPU cores are available to the host operating system. We've all experienced a lack of concurrency, most likely in the form of an app freezing up when running a heavy task. UI freezes don't necessarily occur due to the absence of concurrency — they could just be symptoms of buggy software — but software that doesn't take advantage of all the computational power at its disposal is going to create these freezes whenever it needs to do something resource-intensive. If you've profiled an app hanging in this way, you'll probably see a report that looks like this:

      Anything related to file I/O, data processing, or networking usually warrants a background task (unless you have a very compelling excuse to halt the entire program). There aren't many reasons that these tasks should block your user from interacting with the rest of your application. Consider how much better the user experience of your app could be if instead, the profiler reported something like this:

      Analyzing an image, processing a document or a piece of audio, or writing a sizeable chunk of data to disk are examples of tasks that could benefit greatly from being delegated to background threads. Let's dig into how we can enforce such behavior into our iOS applications.


      A Brief History

      In the olden days, the maximum amount of work per CPU cycle that a computer could perform was determined by the clock speed. As processor designs became more compact, heat and physical constraints started becoming limiting factors for higher clock speeds. Consequentially, chip manufacturers started adding additional processor cores on each chip in order to increase total performance. By increasing the number of cores, a single chip could execute more CPU instructions per cycle without increasing its speed, size, or thermal output. There's just one problem...

      How can we take advantage of these extra cores? Multithreading.

      Multithreading is an implementation handled by the host operating system to allow the creation and usage of n amount of threads. Its main purpose is to provide simultaneous execution of two or more parts of a program to utilize all available CPU time. Multithreading is a powerful technique to have in a programmer's toolbelt, but it comes with its own set of responsibilities. A common misconception is that multithreading requires a multi-core processor, but this isn't the case — single-core CPUs are perfectly capable of working on many threads, but we'll take a look in a bit as to why threading is a problem in the first place. Before we dive in, let's look at the nuances of what concurrency and parallelism mean using a simple diagram:

      In the first situation presented above, we observe that tasks can run concurrently, but not in parallel. This is similar to having multiple conversations in a chatroom, and interleaving (context-switching) between them, but never truly conversing with two people at the same time. This is what we call concurrency. It is the illusion of multiple things happening at the same time when in reality, they're switching very quickly. Concurrency is about dealing with lots of things at the same time. Contrast this with the parallelism model, in which both tasks run simultaneously. Both execution models exhibit multithreading, which is the involvement of multiple threads working towards one common goal. Multithreading is a generalized technique for introducing a combination of concurrency and parallelism into your program.


      The Burden of Threads

      A modern multitasking operating system like iOS has hundreds of programs (or processes) running at any given moment. However, most of these programs are either system daemons or background processes that have very low memory footprint, so what is really needed is a way for individual applications to make use of the extra cores available. An application (process) can have many threads (sub-processes) operating on shared memory. Our goal is to be able to control these threads and use them to our advantage.

      Historically, introducing concurrency to an app has required the creation of one or more threads. Threads are low-level constructs that need to be managed manually. A quick skim through Apple's Threaded Programming Guide is all it takes to see how much complexity threaded code adds to a codebase. In addition to building an app, the developer has to:

      • Responsibly create new threads, adjusting that number dynamically as system conditions change
      • Manage them carefully, deallocating them from memory once they have finished executing
      • Leverage synchronization mechanisms like mutexes, locks, and semaphores to orchestrate resource access between threads, adding even more overhead to application code
      • Mitigate risks associated with coding an application that assumes most of the costs associated with creating and maintaining any threads it uses, and not the host OS

      This is unfortunate, as it adds enormous levels of complexity and risk without any guarantees of improved performance.


      Grand Central Dispatch

      iOS takes an asynchronous approach to solving the concurrency problem of managing threads. Asynchronous functions are common in most programming environments, and are often used to initiate tasks that might take a long time, like reading a file from the disk, or downloading a file from the web. When invoked, an asynchronous function executes some work behind the scenes to start a background task, but returns immediately, regardless of how long the original task might takes to actually complete.

      A core technology that iOS provides for starting tasks asynchronously is Grand Central Dispatch (or GCD for short). GCD abstracts away thread management code and moves it down to the system level, exposing a light API to define tasks and execute them on an appropriate dispatch queue. GCD takes care of all thread management and scheduling, providing a holistic approach to task management and execution, while also providing better efficiency than traditional threads.

      Let's take a look at the main components of GCD:

      What've we got here? Let's start from the left:

      • DispatchQueue.main: The main thread, or the UI thread, is backed by a single serial queue. All tasks are executed in succession, so it is guaranteed that the order of execution is preserved. It is crucial that you ensure all UI updates are designated to this queue, and that you never run any blocking tasks on it. We want to ensure that the app's run loop (called CFRunLoop) is never blocked in order to maintain the highest framerate. Subsequently, the main queue has the highest priority, and any tasks pushed onto this queue will get executed immediately.
      • DispatchQueue.global: A set of global concurrent queues, each of which manage their own pool of threads. Depending on the priority of your task, you can specify which specific queue to execute your task on, although you should resort to using default most of the time. Because tasks on these queues are executed concurrently, it doesn't guarantee preservation of the order in which tasks were queued.

      Notice how we're not dealing with individual threads anymore? We're dealing with queues which manage a pool of threads internally, and you will shortly see why queues are a much more sustainable approach to multhreading.

      Serial Queues: The Main Thread

      As an exercise, let's look at a snippet of code below, which gets fired when the user presses a button in the app. The expensive compute function can be anything. Let's pretend it is post-processing an image stored on the device.

      import UIKit
      
      class ViewController: UIViewController {
          @IBAction func handleTap(_ sender: Any) {
              compute()
          }
      
          private func compute() -> Void {
              // Pretending to post-process a large image.
              var counter = 0
              for _ in 0..<9999999 {
                  counter += 1
              }
          }
      }

      At first glance, this may look harmless, but if you run this inside of a real app, the UI will freeze completely until the loop is terminated, which will take... a while. We can prove it by profiling this task in Instruments. You can fire up the Time Profiler module of Instruments by going to Xcode > Open Developer Tool > Instruments in Xcode's menu options. Let's look at the Threads module of the profiler and see where the CPU usage is highest.

      We can see that the Main Thread is clearly at 100% capacity for almost 5 seconds. That's a non-trivial amount of time to block the UI. Looking at the call tree below the chart, we can see that the Main Thread is at 99.9% capacity for 4.43 seconds! Given that a serial queue works in a FIFO manner, tasks will always complete in the order in which they were inserted. Clearly the compute() method is the culprit here. Can you imagine clicking a button just to have the UI freeze up on you for that long?

      Background Threads

      How can we make this better? DispatchQueue.global() to the rescue! This is where background threads come in. Referring to the GCD architecture diagram above, we can see that anything that is not the Main Thread is a background thread in iOS. They can run alongside the Main Thread, leaving it fully unoccupied and ready to handle other UI events like scrolling, responding to user events, animating etc. Let's make a small change to our button click handler above:

      class ViewController: UIViewController {
          @IBAction func handleTap(_ sender: Any) {
              DispatchQueue.global(qos: .userInitiated).async { [unowned self] in
                  self.compute()
              }
          }
      
          private func compute() -> Void {
              // Pretending to post-process a large image.
              var counter = 0
              for _ in 0..<9999999 {
                  counter += 1
              }
          }
      }

      Unless specified, a snippet of code will usually default to execute on the Main Queue, so in order to force it to execute on a different thread, we'll wrap our compute call inside of an asynchronous closure that gets submitted to the DispatchQueue.global queue. Keep in mind that we aren't really managing threads here. We're submitting tasks (in the form of closures or blocks) to the desired queue with the assumption that it is guaranteed to execute at some point in time. The queue decides which thread to allocate the task to, and it does all the hard work of assessing system requirements and managing the actual threads. This is the magic of Grand Central Dispatch. As the old adage goes, you can't improve what you can't measure. So we measured our truly terrible button click handler, and now that we've improved it, we'll measure it once again to get some concrete data with regards to performance.

      Looking at the profiler again, it's quite clear to us that this is a huge improvement. The task takes an identical amount of time, but this time, it's happening in the background without locking up the UI. Even though our app is doing the same amount of work, the perceived performance is much better because the user will be free to do other things while the app is processing.

      You may have noticed that we accessed a global queue of .userInitiated priority. This is an attribute we can use to give our tasks a sense of urgency. If we run the same task on a global queue of and pass it a qos attribute of background , iOS will think it's a utility task, and thus allocate fewer resources to execute it. So, while we don't have control over when our tasks get executed, we do have control over their priority.

      A Note on Main Thread vs. Main Queue

      You might be wondering why the Profiler shows "Main Thread" and why we're referring to it as the "Main Queue". If you refer back to the GCD architecture we described above, the Main Queue is solely responsible for managing the Main Thread. The Dispatch Queues section in the Concurrency Programming Guide says that "the main dispatch queue is a globally available serial queue that executes tasks on the application’s main thread. Because it runs on your application’s main thread, the main queue is often used as a key synchronization point for an application."

      The terms "execute on the Main Thread" and "execute on the Main Queue" can be used interchangeably.


      Concurrent Queues

      So far, our tasks have been executed exclusively in a serial manner. DispatchQueue.main is by default a serial queue, and DispatchQueue.global gives you four concurrent dispatch queues depending on the priority parameter you pass in.

      Let's say we want to take five images, and have our app process them all in parallel on background threads. How would we go about doing that? We can spin up a custom concurrent queue with an identifier of our choosing, and allocate those tasks there. All that's required is the .concurrent attribute during the construction of the queue.

      class ViewController: UIViewController {
          let queue = DispatchQueue(label: "com.app.concurrentQueue", attributes: .concurrent)
          let images: [UIImage] = [UIImage].init(repeating: UIImage(), count: 5)
      
          @IBAction func handleTap(_ sender: Any) {
              for img in images {
                  queue.async { [unowned self] in
                      self.compute(img)
                  }
              }
          }
      
          private func compute(_ img: UIImage) -> Void {
              // Pretending to post-process a large image.
              var counter = 0
              for _ in 0..<9999999 {
                  counter += 1
              }
          }
      }

      Running that through the profiler, we can see that the app is now spinning up 5 discrete threads to parallelize a for-loop.

      Parallelization of N Tasks

      So far, we've looked at pushing computationally expensive task(s) onto background threads without clogging up the UI thread. But what about executing parallel tasks with some restrictions? How can Spotify download multiple songs in parallel, while limiting the maximum number up to 3? We can go about this in a few ways, but this is a good time to explore another important construct in multithreaded programming: semaphores.

      Semaphores are signaling mechanisms. They are commonly used to control access to a shared resource. Imagine a scenario where a thread can lock access to a certain section of the code while it executes it, and unlocks after it's done to let other threads execute the said section of the code. You would see this type of behavior in database writes and reads, for example. What if you want only one thread writing to a database and preventing any reads during that time? This is a common concern in thread-safety called Readers-writer lock. Semaphores can be used to control concurrency in our app by allowing us to lock n number of threads.

      let kMaxConcurrent = 3 // Or 1 if you want strictly ordered downloads!
      let semaphore = DispatchSemaphore(value: kMaxConcurrent)
      let downloadQueue = DispatchQueue(label: "com.app.downloadQueue", attributes: .concurrent)
      
      class ViewController: UIViewController {
          @IBAction func handleTap(_ sender: Any) {
              for i in 0..<15 {
                  downloadQueue.async { [unowned self] in
                      // Lock shared resource access
                      semaphore.wait()
      
                      // Expensive task
                      self.download(i + 1)
      
                      // Update the UI on the main thread, always!
                      DispatchQueue.main.async {
                          tableView.reloadData()
      
                          // Release the lock
                          semaphore.signal()
                      }
                  }
              }
          }
      
          func download(_ songId: Int) -> Void {
              var counter = 0
      
              // Simulate semi-random download times.
              for _ in 0..<Int.random(in: 999999...10000000) {
                  counter += songId
              }
          }
      }

      Notice how we've effectively restricted our download system to limit itself to k number of downloads. The moment one download finishes (or thread is done executing), it decrements the semaphore, allowing the managing queue to spawn another thread and start downloading another song. You can apply a similar pattern to database transactions when dealing with concurrent reads and writes.

      Semaphores usually aren't necessary for code like the one in our example, but they become more powerful when you need to enforce synchronous behavior whille consuming an asynchronous API. The above could would work just as well with a custom NSOperationQueue with a maxConcurrentOperationCount, but it's a worthwhile tangent regardless.


      Finer Control with OperationQueue

      GCD is great when you want to dispatch one-off tasks or closures into a queue in a 'set-it-and-forget-it' fashion, and it provides a very lightweight way of doing so. But what if we want to create a repeatable, structured, long-running task that produces associated state or data? And what if we want to model this chain of operations such that they can be cancelled, suspended and tracked, while still working with a closure-friendly API? Imagine an operation like this:

      This would be quite cumbersome to achieve with GCD. We want a more modular way of defining a group of tasks while maintaining readability and also exposing a greater amount of control. In this case, we can use Operation objects and queue them onto an OperationQueue, which is a high-level wrapper around DispatchQueue. Let's look at some of the benefits of using these abstractions and what they offer in comparison to the lower-level GCI API:

      • You may want to create dependencies between tasks, and while you could do this via GCD, you're better off defining them concretely as Operation objects, or units of work, and pushing them onto your own queue. This would allow for maximum reusability since you may use the same pattern elsewhere in an application.
      • The Operation and OperationQueue classes have a number of properties that can be observed, using KVO (Key Value Observing). This is another important benefit if you want to monitor the state of an operation or operation queue.
      • Operations can be paused, resumed, and cancelled. Once you dispatch a task using Grand Central Dispatch, you no longer have control or insight into the execution of that task. The Operation API is more flexible in that respect, giving the developer control over the operation's life cycle.
      • OperationQueue allows you to specify the maximum number of queued operations that can run simultaneously, giving you a finer degree of control over the concurrency aspects.

      The usage of Operation and OperationQueue could fill an entire blog post, but let's look at a quick example of what modeling dependencies looks like. (GCD can also create dependencies, but you're better off dividing up large tasks into a series of composable sub-tasks.) In order to create a chain of operations that depend on one another, we could do something like this:

      class ViewController: UIViewController {
          var queue = OperationQueue()
          var rawImage = UIImage? = nil
          let imageUrl = URL(string: "https://example.com/portrait.jpg")!
          @IBOutlet weak var imageView: UIImageView!
      
          let downloadOperation = BlockOperation {
              let image = Downloader.downloadImageWithURL(url: imageUrl)
              OperationQueue.main.async {
                  self.rawImage = image
              }
          }
      
          let filterOperation = BlockOperation {
              let filteredImage = ImgProcessor.addGaussianBlur(self.rawImage)
              OperationQueue.main.async {
                  self.imageView = filteredImage
              }
          }
      
          filterOperation.addDependency(downloadOperation)
      
          [downloadOperation, filterOperation].forEach {
              queue.addOperation($0)
           }
      }

      So why not opt for a higher level abstraction and avoid using GCD entirely? While GCD is ideal for inline asynchronous processing, Operation provides a more comprehensive, object-oriented model of computation for encapsulating all of the data around structured, repeatable tasks in an application. Developers should use the highest level of abstraction possible for any given problem, and for scheduling consistent, repeated work, that abstraction is Operation. Other times, it makes more sense to sprinkle in some GCD for one-off tasks or closures that we want to fire. We can mix both OperationQueue and GCD to get the best of both worlds.


      The Cost of Concurrency

      DispatchQueue and friends are meant to make it easier for the application developer to execute code concurrently. However, these technologies do not guarantee improvements to the efficiency or responsiveness in an application. It is up to you to use queues in a manner that is both effective and does not impose an undue burden on other resources. For example, it's totally viable to create 10,000 tasks and submit them to a queue, but doing so would allocate a nontrivial amount of memory and introduce a lot of overhead for the allocation and deallocation of operation blocks. This is the opposite of what you want! It's best to profile your app thoroughly to ensure that concurrency is enhancing your app's performance and not degrading it.

      We've talked about how concurrency comes at a cost in terms of complexity and allocation of system resources, but introducing concurrency also brings a host of other risks like:

      • Deadlock: A situation where a thread locks a critical portion of the code and can halt the application's run loop entirely. In the context of GCD, you should be very careful when using the dispatchQueue.sync { } calls as you could easily get yourself in situations where two synchronous operations can get stuck waiting for each other.
      • Priority Inversion: A condition where a lower priority task blocks a high priority task from executing, which effectively inverts their priorities. GCD allows for different levels of priority on its background queues, so this is quite easily a possibility.
      • Producer-Consumer Problem: A race condition where one thread is creating a data resource while another thread is accessing it. This is a synchronization problem, and can be solved using locks, semaphores, serial queues, or a barrier dispatch if you're using concurrent queues in GCD.
      • ...and many other sorts of locking and data-race conditions that are hard to debug! Thread safety is of the utmost concern when dealing with concurrency.

      Parting Thoughts + Further Reading

      If you've made it this far, I applaud you. Hopefully this article gives you a lay of the land when it comes to multithreading techniques on iOS, and how you can use some of them in your app. We didn't get to cover many of the lower-level constructs like locks, mutexes and how they help us achieve synchronization, nor did we get to dive into concrete examples of how concurrency can hurt your app. We'll save those for another day, but you can dig into some additional reading and videos if you're eager to dive deeper.




      &

      Why's it so hard to get the cool stuff approved?

      The classic adage is “good design speaks for itself.” Which would mean that if something’s as good of an idea as you think it is, a client will instantly see that it’s good too, right?

      Here at Viget, we’re always working with new and different clients. Each with their own challenges and sensibilities. But after ten years of client work, I can’t help but notice a pattern emerge when we’re trying to get approval on especially cool, unconventional parts of a design.

      So let’s break down some of those patterns to hopefully better understand why clients hesitate, and what strategies we’ve been using lately to help get the work we’re excited about approved.

      Imagine this: the parallax homepage with elements that move around in surprising ways or a unique navigation menu that conceptually reinforces a site’s message. The way the content cards on a page will, like, be literal cards that will shuffle and move around. Basically, any design that feels like an exciting, novel challenge, will need the client to “get it.” And that often turns out to be the biggest challenge of all.

      There are plenty of practical reasons cool designs get shot down. A client is usually more than one stakeholder, and more than the team of people you’re working with directly. On any project, there’s an amount of telephone you end up playing. Or, there’s always the classic foes: budgets and deadlines. Any idea should fit in those predetermined constraints. But as a project goes along, budgets and deadlines find a way to get tighter than you planned.

      But innovative designs and interactions can seem especially scary for clients to approve. There’s three fears that often pop up on projects:

      The fear of change. 

      Maybe the client expected something simple, a light refresh. Something that doesn’t challenge their design expectations or require more time and effort to understand. And on our side, maybe we didn’t sufficiently ease them into our way of thinking and open them up to why we think something bigger and bolder is the right solution for them. Baby steps, y’all.

      The fear of the unknown. 

      Or, less dramatically, a lack of understanding of the medium. In the past, we have struggled with how to present an interactive, animated design to a client before it’s actually built. Looking at a site that does something conceptually similar as an example can be tough. It’s asking a lot of a client’s imagination to show them a site about boots that has a cool spinning animation and get meaningful feedback about how a spinning animation would work on their site about after-school tutoring. Or maybe we’ve created static designs, then talked around what we envision happening. Again, what seems so clear in our minds as professionals entrenched in this stuff every day can be tough for someone outside the tech world to clearly understand.

        The fear of losing control. 

        We’re all about learning from past mistakes. So lets say, after dealing with that fear of the unknown on a project, next time you go in the opposite direction. You invest time up front creating something polished. Maybe you even get the developer to build a prototype that moves and looks like the real thing. You’ve taken all the vague mystery out of the process, so a client will be thrilled, right? Surprise, probably not! Most clients are working with you because they want to conquer the noble quest that is their redesign together. When we jump straight to showing something that looks polished, even if it’s not really, it can feel like we jumped ahead without keeping them involved. Like we took away their input. They can also feel demotivated to give good, meaningful feedback on a polished prototype because it looks “done.”

        So what to do? Lately we have found low-fidelity prototypes to be a great tool for combating these fears and better communicating our ideas.

        What are low-fidelity prototypes?

        Low fidelity prototypes are a tool that designers can create quickly to illustrate an idea, without sinking time into making it pixel-perfect. Some recent examples of prototypes we've created include a clickable Figma or Invision prototype put together with Whimsical wireframes:

        A rough animation created in Principle illustrating less programatic animation:

        And even creating an animated storyboard in Photoshop:

        They’re rough enough that there’s no way they could be confused for a final product. But customized so that a client can immediately understand what they’re looking at and what they need to respond to. Low-fidelity prototypes hit a sweet spot that addresses those client fears head on.

        That fear of change? A lo-fi prototype starts rough and small, so it can ease a client into a dramatic change without overwhelming them. It’s just a first step. It gives them time to react and warm up to something that’ll ultimately be a big change.

        It also cuts out the fear of the unknown. Seeing something moving around, even if it’s rough, can be so much more clear than talking ourselves in circles about how we think it will move, and hoping the client can imagine it. The feature is no longer an enigma cloaked in mystery and big talk, but something tangible they can point at and ask concrete questions about.

        And finally, a lo-fi prototype doesn’t threaten a client’s sense of control. Low-fidelity means it’s clearly still a work in progress! It’s just an early step in the creative process, and therefore communicates that we’re still in the middle of that process together. There’s still plenty of room for their ideas and feedback.

        Lo-fi prototypes: client-tested, internal team-approved

        There are a lot of reasons to love lo-fi prototypes internally, too!

        They’re quick and easy. 

        We can whip up multiple ideas within a few hours, without sinking the time into getting our hearts set on any one thing. In an agency setting especially, time is limited, so the faster we can get an idea out of our own heads, the better.

        They’re great to share with developers. 

        Ideally, the whole team is working together simultaneously, collaborating every step of the way. Realistically, a developer often doesn’t have time during a project’s early design phase. Lo-fi prototypes are concrete enough that a developer can quickly tell if building an idea will be within scope. It helps us catch impractical ideas early and helps us all collaborate to create something that’s both cool and feasible.

          Stay tuned for posts in the near future diving into some of our favorite processes for creating lo-fi prototypes!



          • Design & Content

          &

          So You've Written a Bad Design Take

          So you’ve just written a blog post or tweet about why wireframes are becoming obsolete, the dangers of “too accessible” design, or how a certain style of icon creates “cognitive fatigue.”

          Your post went viral, but now you’re getting ratioed by rude people on the Internet. That sucks! You were just trying to start a conversation and you probably didn’t deserve all that negativity (except for you, “too accessible” guy).

          Most likely, you made one of these common mistakes:

          1. You made generalizations about “design”

          You, a good user-centered designer, know that you are not your user. Nor are you every designer.

          First of all, let's acknowledge that there is no universal definition of design. Even if we narrow it down to software design, it’s still hard to make generalizations. Agency, in-house, product, startup, enterprise, non-profit, website, app, connected hardware, etc. – there are a lot of different work contexts and cultures for people with “designer” in their titles.

          "The Design Industry" is not a thing, but even if it were, you don't speak for it. Don’t assume that the kind of design work you do is the universal default.

          2. You didn’t share enough context

          There are many great design books and few great design blog posts. (There are, to my knowledge, no great design tweets, but I am open to your suggestions.) Writing about design is not well suited to short formats, because context plays such an important role and there’s always a lot of it to cover.

          Writing about your work should include as much context as you would include if you were presenting your portfolio for a job interview. What kind of organization did you work for? Who was your client and/or your stakeholders? What was the goal of the project? Your timeline? What was the makeup of your team? What were the notable business rules and constraints? How are you defining effectiveness and success?

          Without these kinds of details, it’s not possible for other designers to know if what you’ve written is credible or applicable to them.

          3. You were too certain

          A blog post doesn’t need to be a dissertation. It’s okay to share hunches and anecdotes, but give the necessary caveats. And if you're making claims about science, bruh, you gotta cite your sources.

          Be humble in your takes. Your account of what worked for you and why is more valuable to your peers than making sweeping claims and reheating the same old arguments. Be prepared to be told you’re wrong, and have the humility to realize that your perspective is just your perspective. Real conversations, like good design, are built on feedback and diverse viewpoints.

          Together, we can improve the discourse in our information ecosystems. Don't generalize. Give context. Be humble.




          &

          10 Cool & Free Mobile Wallpapers

          Guys, great news! Our friends at Freepik has released exclusively for s2o readers 10 Cool & Free Mobile Wallpapers in several awesome styles. They come in AI, EPS and jpg files. The wallpapers are easily resizable for any kind of mobile —or any other project ;)— so you can adapt them in a no time …

          10 Cool & Free Mobile Wallpapers Read More »