<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Shaun Church</title>
    <description>The latest articles on DEV Community by Shaun Church (@shaunchurch).</description>
    <link>https://dev.to/shaunchurch</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F86665%2F089cbe3a-7380-48a3-ab1f-c55ad4f8adb2.png</url>
      <title>DEV Community: Shaun Church</title>
      <link>https://dev.to/shaunchurch</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shaunchurch"/>
    <language>en</language>
    <item>
      <title>😇 Optimistic User Interfaces: A good kind of lie</title>
      <dc:creator>Shaun Church</dc:creator>
      <pubDate>Wed, 01 Jul 2020 20:00:00 +0000</pubDate>
      <link>https://dev.to/shaunchurch/optimistic-user-interfaces-a-good-kind-of-lie-1fek</link>
      <guid>https://dev.to/shaunchurch/optimistic-user-interfaces-a-good-kind-of-lie-1fek</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally posted on my blog, where there are &lt;a href="https://shaun.church/words/optimistic-user-interfaces"&gt;interactive examples&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What happens when you click a button on a web page?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Like the Twitter or Facebook &lt;code&gt;like&lt;/code&gt; buttons, perhaps it changes to let you know the interaction did something.&lt;/p&gt;

&lt;p&gt;In some cases it might show a &lt;code&gt;Loading...&lt;/code&gt; state while it communicates with a server to find out if your action was successful, like this:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally posted on my blog, where there are &lt;a href="https://shaun.church/words/optimistic-user-interfaces"&gt;interactive examples&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Or maybe it doesn't, like this:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally posted on my blog, where there are &lt;a href="https://shaun.church/words/optimistic-user-interfaces"&gt;interactive examples&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;This second example demonstrates what we're talking about when we say the interface is &lt;code&gt;optimistic&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;So what's going on here, and why?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Well I'm glad you asked…&lt;/p&gt;

&lt;h2&gt;
  
  
  Predicting the future
&lt;/h2&gt;

&lt;p&gt;Let's think about what happens when you click the like button on twitter:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally posted on my blog, where there as &lt;a href="https://shaun.church/words/optimistic-user-interfaces"&gt;an animation&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;A click event fires on the button, or a form submission occurs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;An API call is made with a request to mark this &lt;code&gt;postId: 323423&lt;/code&gt; as &lt;code&gt;liked&lt;/code&gt; by this &lt;code&gt;user: @shaunchurch&lt;/code&gt; in a database somewhere.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The server responds &lt;code&gt;HTTP 200 OK&lt;/code&gt; after some period of time.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;How often is there an error?&lt;/p&gt;

&lt;p&gt;Assuming your API is reliable, we can predict with some confidence that simple, regular actions will succeed most of the time, and for most users that try it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Please wait…
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;Loading...&lt;/code&gt; state is an unpleasant experience. What's worse is that how long it takes dependson a variety of factors out of our control: the speed of the user's internet connection, the distance the user is from the server, the competing traffic on those internet routes, and finally our own server response time.&lt;/p&gt;

&lt;p&gt;Loading spinners make the app feel slow and cumbersome. &lt;a href="https://blog.radware.com/applicationdelivery/applicationaccelerationoptimization/2013/12/mobile-web-stress-the-impact-of-network-speed-on-emotional-engagement-and-brand-perception-report/"&gt;It quickly gets frustrating&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Since we believe the chances of a request being successful are high, we have another option: assume this one will be too, and update the UI immediately to reflect the final state after a successful action.&lt;/p&gt;

&lt;p&gt;Here's that optimistic button again:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally posted on my blog, where there are &lt;a href="https://shaun.church/words/optimistic-user-interfaces"&gt;interactive examples&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Making mistakes
&lt;/h2&gt;

&lt;p&gt;That sounds great, and when things follow the happy path the user will experience a snappier app.&lt;/p&gt;

&lt;p&gt;But what happens if there &lt;em&gt;is&lt;/em&gt; a problem? 😲🚨&lt;/p&gt;

&lt;p&gt;What if the user loses signal, or there's an error on a relay server, or a million other things that have a small but non-zero chance of happening?&lt;/p&gt;

&lt;p&gt;It goes like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Catch the error.&lt;/li&gt;
&lt;li&gt;Revert the change back to the state of the component before the request was made.&lt;/li&gt;
&lt;li&gt;Optionally, show an error message to the user, so they know the action failed afer all.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is not a great experience. However, if the error rate is low, it may be a worthwhile trade-off for the advantage of all the successful interactions being significantly better. This needs to be judged based on the performance of your own systems, and the importance of each interaction and how it's communicated.&lt;/p&gt;

&lt;p&gt;It's possible that the user would fail to see an error notification, and assume an action that appeared successful actually was not. It might be wise to avoid using this technique for mission critical actions.&lt;/p&gt;

&lt;p&gt;The technique really shines for simple, frequent interactions such as liking a tweet. It may or may not be appropriate in more sensitive contexts, like sending payments from a bank account.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Optimistic UI update patterns give us the opportunity to make our apps feel more responsive to user interactions. They allow us to reduce visual complexity with loading states, but increase the burden of communicating errors to the user, and perhaps also the chance of losing data the user thought was saved.&lt;/p&gt;

&lt;p&gt;It should be used carefully, but can be applied in many contexts to get a noticeable boost in perceived performance and user satisfaction.&lt;/p&gt;

&lt;p&gt;Give it a try!&lt;/p&gt;

&lt;p&gt;If you made it this far, why not &lt;a href="https://twitter.com/shaunchurch"&gt;follow me on twitter&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>code</category>
      <category>ui</category>
    </item>
    <item>
      <title>🔐 App privacy, part I: Apps are not private</title>
      <dc:creator>Shaun Church</dc:creator>
      <pubDate>Sat, 31 Aug 2019 08:21:00 +0000</pubDate>
      <link>https://dev.to/shaunchurch/app-privacy-part-i-apps-are-not-private-588n</link>
      <guid>https://dev.to/shaunchurch/app-privacy-part-i-apps-are-not-private-588n</guid>
      <description>&lt;p&gt;&lt;strong&gt;It's hard to build cloud-synced collaborative apps if you genuinely care about user privacy. Most apps are not private by default &lt;em&gt;by design&lt;/em&gt;. They should be.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Making apps for making music
&lt;/h2&gt;

&lt;p&gt;I write songs. It's something I've done since I was a teenager. It's a theraputic process. The main benefit comes from the process itself. Most of the time no one hears these songs but me (and maybe the guy who lives upstairs).&lt;/p&gt;

&lt;p&gt;In 2014 I released an &lt;a href="https://play.google.com/store/apps/details?id=com.shaunchurch.songwriter.app"&gt;Android app created to help capture ideas for songs&lt;/a&gt;. It's for jotting down ideas for lyrics and recording snippets of audio to go with it: playing guitar, humming a melody, recording an improvisation to review later.&lt;/p&gt;

&lt;p&gt;It works great. I put it up for sale for a modest price and over recent years people have been discovering it organically and buying it. A growing number of them now use it consistently to record ideas. I use it myself often.&lt;/p&gt;

&lt;p&gt;It's basically a notes app. Nothing fancy. Nothing original. But because it's focused on the songwriting niche there is an opportunity to cater specifically to those needs. I have a list of ideas for the future.&lt;/p&gt;

&lt;h2&gt;
  
  
  Private work
&lt;/h2&gt;

&lt;p&gt;Songwriting is often a &lt;a href="https://www.brainpickings.org/2014/09/22/joni-mitchell-in-her-own-words-malka-marom"&gt;personal artistic exploration of ideas&lt;/a&gt;. There's a need to open up to possibilities and be non-judgemental. To be free from the perceived judgement of others. To be free to express without consequence and rely on editing later to remove the bad or the embarrassing.&lt;/p&gt;

&lt;p&gt;The creative process can be volatile, and &lt;a href="https://www.brainpickings.org/2014/07/15/leonard-cohen-paul-zollo-creativity/"&gt;sometimes work needs polishing&lt;/a&gt; before it makes sense in the world.&lt;/p&gt;

&lt;p&gt;For me, the data this app stores is sensitive. I need to be confident there is protection from prying eyes to fully engage.&lt;/p&gt;

&lt;h2&gt;
  
  
  Big brother is watching
&lt;/h2&gt;

&lt;p&gt;The idea of someone watching while you create ideas for songs is not conducive to a non-judgemental, free approach to creativity. &lt;strong&gt;There's a cost to being seen and it shows up as self-censorship&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I don't want the embarrassing teenage poetry of the first draft of the second verse I'm working on to make it out of my edit window. If there's a possibility of it getting out onto the public internet I'm going to think twice about writing it. That could be a loss. I might have reworked it in to something less cringe inducing, while carrying that same sentiment; it could become something that resonated with other inner juveniles. In part, that's the essence of songwriting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If we're censoring our true feelings we can't write our best work&lt;/strong&gt;. It's important to have privacy built-in to the apps you use to capture your creative ideas.&lt;/p&gt;

&lt;p&gt;Data privacy is even more of a concern for other types of data. Consider private journaling or diaries.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"But who is watching?"&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Platforms as a service
&lt;/h2&gt;

&lt;p&gt;Most application platforms store all user information in plain text. If I build an app today using Google's Firebase, I have access to every byte of data uploaded by that app's users.&lt;/p&gt;

&lt;p&gt;If I build an app which offers users "a private diary, synced to your web browser through the cloud", it's now possible for me as the app administrator to read every sentence they write in the app in most cases. It may not be legal--depending on what terms and policies I ask users to agree to--but it will be possible. I'm not sure what sort of audit trail exists, if one exists at all.&lt;/p&gt;

&lt;p&gt;The implications are obvious, but to be clear: &lt;strong&gt;as the admin of a diary application built on Firebase the developer has access to the private diary entries of the users.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That also goes for direct messages on that obscure dating site you joined that time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Offline for now
&lt;/h2&gt;

&lt;p&gt;Songwriter's Notebook is not built on Firebase. It stores all recorded data in the app's secure directory on-device. It stores the lyric content and all the file metadata in a simple SQLite database in that same directory. This means we can rely entirely on Android's built-in security. It's difficult to gain access to the data in that directory without rooting the device.&lt;/p&gt;

&lt;p&gt;The Export function allows you to optionally export files to another location for back up. This is opt-in and means you can make decisions about who you share your data with.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem with offline for now
&lt;/h2&gt;

&lt;p&gt;Keeping the data on-device means the app has no multi-device sync capability. It has no multi-user collaboration. It has no ability to re-import a previously exported backup. These are hugely important features, that are unavailable in part due to my desire to retain privacy. I want to allow users to opt-in to sharing, multi-device and multi-user collaboration features only if they need them. And then, I still want the data to remain unreadable to anyone not explicitly granted access.&lt;/p&gt;

&lt;p&gt;The existing export feature encourages users to backup their data to less private services: Gmail or Dropbox for example. In some ways data shared with online services unencrypted becomes part of the public record. It could leak at any time, due to a technical oversight or a malicious hack. It happens all the time.&lt;/p&gt;

&lt;p&gt;This caution comes at a cost. The app is less capable than a lot of modern apps because I think user privacy is more important than those features. But I still want those features. Multi-device cloud-based data sync is a baseline expectation for apps today.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I would like to find a way to have both syncing and privacy. To have a cake that I can share with my friends if I feel like it, without having to offer everyone a piece.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Challenge
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;It's very hard to build a secure, offline-first, privacy conscious application that allows you to &lt;em&gt;opt-in&lt;/em&gt; to cloud-based multi-device sync and collaboration features.&lt;/strong&gt; Especially as a solo developer.&lt;/p&gt;

&lt;p&gt;Some points for thought:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;There is a crisis in software development when it comes to user privacy.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Everything you post unencrypted to an online service should be considered as part of the public record.&lt;/li&gt;
&lt;li&gt;There is no guarantee of privacy in most circumstances, but many services fail to make any attempt at it.&lt;/li&gt;
&lt;li&gt;Developers are building all sorts of software using development practices that don't consider user privacy in any way.&lt;/li&gt;
&lt;li&gt;There's a lot of work to be done to make private services more accessible. To make apps built this way more useful, convenient and streamlined.&lt;/li&gt;
&lt;li&gt;How many services have you used that rely on Google's Firebase Firestore or Realtime database? Probably many.&lt;/li&gt;
&lt;li&gt;This service shares your data with the app owner with no protections.&lt;/li&gt;
&lt;li&gt;Privacy is a growing concern.&lt;/li&gt;
&lt;li&gt;Offline-first is a growing movement&lt;/li&gt;
&lt;li&gt;Surveillance capitalism: there is every incentive to spy on user data, collect it, sell it and process it for derived information. Better if it's not available unless we opt-in.&lt;/li&gt;
&lt;li&gt;The problem is keeping your data private while still allowing effective multi-device access and multi-user collaboration.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal is to build offline-first applications that can work offline-only on any platform, but that can optionally move some data online, encrypted between devices and users, to allow multi-device access and multi-user collaboration.&lt;/p&gt;

&lt;p&gt;I plan to write more on this in future and I'm interested to hear what you think.&lt;/p&gt;

&lt;p&gt;Hit the heart or unicorn if you think it's worth writing part 2.&lt;/p&gt;

&lt;p&gt;I'm &lt;a href="https://twitter.com/shaunchurch"&gt;@shaunchurch&lt;/a&gt; on twitter.&lt;/p&gt;

</description>
      <category>privacy</category>
      <category>webdev</category>
      <category>security</category>
      <category>softwareprocess</category>
    </item>
    <item>
      <title>💔 It breaks all by itself</title>
      <dc:creator>Shaun Church</dc:creator>
      <pubDate>Mon, 09 Jul 2018 12:05:00 +0000</pubDate>
      <link>https://dev.to/shaunchurch/it-breaks-all-by-itself-94b</link>
      <guid>https://dev.to/shaunchurch/it-breaks-all-by-itself-94b</guid>
      <description>&lt;p&gt;As so often happens with code left unattended, my static generated website inexplicably stopped generating with the current release of the generator. 404s now reigned where out of date content pages used to be king. Reverse chronological posts became chronological. Bad writing resurfaced from the depths of a forgotten history.&lt;/p&gt;

&lt;p&gt;It sometimes feels inevitable that code over time will eventually break itself, but this isn't quite true. Things change around it, until eventually something responds unexpectedly--or not at all. The messages miss, or say the wrong thing.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I'm sorry, who are you?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It was a bug fix, or an improvement that missed consideration of your use case. Maybe you were using it wrong all along.&lt;/p&gt;

&lt;p&gt;If change is the only constant your website will eventually break, too. The old build that used to run is no longer compatible with this machine. Essential security updates cut the tether to the functional past. The eternal braid of dependencies has tangled to the point it cuts off it's own oxygen supply.&lt;/p&gt;

&lt;p&gt;I suppose I'm growing accustomed to obsolescence. It breaks even if you don't do anything, so don't be afraid to change it. You can hear the cries that &lt;em&gt;"it wasn't supposed to be like this!"&lt;/em&gt; echoing into a backwards compatible abyss.&lt;/p&gt;

&lt;p&gt;After this brief existential overreaction and a cursory search that led &lt;em&gt;nowhere fun&lt;/em&gt;, it looks like I'm going to give Gatsby a try. Hugo's esoteric template language was never my cup of tea, so I won't drink it now it's cold. Lots of folks hate JSX too, but better the devil you know. Ask Kylie.&lt;/p&gt;

&lt;p&gt;Maybe &lt;em&gt;this&lt;/em&gt; time I'll actually use it to write a bit, too.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This time will be different.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Of course it will.&lt;/p&gt;

</description>
      <category>softwareprocess</category>
      <category>webdev</category>
      <category>code</category>
      <category>programming</category>
    </item>
    <item>
      <title>🛠 Build something for yourself</title>
      <dc:creator>Shaun Church</dc:creator>
      <pubDate>Thu, 07 Aug 2014 22:16:00 +0000</pubDate>
      <link>https://dev.to/shaunchurch/build-something-for-yourself-fc3</link>
      <guid>https://dev.to/shaunchurch/build-something-for-yourself-fc3</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published in 2014&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;There’s something in this idea of building things for yourself. I’ve never felt more motivated to work on a project, and I’ve never had a clearer perspective on the user experience of a &lt;a href="https://play.google.com/store/apps/details?id=com.shaunchurch.songwriter.app"&gt;product&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I know exactly what the problems are because I’ve experienced them myself. It highlights how blind I am when building something without truly understanding. The importance of involving end users in prototyping and testing ideas couldn’t be greater. It’s not easy to emulate truly needing to use something if you &lt;em&gt;don’t&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;I love building things. I savour the challenge, relish the satisfaction that comes from solving a problem and from making something new exist. Working with a talented team on products that are the sum of everyone’s contribution is an experience that brings many rewards.&lt;/p&gt;

&lt;p&gt;But building something that you need yourself that is also useful for others—even on a tiny scale—is something quite special.&lt;/p&gt;

&lt;p&gt;If we don’t use the things we build how can we know if they work as well as they could? We have to ask a person who does.&lt;/p&gt;

&lt;p&gt;So build something for yourself.&lt;/p&gt;

&lt;p&gt;Be the critic and the creator.&lt;/p&gt;

</description>
      <category>softwareprocess</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
