<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Techtive - Medium]]></title>
        <description><![CDATA[Creative, Productive, Innovative Tech - Medium]]></description>
        <link>https://medium.com/techtive?source=rss----902fa94cc487---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Techtive - Medium</title>
            <link>https://medium.com/techtive?source=rss----902fa94cc487---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 01:06:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/techtive" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to save 6,000 hours in product development for three years]]></title>
            <link>https://medium.com/techtive/how-to-save-6-000-hours-in-product-development-for-three-years-f52c8e193ac6?source=rss----902fa94cc487---4</link>
            <guid isPermaLink="false">https://medium.com/p/f52c8e193ac6</guid>
            <category><![CDATA[product-management]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[agile]]></category>
            <category><![CDATA[efficiency]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Henri H]]></dc:creator>
            <pubDate>Thu, 05 Nov 2020 13:21:50 GMT</pubDate>
            <atom:updated>2020-11-05T13:23:34.481Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TfvIYfORiz5U2YKFQSukMQ.jpeg" /></figure><p><a href="https://medium.com/techtive/hvordan-spare-6000-timer-i-produktutvikling-p%C3%A5-tre-%C3%A5r-829c7d0660cd">🌐 <em>Norsk utgave av artikelen</em></a></p><p>Let me tell you a story about two fictional companies. Two different companies that were going to make a similar product. Although they had the same number of developers on the team, one spent 6,000 hours more than the other developing and maintaining the product for the first 3 years. The differences can be far greater than you think. To try to explain the reason for this, it is necessary to look at some illustrated examples of tasks in connection with the project. Without going too much into the technical details, we will look at how the choices of technical solution for the tasks can have such a large impact on the surrounding work and therefore also on the bottom line.</p><p>Working in technology is fantastic! It’s a bit like when you first discovered Lego. If you put the pieces together in creative ways, you can build anything! As a technologist, you do this every day in your job, only the pieces are replaced with code. But greater opportunities also present greater challenges.</p><h3>The companies</h3><p>Let’s first meet our two companies.</p><p><strong>Routine Technologies</strong> (aka Routech) is a well-established company that has been developing software for more than 15 years. A team of 10 developers plus designer and project manager has been given responsibility for this new product on behalf of the product manager.</p><p><strong>Scalable Technologies</strong> (aka Scaletech) is a relatively new company. They already have products in the market, but now one of the teams consisting of 10 developers plus designer and project manager will start with this new product.</p><h3>The product</h3><p>It is not known whether the two companies make the same product in competition with each other, or whether they are in parallel universes, but the products are at least built on the same specification and requirements.</p><p>This includes:</p><ul><li>Somewhere between 80 and 100 different entity types, often represented with their own database table.</li><li>Around 50 screens (views)</li><li>About 70 visual systems that constitute specified functionality. Such as various tables that show data, forms for editing, search, reports, etc.</li></ul><p>A project like this is almost impossible to estimate in advance. There are too many varying factors, including a large degree of learning along the way both through user experiences and feedback from users, but not least also learning for how the technology can be built in the most appropriate way.</p><p>The latter is perhaps the most challenging to plan for. Technology choices and architecture have a big impact on how efficiently you can perform work on the system, how easy it is for different developers to work on the same code, and not least how many errors occur. Let us therefore assume that the two companies have the same estimate for the work, but look at how they actually carry out the tasks and how this affects the result. By analyzing the type of tasks a project like this can consist of, setting up some experience-based figures on scope and number, one can arrive at two figures that say something about the hourly consumption the two companies end up with. How realistic such figures become can always be discussed. But the point is to show the consequences of choices during such a process, and how difficult it is to know what another direction would cost because <a href="https://medium.com/techtive/developers-measurability-and-motivation-f68cb5497573">technology work is not measurable</a>.</p><h3>Estimate</h3><p>The most uncertain factor in such an analysis comes from the fact that the choices of technology and architecture not only affect how efficient it will be to work on each task, but it will lead to great variation in the number of tasks as well.</p><p>Let us therefore first define a probable set of tasks the work will consist of. We have determined that the product will consist of around 70 feature sets such as forms, tables and other logic to make a set of user experiences available. Each of these must be developed individually in line with specification and design. Then there will be a number of changes along the way after launch, based on experience, further development of functionality and so on. In addition, there will be a number of bug fixes.</p><p>Let us estimate that the average for new feature sets is about <strong>80 hours</strong> per set. This includes everything from new endpoints and database logic, to data flow and display logic on the front end. Further development will lead to the need for changes to each feature set, which can vary greatly in both the number of tasks and scope. But let’s assume an average of <strong>5 tasks</strong> per set, it includes everything from small tasks to create a new field in a form, to larger extensions that involve all parts of the flow. Here we can set an average of <strong>15 hours</strong> for each of the tasks of further development. Let us be optimistic enough to say that we will get <strong>12 bug fixes</strong> on average per feature set in the period, with an average of <strong>4 hours</strong> per case, including testing, putting updates into production and so on.</p><p>So then we can set up an estimate of the work in total:</p><ul><li>70 x 80 = 5,600 hours (Development of feature sets)</li><li>70 x 5 x 15 = 5,250 hours (Further development)</li><li>70 x 12 x 4 = 3,360 hours (Bug fixes)</li><li><strong>Total</strong>: 14,210 hours</li></ul><p>Distributed among 10 developers, it gives an average of 1,421 hours, which is just under one year of work per person (depending on the location). Digital product development will always consist of a lot of other work than just this, and not least many processes beyond what has to do with code such as design, project management, testing, follow-up etc. But since we compare different approaches to the development of the technology itself, we include an assumption that the rest are the same.</p><p>Time to transfer the specification to our two fine fictional product companies!</p><h3>Develop the product</h3><h4>Language and platform</h4><p>Specification has been written, design is ready and the teams are embarking on an exciting project! In Routech, they decide to write backend in a familiar language that many on the team have worked on a lot. Frontend will be built with a framework that many have worked with before and which is very widespread in technology environments worldwide.</p><p>Scaletech decides to use a common language that can be used in both frontend and backend. This with the goal of being able to share a lot of code in common parts of the system such as definitions of data structures and validation.</p><h4>Organizing the work</h4><p>In Routech they are all full-stack developers. They decide to run a set of features at a time, and that the person or people working on the individual task first create endpoints in the backend (target points for retrieving data), and then develop the frontend code that uses the specified data so that there is a close connection between features and data sources, and that knowledge of the backend layout is fresh in the memory when the frontend is to be developed.</p><p>It’s a mix of pure backend developers, pure frontend developers and some fullstacks in Scaletech. They decide to have one tech lead for each of the two areas, and that they will organize the architectural work that hits across feature sets. From there, the backend will be developed first, and frontend tasks when the necessary endpoints are in place on the backend side. Since it will often not be the same person who creates the frontend and backend for the same set of functionality, they decide to have a strong focus on reusability and documentation to increase efficiency and recognizability in different parts of the system.</p><h4>First feature set!</h4><p>With enthusiasm and commitment, Routech developers begin to build a code base for the project. They quickly put in place some basic classes for the data types at the top of the database model, and use known frameworks to make the data available for the front end. They create endpoints they envision that the front-end code needs. At the same time, someone is building the basic setup for a front-end application and creating a view for the first feature set. They synchronize with the backend and retrieve the data needed. The first feature set takes 180 hours to develop. It is the first set, and no one thinks it is unnatural that it goes well above the estimate for the individual feature set.</p><p>At Scaletech, the tech leads first discuss a little among themselves, then includes the whole team in the planning. They come up with a plan for which building blocks the system should consist of, which standards should apply to communication between backend and frontend, which components and logic should be built specifically for reuse and how they should document the work along the way. They then start on the first feature set and always have the plan in mind so that they can build long-term and scalable architecture, even if in the first instance only a single screen is to be built. They build reusable code for backend endpoints and data validation, they build an application-independent set of display components based on the front-end design, and use all the reusable code to put the first screen in place. The extra work of standardization requires a lot of time, and it takes 320 hours to put in place the first feature set.</p><h4>Example task 1 — Validation of form fields</h4><p>It is a bit difficult to show why a strong focus on standardization, reuse, readability and modularization has such a large impact on the number of working hours a project will consist of. I will therefore go through two specific example tasks and see how they are solved in the two companies.</p><p>The first task is part of the development of a form where you can create a new entity in the system, such as a row in a table or a new user. A set of fields should be displayed where you can enter numbers, text values and make selections in drop-down menus. In the event of errors in the entered data, error messages must be displayed, eg if a number is entered in a field that is above the maximum value the field allows, or a required field is not filled in.</p><p>The Routech developer has made form validation many times before, and they already have code to display form fields and error messages in place for reuse. The developer takes in the field components that are needed, and begins to write the logic that takes care of checking the values after the form has been completed. In the code, each value is checked individually to find all the errors that can occur and should be handled. The logic does the tests that are necessary, and puts some values in memory to indicate which errors have been found. A message must then be sent to the display where each component displaying a single field checks for its corresponding value in memory has an error message set, and display the error message on the screen. The logic of all this turns out to be 260 lines of code for this specific form consisting of 12 fields. It took the developer 15 hours to complete this work.</p><p>A front-end developer must add validation to the corresponding form at Scaletech. The first time code validation was made in their application, the architect made a decision to use a standardized validation structure, a so-called “schema” in connection with all work around validation. This means that a structure says what the data should look like. For example, names of the values that make up each dataset, what type they should have (text, numbers, etc.) and rules such as maximum value, length and required values. Therefore, when the database table for the relevant entity type was created in the backend, a schema structure for this data type was created, and this is available in the frontend code. A library that takes care of validation for the selected schema standard takes care of the job of checking whether the data that the user has entered into the form is valid, and it is therefore not necessary to write manual logic for this. The rules are in the schema structure that was created in the backend. It must only be ensured that the errors from the validation library appear in the correct place in the display code. This is done using pre-made flow logic which means that each form field knows where in the error responses they should look for any errors, and if the individual field finds an error, standardized display components display the error message coming from the library. The work therefore involves minimal code and the schema rule set has already been tested on the backend page. It takes the developer 2 hours to complete the validation task.</p><h4>Example task 2 — Small variant of list</h4><p>The application contains many lists of things that the user needs to keep track of. The lists in many cases have a common design. But then the Routech developer is given the task of creating a special variant on one of the existing lists. It should be made a little smaller to make room for other content that surrounds it. The rows should be a little smaller, slightly smaller font and an icon on the side of each row should be made a little smaller. Since this is an exception, the developer chooses to add some simple lines of styling that override the normal appearance. It does not take many lines of code, it just has to be tested well since this is the first time the components are shown in this exact size, in line with design sketches. The work takes 3 hours.</p><p>As soon as the Scaletech developer receives this task, a small alarm goes off in his head which says that a new standard display should be created here. The developer goes to the standard components for displaying lists, and adds a flag that says that if the component is displayed with the parameter “size = small” then the alternative sizes should be used. Thus, the options are together with the originals and can be easily maintained with examples of how it looks compared to the original. Then they put the small flag on in the current view. Extra effort has been made to build it into the standard code and the work takes 6 hours.</p><h4>Follow-up task 1</h4><p>It is not uncommon for similar tasks to appear on different parts of a system. There are many ways to save time on what happens several times in different variations. One way is to copy the original code and make the necessary adjustments for the individual implementation. This often means that the task can be completed quickly. In Routech, it is quite common to perform work in this way. The disadvantage is that then all variants of the repeating code must be maintained individually. A follow-up to the form validation emerges from example problem 1, where a couple of the fields will have new validation rules in addition to those that were created before. This will be done by a developer other than the one who first wrote the 260 lines of validation code for this form. The developer begins by getting acquainted with this code, and then builds the new rules into the existing logic. Unit tests must also be updated. The work takes 4 hours.</p><p>The developer who will apply the new validation rules at Scaletech knows the validation code well since they use such a large degree of reuse. Here, the developer goes in and adds 3–4 lines to the schema structure that contains the existing rules. This means that the rest of the code does everything by itself including making sure that any error messages are displayed in the correct place, and all the reuse logic is tested beforehand, so no new tests have to be written. Including some testing to verify, the work takes half an hour.</p><h4>Follow-up task 2</h4><p>It turns out that another list in the system needed to show the small variant of the list with less text, buttons, etc. At Routech, the developer is considering whether the special code from the previous list with this appearance should be copied into the new one or whether they should use time to make new reusable components. The designer says it is unlikely to be more than 3–4 lists that have this appearance, and developer decides to copy adjustments to the new list. With adjustments, testing in multiple browsers, the work takes 3 hours.</p><p>The corresponding list at Scaletech takes 5 minutes to change because the reusable components for this type of list already had a flag to be displayed in a small variant, and this view is well tested in the standard code.</p><h4>Fewer customizations, fewer errors</h4><p>Developers often make an assessment of whether a new code is appropriate to write for reuse or only for the individual place where it is needed for the relevant task they have been given. There is very great variation in how such architectural choices are solved, as we have already shown through the example tasks above. One of the biggest benefits of ensuring a greater degree of reuse is that you reduce the number of errors. When each feature set has a large degree of local logic, it not only leads to far more code that needs to be maintained. This tends to cause tests to be skipped (ie code that tests a single part of the code to verify that it is working properly) on large parts of the code, and thus more often unforeseen consequences of changes occur. In addition, overriding default code, such as Routech’s solution for the small variant of the list, could lead to errors when the standard code is updated and the override no longer works at the top of the standard. If, on the other hand, the override is entered as a variant inside the standard code itself, it is easier to control that this also works when the changes are made in the same place.</p><p>It is easy to say that a large degree of reuse and standardization leads to more efficient work. But it is important to point out that it is difficult to do standardization in a good way. There is a reason why the open standards for technology have been the breeding ground for large amounts of debate and conflicts between technology giants over the years. Requirements are seen differently by different people, and it is incredibly difficult to predict what other needs will arise later. This is not easy internally in a company or a team either. It is therefore important that the choice of architecture is based on experience and commitment with a realistic expectation that things never go exactly as you think in the beginning.</p><h4>Feature set 35</h4><p>After a small celebration that they have reached half of the planned feature sets the application will consist of, Routech starts with the next screen. A large table of direct editing. This was the first screen with editing in this way rather than regular forms that they have used until now. They have to create many new front-end components that duplicate much of the logic they already have for other editing. They also create some special endpoints to update the server along the way for this type of functionality. Although the average development hours for each feature set is down to around 90 hours per set, this particular set takes 140 hours.</p><p>Direct editing in tables was part of Scaletech’s original plan, so both the backend and frontend have adapted the logic for this already. Only a few small extensions are needed on the reusable code for displaying tables, and the data flow is hardly different from the other sets they have built due to the high degree of standardization. They are building a new schema model that defines how the data types for the new entity for this table should be structured, and thus get all validation and database communication quickly in place using previously developed code. The extent of reusable code leads to efficient development, and the feature set takes 60 hours to develop, which is almost the same as the average they are at in this phase.</p><h4>Launch</h4><p>After a long period of development, the product will be launched. Both companies are very satisfied with the work and the result. The project goes into maintenance, and a lot of extra functionality is being built in the period after launch. Errors are corrected continuously.</p><h3>Calculated hour consumption</h3><p>During the project, the hourly consumption is logged. In retrospect, the companies want to compare with the estimates for their own learning. Since we cannot carry out two complete projects to provide a realistic analysis, this must be based on experience from similar work.</p><h4>Routech</h4><p>The development of the feature sets themselves took a little longer in the beginning, but gradually they went down towards the estimated average, and in total the average ended at 86 hours per set, just above the estimate of 80 hours. Further development, which was estimated at an average of 15 hours per task, also went as expected and ended at 16.5 hours per task. Bug fixes went fast, ending at an average of 3 hours per error, one hour below the estimated average. However, all the individual copies and variants of the same code led to many types of errors recurring in several places, so the number of errors went well above the estimate, and ended up with 16 error corrections per feature set on average.</p><h4>Scaletech</h4><p>At Scaletech, the architects are very satisfied with the degree of reuse and code quality achieved in the project. In addition, they achieved a high test coverage. The feature sets took a lot of time to begin with, but quickly benefited from all reusability, and the high number meant that the average number of hours per set ended at 54 hours, well below the estimate of 80. The further development also enjoyed many benefits of code quality and standardization and ended at 9.2 hours on average set against the estimate of 15 hours. On error correction, the average ended at 4.5 hours per correction as it meant a little more complexity and connections between modules for reuse, but the code quality and test coverage led to far fewer errors than the estimate of 12 error corrections per function set. They ended up with 6 bug fixes on average.</p><h4>Total</h4><p><strong>Routech</strong></p><ul><li>70 x 86t = 6,020 hours (Feature sets)</li><li>70 x 5 x 16.5t = 5,775 hours (Additional features)</li><li>70 x 16 x 3t = 3,360 hours (Error corrections)</li><li><strong>Total</strong>: 15,155 hours (945 hours above estimate)</li></ul><p><strong>Scaletech</strong></p><ul><li>70 x 54t = 3,780 hours (Feature sets)</li><li>70 x 5 x 9.2t = 3,220 hours (Additional features)</li><li>70 x 6 x 4.5t = 1,890 hours (Error corrections)</li><li><strong>Total</strong>: 8,890 hours (5,320 hours below estimate)</li></ul><h3>Result</h3><p>The project manager in Routech is very pleased with the result. They ended up close to the estimate and the developers feel the project went according to expectations. They have built a product they are proud of and the team spirit is good. They are starting a new project, another product that the company will start selling. The team starts with blank sheets and will do at least as well this time!</p><p>The project manager in Scaletech arranges a small party for the team, which managed to go 37 percent below the estimate. The mood is good before they start the next project. It will be built within the same type of technology, and the architects look forward to being able to reuse half of the architecture from the first project that they intend to extract as independent modules. The estimates can probably be set lower this time, when they have a good technological foundation in place!</p><h3>Disclaimer</h3><p>So how realistic is this result? No numbers and estimates are realistic, which is why they are called estimates. The biggest challenge is that <a href="https://medium.com/techtive/developers-measurability-and-motivation-f68cb5497573">technology work is not measurable</a>. Therefore, one never knows what would have happened if one had made other choices along the way. When the advantage of spending a little extra energy on thinking about structure and reusability rather than just solving it quickly and efficiently is not so enormous for the individual task itself, and one does not know for sure how many extra errors and working hours the quick solution will bring with it, it is easy to ignore this advantage and choose the fastest solution. Work is not made efficient by a person writing code quickly. It becomes effective by writing code that make everyone’s work more efficient, not just what you have to do to solve your current task.</p><p>The figures and the description of the example tasks here are based on developer experience. I have not worked anywhere that operates exactly like any of the two examples illustrated here, but all the methods and architectural choices described are things I have experienced in several contexts. Also note that none of the descriptions of the companies’ choices seem directly inappropriate. Rather, the differences grow as a result of each other and scale up when the work becomes large enough.</p><p>I do not intend to come up with an ultimate recipe for doing technology work efficiently, because I do not think it exists. Working methods, division of responsibilities and technology choices depend first and foremost on the competence and motivation that lies in the team. Instead, try to involve those who work in the team from an early stage, and let the choices that affect the development and organization of the technology work be based on the competence of those who build the technology.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f52c8e193ac6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techtive/how-to-save-6-000-hours-in-product-development-for-three-years-f52c8e193ac6">How to save 6,000 hours in product development for three years</a> was originally published in <a href="https://medium.com/techtive">Techtive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The problem with home automation is that it is designed around the technology, not people]]></title>
            <link>https://medium.com/techtive/the-problem-with-home-automation-is-that-it-is-designed-around-the-technology-not-people-4f94254e5f20?source=rss----902fa94cc487---4</link>
            <guid isPermaLink="false">https://medium.com/p/4f94254e5f20</guid>
            <category><![CDATA[smart-home]]></category>
            <category><![CDATA[life-hacking]]></category>
            <category><![CDATA[home]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[home-automation]]></category>
            <dc:creator><![CDATA[Henri H]]></dc:creator>
            <pubDate>Tue, 14 Apr 2020 06:46:58 GMT</pubDate>
            <atom:updated>2020-04-15T12:53:07.253Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://medium.com/techtive/problemet-med-hjem-automatisering-er-at-det-handler-om-teknologien-ikke-menneskene-2cc52d035bab">🌐 Norsk utgave av artikelen</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I5dRZxF8JwcPvDKcI15fGQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@benceboros?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">BENCE BOROS</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Back in the 90’s I was visiting someone who had connected all the lamps in the living room. They could flip one light switch to light all the lamps. At our home we had to go around and flip several switches to light every single lamp individually.</p><p>Home automation technology is great! When the alarm rings on my cellphone on a work day, the lamp above my bedside table lights up to the lowest level as I stop the alarm. Just barely enough light for me to see, bring my clothes and go out without my better half waking up. At the same time, all the lights in the other rooms come on and tone up to normal for half an hour. When I walk into the wardrobe, the light comes on by itself, and I don’t have to turn it off, because it happens by itself when there has been no movement in the room for the last three minutes. In the evening we do not switch off the lights at home. First they go down to dim light around the time we put the kids to bed, then it turns off after we have all gone to bed. All lights. If someone hPhoto by BENCE BOROS on Unsplashas to go to the bathroom at night, the lights in the living room and hallway come on automatically, but at a low level that does not ruin the night vision. And it turns off by itself after a few minutes. Incredibly comfortable! But what is missing?</p><p>Large parts of this are time-controlled. For example, we have different rules for when the lights turn on and off at the weekend than on weekdays, so we can sleep longer without the lights being on for hours when no one is up. The rules you can apply for smart lighting control are quite flexible. You can pretty much set it up to meet every need around your own routines and movements. But what about deviations?</p><p>During Easter, there are holidays on Thursday and Friday, which are usually working days. So the lights come on when I would get up to go to work. There are several rules involved. The requirement is really simple. I’m in a different mode. I need it to work like holidays, even if it’s a weekday. The fastest way to achieve that is to go into all the rules that are specific to the weekend and weekdays, take away the Thursday and Friday rules from all the week rules and apply them to all the rules for the weekend. It only takes a few minutes, but it’s not just straight forward. And I must remember to do the opposite when Easter is over. Not very convenient.</p><p>So the problem is that the configuration of home automation is centered around the technology. You choose what triggers a change, for example that a sensor detects movement or that a given time on given days occurs. Then you choose what happens to the lights or other devices, and so on. You enter all the details that fit with the way we live our lives when we are at home. It is precisely this that should have been the starting point of the automation.</p><p>Imagine that you had instead set up some specific modes for your context. For example, weekdays and weekends. Or vacation. Maybe even more advanced, like relaxed, watching movies and other things. Maybe you play an instrument and have your own mode for practicing at home. All conditions that affect how you want automation to work. From there you choose how things should be in the different modes. Light in each room, whether the blinds go down and everything else. The rules are linked to mode instead of day and time. Then you choose a timetable for when the different modes occur. Days and time periods within each day.</p><p>When deviations occur, it should be easy to get it the way you want. Because you control it based on your own circumstances and not the technology. You should be able to go on a calendar in the home management app on your phone, choose Thursday and Friday during Easter week to switch them from working days to holidays. A few clicks that take seconds, and you know that your automation adapts to the needs of these days because you’ve perfected the rules for each mode.</p><p>There will obviously be more difficult to create an intuitive interface for this, but for us who work in UX, that is precisely what it is all about. I can’t say for sure that there is no product that offers such features, but I haven’t seen anything near this so far.</p><p><a href="https://medium.com/techtive/productive-creative-innovative-tech-23f0fcf704d8"><em>Techtive is about combining productivity, creativity and innovation while working with technology.</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f94254e5f20" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techtive/the-problem-with-home-automation-is-that-it-is-designed-around-the-technology-not-people-4f94254e5f20">The problem with home automation is that it is designed around the technology, not people</a> was originally published in <a href="https://medium.com/techtive">Techtive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Four major threats to digital product development]]></title>
            <link>https://medium.com/techtive/four-major-threats-to-digital-product-development-3b5787866af8?source=rss----902fa94cc487---4</link>
            <guid isPermaLink="false">https://medium.com/p/3b5787866af8</guid>
            <category><![CDATA[motivation]]></category>
            <category><![CDATA[efficiency]]></category>
            <category><![CDATA[product-management]]></category>
            <category><![CDATA[leadership]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Henri H]]></dc:creator>
            <pubDate>Thu, 27 Feb 2020 11:12:23 GMT</pubDate>
            <atom:updated>2020-02-27T11:13:58.145Z</atom:updated>
            <content:encoded><![CDATA[<h4>Seen from inside the technology</h4><p><a href="https://medium.com/techtive/fire-store-trusler-mot-digital-produktutvikling-f2476ceef614">🌐 <em>Norsk utgave av artikelen</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y2EmmAQh0N9tIg9Aw--Dlg.jpeg" /><figcaption>Image by <a href="https://pixabay.com/users/StartupStockPhotos-690514/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=593313">StartupStockPhotos</a> from <a href="https://pixabay.com/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=593313">Pixabay</a></figcaption></figure><p>The biggest difference between digital product development and other disciplines where work is largely based on professional competence is how quickly knowledge and methods change.</p><p><a href="https://medium.com/techtive/developers-measurability-and-motivation-f68cb5497573">As I have written before</a>, technology work consists of more decisions than any other discipline. Mostly small decisions, but still far more. Building a technology-based product can be compared to setting up the entire transport network in a small country. You should have major and minor roads, railways, planes and other ways of moving around. If a train station is in an inconvenient location, moving it is a costly affair. If some roads eventually become bottlenecks, new ones must be built, but first consider all the circumstances in order to meet the needs for a long time.</p><p>Because technology work consists of so many decisions, it becomes very difficult to see the overall picture. Architects must think long term, and those who do not work inside the technology have no basis for seeing the effect of good and bad decisions within this. And not least, one never knows how long other combinations of decisions would take to implement. <a href="https://medium.com/techtive/developers-measurability-and-motivation-f68cb5497573">Technology work is not measurable</a>, and this leads to many challenges. Let’s take a closer look at four challenges that are far more common than you might think.</p><h3>1. Lack of scalability</h3><p>Not only do digital products consist of thousands of small and large decisions under the hood, the basis for decisions is constantly changing. Imagine you were planning a number of new railway routes, and two months after they opened, new and more efficient trains appear, which have a greater width between the wheels and require less radius on the turns. Manufacturers stop making the old trains after a short time, because everyone uses the new ones, and you are left with a number of lines that have to be operated as before until there is room to replace them, which is expensive and at a cost of other new projects. Such is the everyday life of developers. Code quickly becomes outdated or flawed, despite the fact that the choices behind it were correct and well thought out when it was written.</p><p>The challenge of complexity and rapid change in the technology world cannot be avoided. One thing that makes it easier is large frameworks (libraries of reusable code that save you from reinventing all the wheels). Such frameworks save you a lot of repetitive code, and many others have used the same so that you can easily get answers to things you are wondering by searching online. But even such frameworks are changing rapidly, and what is popular today is not necessarily what everyone uses in two years. Or the frameworks themselves have changed and evolved so much that if you have not followed and upgraded your own implementations along the way, you will lag behind and spend a lot of time on maintenance. The challenges only get bigger when the products the company manages are more complex.</p><p>The best way to deal with this challenge is to focus on three things: <strong>Standardization</strong>, <strong>Scalability</strong> and <strong>Simplicity</strong>. This comes in many forms and contexts, and most technologists agree that it is advantageous to focus on this, but I still feel, increasingly the longer I work, that this is not accomplished to a large enough degree. Perhaps it is because where in other industries there are one or a few natural ways to solve a challenge, there are often two hundred ways to solve a challenge in the technology world. Usually as many different solutions as there are technologists.</p><p>The most general rule it is possible to try to follow here is to provide loosely coupled components to a slightly greater extent than one has to, or perhaps would have done otherwise. Loose or tight couplings come into all levels of technology. From communication between backend and frontend, right down to the smallest logic the product consists of. When each module or component, small or large, has a defined responsibility and is separated as much as possible from surrounding components, it is easier to use, easier to maintain, easier to test (!) and not least, easier to replace it later! It does not require a great deal of complexity in a product until it will consist of a high number of building blocks that can be structured in a way that results in looser couplings. Do not focus on loose couplings because it is a necessity. Makes it a pattern to (almost) always perform the work this way, even when it is not important in order to achieve the goals. It always pays off!</p><p>Structured code with standardized ways to handle storage, data flow, display and all other parts of the process will be easier for technologists to work with, less code to achieve the same solution, and not least require less maintenance.</p><p><strong><em>Les også</em></strong><em>: </em><a href="https://medium.com/techtive/developer-diversity-6c494094bf3a"><em>Developer diversity</em></a></p><h3>2. Fragmented knowledge</h3><p>When implementation of a product vision is complex and technology and knowledge are rapidly changing, this leads to fragmented knowledge. There is not only one way to solve things, which you learn in school and then use it throughout your career. Most of what a technologist does in their work is based on experience, not education. When technologists in different companies work with different technologies, different ways to use the same technologies, and absorb knowledge from a variety of different sources on the web and elsewhere, it becomes difficult to know what leads to good and bad solutions.</p><p>A fairly common result of this is that many products are built up by a set of people who work a lot in their own world. The technology is so complex that it is not possible for everyone to have an overview of everything, or be good at all parts of the technology. And if you try to get there, everyone will know just a little bit about each part. It is better to give each technologist greater responsibility within a defined area of their work. For example, a given technology, or a given part of the functionality of the product. This means that the competence around the technology becomes stronger, and in addition, the technologists experience a closer connection and ownership of what they are building.</p><p>Also let the technologists have greater influence and responsibility for the surrounding decisions taken on behalf of their work. Should you change frameworks? Why? What should you choose? How does the chosen methodology work? How can technologists acquire more knowledge beyond what they gain by performing daily tasks? Talk to the technologists about this! Fragmented knowledge cannot be avoided, so focus on creating strength through what each individual is responsible for. Make sure that the technology is built in a scalable way that makes it easier to replace each part when needed, but also for new people to understand how it all ties together. There are many forms of documentation, and there are many forms of knowledge sharing. This has a major impact on the product and the company’s success.</p><h3>3. Management</h3><p>What is the result of the relevant expertise being more fragmented, and the product far more complex? Managers who are not deeply immersed in the technology can often get a very superficial understanding of the work and challenges. <a href="https://medium.com/techtive/developers-measurability-and-motivation-f68cb5497573">When technology work is not measurable</a>, it quickly becomes more difficult to lead, since you often do not know whether the choices you have made are better than the alternatives.</p><p>A manager should focus on following up his employees on performance, not on results. If results are the only measuring point, someone will always feel that they are not achieving what is expected. If you can set goals for what the individual can perform and improve on, it is possible to have something you can personally strive for.</p><p>I once experienced at a leadership workshop that everyone around the table was asked what they think a leader should have. One of the answers was that a leader should know more than myself. Such an attitude will limit the employee’s basis for development, and they will always have to seek confirmation of their performance. One of the biggest common pitfalls is running a too tight leadership. It is in technology itself that most decisions are made in a technology company. Not the biggest, but most. Many of them, even though they are small, <a href="https://medium.com/techtive/codebase-lifespan-a29499772881">can remain for a long time</a>. It is the technologists who make these decisions every day when they do their work. If they have a lot of leeway and experience a relationship of trust around their area of responsibility, they will focus more on making the best decisions. Tight leadership, which largely controls the decisions that should be made in technology, limits the possibilities of the product. All the technological decisions in the product depend on one another to a great extent. Inappropriate choices can therefore have a negative effect in many parts of the work, and for far more people than just the one who made the decision, especially if the technology consists largely of tight couplings.</p><p>Fortunately, many people have a better approach to this, and I allow myself to pull out the oft-repeated quote from Steve Jobs:</p><blockquote>It doesn’t make sense to hire smart people and tell them what to do; we hire smart people so they can tell us what to do.</blockquote><p>Tight leadership can be experienced on many levels. The worst is what you might call “micro management”. The more complex the expertise and the basis for the product’s technology, the greater the disaster. It is important to distinguish between decisions that focus on overall direction and product choices, and what has to do with the inner function of technology. Detailed management of technology choices from outside is a recipe for demotivated employees.</p><h3>4. Demotivated technologists</h3><p>Technologists are used to the fact that technology is rapidly decaying if it is not kept up to date and further developed. They also know that it is never possible to keep everything fresh and modern at all times, and that knowledge is very fragmented. They have grown accustomed to combine technology choices and “best practices” from the technology community with the specific needs of the product. This triggers the creativity of many with architectural interest, and is for many one of the most exciting aspect of the work itself. The problem is when they do not experience the trust or leeway to build up technology in a appropriate and scalable manner. This must of course be weighed against limitations on time, resources, finances and other factors, but too close detail management will quickly come at the expense of motivation.</p><p>All technologists, whether designing, writing code or other parts of the process, possess some form of technical creativity. This can trigger many good (and bad) ideas, it can lead to great commitment on the way to the best solutions. Such creativity is important because it is such a dynamic field. Because the knowledge is so fragmented. Because the solutions are so complex and consist of so many individual decisions. The challenge is to unleash this creativity in a way that creates value and efficiency, without it becoming too costly to get there, or maintaining the road ahead. Talk to the technologists about this, go a little deeper into their needs and the utility of the solutions they propose. Look at this against what lies outside their area of responsibility. It is better to feel that one is being heard, even if there is not always room to do what is proposed. It can be costly if this is not taken seriously, as demotivated technologists might consider alternatives, and many people need technologists. A mature organization cannot be organized in the same way as when it was a small group of entrepreneurs. You will soon see that this creates both increased motivation and not least, it will lead to better bottom line.</p><p><a href="https://medium.com/techtive/productive-creative-innovative-tech-23f0fcf704d8"><em>Techtive is about combining productivity, creativity and innovation while working with technology.</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b5787866af8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techtive/four-major-threats-to-digital-product-development-3b5787866af8">Four major threats to digital product development</a> was originally published in <a href="https://medium.com/techtive">Techtive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[If you’re an introvert, build your ideas this way over time!]]></title>
            <link>https://medium.com/techtive/if-youre-an-introvert-build-your-ideas-this-way-over-time-9ae214c28a95?source=rss----902fa94cc487---4</link>
            <guid isPermaLink="false">https://medium.com/p/9ae214c28a95</guid>
            <category><![CDATA[writing]]></category>
            <category><![CDATA[ideas]]></category>
            <category><![CDATA[personal-development]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[creativity]]></category>
            <dc:creator><![CDATA[Henri H]]></dc:creator>
            <pubDate>Thu, 23 Jan 2020 08:23:55 GMT</pubDate>
            <atom:updated>2020-01-23T08:25:42.161Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lq8uoD6tc-9aeLRyuX2xJg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@sharonp?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Sharon Pittaway</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Do you often come up with ideas in random contexts related to your surroundings and everyday life? Do you like to spin thoughts and details in your head and see what comes out on the other side? Are you a creative introvert? What do you use these thoughts for, besides the temporary occupation of your mental presence?</p><p>It’s fun to have lots of ideas. Almost a bit too much sometimes. You take the subway, watch someone have a conversation in a movie, go hiking or are doing chores at home. They come at random times and you can’t predict when they will show up. It’s like your head says “what if…”. The synapses fire more than usual and a pattern forms. Some ideas are small and simple. Something you can do at work. Suggest to a colleague. Do at home. Others may be the source of great things that can grow over time.</p><blockquote>If you’re an introvert, build your ideas over time!</blockquote><p>Thoughts and ideas can sometimes consist of many details. Or they can grow to a point where the details become a lot to keep track of. I myself have found a very handy tool to persist all the details that sometimes spin around in my head. <a href="https://workflowy.com/">Workflowy</a>! It’s really just a multi-level bulleted list. The difference from taking note of thoughts and ideas in Workflowy compared to, for example, a word processor document, is that all levels of points can be opened and collapsed. And you can navigate your way inwards in all points without seeing the outer levels. This allows you to build a deep hierarchy of different topics where the details are hidden inward rather than filling up an endless large vertical document.</p><p>A tool like Workflowy works like a modern notepad. The greatest value besides being able to keep things you write down is that you can put them away! You don’t have to try to remember a number of details that will become relevant later, because you can rather put them in the right place in your structure, and then set them aside and focus your thoughts on what you are doing here and now.</p><h3>The devil is in the details</h3><p>The benefits of writing down details about a topic cannot be emphasized enough. I remember the first time I was going to give a speech, at a wedding many years ago. There were over 90 people there, and the majority of them I didn’t even know. I was incredibly nervous, which I think came out quite clearly. I was nevertheless approached by several people afterwards, who expressed that my speech had been the best of the evening. I did not sit down two weeks before the wedding thinking “hmm, I wonder what to say?”. I started a year before the wedding. All I did was to create a document on my cell phone, and every time I thought about some detail about the people to whom the speech was, something from upbringing or other relevant things, I wrote down the details in that document. A sentence here. A funny thing from childhood there. It could be weeks between each time, but when something appeared in my head in some context, I wrote it down. Shortly before the wedding, I started with all the notes, and thus had a lot to work with. There were many elements of humor, and things many of the listeners knew from before. <strong>The details were what made the result successful.</strong></p><h3>Rate &amp; Remember</h3><p>As a technologist and product manager with a developer background, there is naturally a lot of focus on technology and digital services. I have had a number of pet projects up through time based on ideas within this. I can not count how many times I’ve thought of ideas for new services, applications and products. Most of them would probably not have been realistic to implement in practice, but the creative foundation I believe is a great value in itself.</p><p>Personalization is a good example. I got an idea a few years back when I was going to buy wine. An application where one can give a rating to each wine. Then you can look through your previous ratings, thus not having to stand and try to remember which ones you have tasted before and how they were. Maybe you can give a rating to anything. Drinks, restaurants, shops, tourist spots, everything you can put an individual stamp of quality on. Of course, there are many services that do this already. However, most deal with one specific niche, such as wine. Then they build almost a whole community of social functions around this. Well and good for connoisseurs, but a bit much for those like me who just want to remember which were favorites and which there was no reason to repeat. Think further if you could personalize. I did not really like these 5 wines which were a bit bitter, so it is not likely that I like this new wine I look at which is classified by many as bitter. Pulling this far enough I should be able to stand in front of the wine shelves with my mobile phone and with the help of the camera identify the wine types in front of me, but rather than just show an average of users’ rating of them, it could predict how likely I am to like them! Pull out AR-style the three bottles from the shelf which I am most likely to like, show some info on why, and the choice will be very easy. Of course it takes quite complicated technology and data to create something like this, but that doesn’t mean it’s impossible?</p><p>Let’s take the idea further to the restaurant industry. Suppose you have booked a table at a restaurant. Instead of getting a menu with a lot of choices, the waiter comes over and says “Today we have lamb with Jerusalem artichoke, we also have North Atlantic halibut.” After confirming that you want lamb, a suggestion is made for a wine. Not the same suggestions as everyone else gets to the same dish, but in the same way as the main course suggestions, the suggestion was based on your taste profile because the restaurant had integration with the “Rate &amp; Remember” service, so they already knew your preferences.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HJF2gmoXhXym3xB3aSMtFg.jpeg" /><figcaption>Image by <a href="https://pixabay.com/users/ElisaRiva-1348268/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=2062057">ElisaRiva</a> from <a href="https://pixabay.com/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=2062057">Pixabay</a></figcaption></figure><h3>Especially if you write!</h3><p>If you want to write, it is even more important to have a box to organize and store all your thoughts in. If you sit down with a blank pad and think that you will write an entire article on a topic in a few hours and include everything that is of importance, you will in most cases miss something. The biggest example of this for me was <a href="https://medium.com/techtive/the-misunderstood-matrix-sequels-201e7b8e0311">the article I wrote about the sequels to The Matrix</a>. I planned it for a long time in advance. It ended up being more than 15,000 words long, but if a topic requires many details to gain full understanding, then it might be worth the time it takes to both write it and read it.</p><p>Lately I’ve been trying out some fiction writing as well. Then I really needed a place to record details. Building character arcs, world building, plot details, events and flow. Ideas that can be used in a story can appear in all sorts of contexts. An event, a statement from a character, a clue, surroundings, a character action. If such ideas find their way to the head at different times, should one just ignore them and hope that they emerge again at the appropriate time while writing the story itself?</p><p>I think Stephen King’s book <a href="https://en.wikipedia.org/wiki/On_Writing:_A_Memoir_of_the_Craft">“On Writing”</a> was incredibly good, but at one point I disagree with him. He writes that outlining (planning some details and story flow before writing) can ruin the creative outcome. I have great respect for Stephen King, and it may be the most appropriate way for him to work, but at the same time it is completely individual. I think it would be completely wrong to look at “pantsers” (people who write what pops into their head without any structured plan in advance) as the ultimate goal of how a creative writing process should work. Panthers VS Outliners is a topic many people write about online, and I have seen several people say that there is nothing wrong with planning a story because not everyone is capable of writing the way the greatest writers of all time have done. I think this is the completely wrong basis for judging the process. I think the need to gather and structure details in advance or impulsively while writing is more related to how the individual’s thought processes work. Different people have different thought processes, and thus there are differences in how they can best produce good content. You could always change the structure along the way while writing if new ideas emerge then. Don’t let yourself be controlled and limited by my or anyone else’s opinions on what your creative process should be. Rather, pay more attention to what you experience yourself while writing. Or when you think of ideas for something you want to write, whether it’s for fiction or fact-based content. Draw strengths from your introverted qualities and use them to create the best content based on your own premise. It provides better content and you will feel more satisfied with the end result.</p><p>P.S. I do not get paid by Workflowy for this article. They just happened to be my weapon of choice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ig9zJ8V4l8s4NPf4PzyYuw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@krisroller?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Kristopher Roller</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p><a href="https://medium.com/techtive/productive-creative-innovative-tech-23f0fcf704d8"><em>Techtive is about combining productivity, creativity and innovation while working with technology.</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ae214c28a95" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techtive/if-youre-an-introvert-build-your-ideas-this-way-over-time-9ae214c28a95">If you’re an introvert, build your ideas this way over time!</a> was originally published in <a href="https://medium.com/techtive">Techtive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reusable data handlers in React & Redux. Simple and flexible!]]></title>
            <link>https://medium.com/techtive/reusable-data-handlers-in-react-redux-simple-and-flexible-482e53cd269b?source=rss----902fa94cc487---4</link>
            <guid isPermaLink="false">https://medium.com/p/482e53cd269b</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Henri H]]></dc:creator>
            <pubDate>Mon, 13 Jan 2020 07:36:51 GMT</pubDate>
            <atom:updated>2020-03-30T07:40:45.125Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L_pWB-y_5l65eYznS1hlxw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/rfkXGUbYnS8?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Paweł Czerwiński</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>In <a href="https://medium.com/@henrik.haugberg/reusable-form-inputs-in-react-simple-and-flexible-d42fac20e451">a previous article</a>, I described how code for editing data in web forms can be simplified using an EntityData architecture that is built around use of path &amp; value for change events. But business logic for applications usually consists of far more processing code than just that.</p><p>Examples of actions you might want to implement in applications are:</p><ul><li>Fetching data from server (asynchronous process)</li><li>Indicators that data is being retrieved</li><li>Determine whether data is outdated and needs to fetched again</li><li>Displaying &amp; traversing data</li><li>Initiate editing (switch from view to form)</li><li>Change data, preferably without losing the original value</li><li>Show what has been edited</li><li>Edit part of a data set (eg, an object from a list)</li><li>Validate data</li><li>Display error messages (preferably by the relevant field)</li><li>Cancel editing</li><li>Save the edited values to the server</li><li>Delete the data</li><li>Delete parts of data sets</li></ul><p>In frameworks such as <a href="https://reactjs.org/">React</a>, much of this can be entered as state variables. They may be in the components that display the data/form, or in separate variables in parallel with the data itself where they are located (eg in a <a href="https://redux.js.org/">Redux</a> store). But in the same way as with the form fields, this tends to require a large amount of boiler plate code. The processes are often repeated on many different views in the application, with small variations from place to place.</p><h3>Manual events</h3><p>Let’s first make an example we can rectify in the search for the optimal way to handle data flow. Like so many times elsewhere in a developer’s life, it is about standardizing the code, without losing flexibility.</p><p>A user named <strong>Jon Snow</strong> is going to change its name to <strong>Aegon Targaryen</strong>. For this, the application has a web form for editing profile data:</p><pre>// actions.js<br>export const FETCH_USER_INITIATE = &#39;FETCH_USER_INITIATE&#39;;<br>export const FETCH_USER_COMPLETE = &#39;FETCH_USER_COMPLETE&#39;;<br>export const FETCH_USER_ERROR = &#39;FETCH_USER_ERROR&#39;;<br>export const CHANGE_USER = &#39;CHANGE_USER&#39;;</pre><pre>export function fetch = () =&gt; async (dispatch) =&gt; {<br>  const headers = new Headers();<br>  headers.append(&#39;Content-Type&#39;, &#39;application/json&#39;);</pre><pre>  try {<br>    const res = fetch(&#39;http://example.com/me&#39;, {<br>      credentials: &#39;include&#39;<br>      headers<br>    });</pre><pre>    const response = await res.json();</pre><pre>    if (res.statusCode === 200) {<br>      dispatch({<br>        type: FETCH_USER_COMPLETE<br>        response<br>      });<br>    } else {<br>      dispatch({<br>        type: FETCH_USER_ERROR,<br>        statusCode: res.statusCode,<br>        error: new Error(response.message)<br>      });<br>    }</pre><pre> } catch (e) {<br>    // No response<br>    dispatch({<br>      type: FETCH_USER_ERROR<br>      error: new Error(&#39;Could not connect to API&#39;);<br>    });<br>  }</pre><pre>}</pre><pre>export function change = (path, value) =&gt; {<br>  type: CHANGE_USER,<br>  path,<br>  value<br>};</pre><pre>// reducers.js<br>import {<br>  FETCH_USER_INITIATE,<br>  FETCH_USER_COMPLETE,<br>  FETCH_USER_ERROR,<br>  CHANGE_USER<br>} from &#39;./actions&#39;;</pre><pre>export default function(state = undefined, action) {<br>  switch (action.type) {<br>    case FETCH_USER_INITIATE:<br>    case FETCH_USER_COMPLETE:<br>    case FETCH_USER_ERROR:<br>      return {<br>        ...state,<br>        ...action.response,<br>        error: action.error,<br>        statusCode: action.statusCode<br>      };</pre><pre>    case CHANGE_USER:<br>      return {<br>        ...state,<br>        [action.path]: action.value<br>      };<br>      break;</pre><pre>    default:<br>      return state;<br>  }</pre><pre>}</pre><pre>// UserForm.jsx<br>import React from &#39;react&#39;;</pre><pre>class UserForm extends React.PureComponent {<br>  <br>  constructor(props) {<br>    super(props);<br>    <br>    this.state = {<br>      edit: false<br>    };<br>  }</pre><pre>  componentDidMount() {<br>    this.props.onFetch();<br>  }<br> <br>  toggleEdit = () =&gt; {<br>    this.setState({<br>      edit: !this.state.edit<br>    };<br>  };</pre><pre>  render() {<br>    const {<br>      user,<br>      onChange<br>    } = this.props;<br><br>    return (<br>      this.state.edit ?<br>        &lt;EntityData source={ user } onChange={ onChange }&gt;<br>          &lt;h1&gt;Profile&lt;/h1&gt;<br>          <br>          &lt;EntityStringField label=&quot;Name&quot; path=&quot;name&quot; /&gt;<br>          &lt;EntityStringField label=&quot;E-mail&quot; path=&quot;email&quot; /&gt;<br>        &lt;/EntityData&gt;<br>      :<br>      &lt;div className=&quot;user-form&quot;&gt;<br>        &lt;h1&gt;<br>          Profile <br>          (&lt;a onClick={ this.toggleEdit }&gt;Edit&lt;/a&gt;)<br>        &lt;/h1&gt;<br>        <br>        &lt;label&gt;Name:&lt;/label&gt; { user.name }<br>        &lt;label&gt;E-mail: { user.email }<br>      &lt;/div&gt;<br>    );<br>  }<br>  <br>}</pre><pre>const mapStateToProps = state =&gt; {<br>  return {<br>    user: state.user<br>  };<br>}</pre><pre>const mapDispatchToProps = dispatch =&gt; {<br>  onFetch: (...args) =&gt; dispatch(actions.fetch(...args)),<br>  onChange: (...args) =&gt; dispatch(actions.change(...args))<br>};</pre><pre>export default connect(mapStateToProps, mapDispatchToProps)(UserForm);</pre><p>This wasn’t really that bad! And it was ~140 lines of code. We have put the data into Redux, and with state controlling how the view work. Then some component logic to handle the user actions. And the forms are using input components as described in <a href="https://medium.com/@henrik.haugberg/reusable-form-inputs-in-react-simple-and-flexible-d42fac20e451">the first article</a> to reduce the boilerplate of the form itself, probably reducing it to less than half the amount of code. Just an example of course, probably not how anyone would actually implement it. But for showing the difference.</p><h3>Entity State</h3><p>First, let’s pull out all the state that applies to the data around the component state. Since similar processes often repeat themselves, we can define a fixed data structure that contains <a href="https://github.com/henit/entity-state#the-structure">some metadata</a> needed to perform and display an interface for such processes. By defining the structure rather than making a custom one in each case that fits exactly with the actions you use there, you might get some extra metadata keys, but you can use tested, reusable code for all operations instead of large amounts of boilerplate that require extra maintenance.</p><p>Examples of metadata we need for such processes are:</p><ul><li>The time at which the data was retrieved</li><li>Original data and modified values side by side</li><li>Flag indicating whether data is being retrieved or updated (to view spinners etc)</li><li>Error messages, individually for each field</li></ul><p>This has led to <a href="https://github.com/henit/entity-state#the-structure">a data structure that I call “Entity State”</a>, which is a data set with associated metadata. For more details, see the <a href="https://github.com/henit/entity-state">entity-state README</a>.</p><p>I have then added a number of <a href="https://github.com/henit/entity-state#entitystate">helper functions</a> for repetitive operations one does with such a dataset. Less maintenance, less errors. In addition, I have created a set of helper functions to perform <a href="https://github.com/henit/entity-state#http">HTTP requests</a>, as it is also a common application data process, and can easily be standardized without compromising flexibility.</p><p><a href="https://github.com/henit/entity-state">entity-state</a> is framework-independent.</p><h3>React Entity Data</h3><p>Because we use React and Redux, and I have used this in several other projects as well, I have standardized the logic for this in a set of help functions and components in the library <a href="https://github.com/henit/react-entity-data"><strong>react-entity-data</strong></a>. This includes the wrapper component <a href="https://github.com/henit/react-entity-data#entitydata">EntityData</a> as described in the <a href="https://medium.com/@henrik.haugberg/reusable-form-inputs-in-react-simple-and-flexible-d42fac20e451">first article</a>, including the possibility of <a href="https://github.com/henit/react-entity-data#nesting-entitydata-components">nesting</a>. It also includes Redux <a href="https://github.com/henit/react-entity-data#reduxactions">actions</a> and <a href="https://github.com/henit/react-entity-data#reduxreducers">reducers</a> that make it easy to write code for these types of views in React applications.</p><p>I continue to develop both libraries as needs arise, to achieve the effects I have described here.</p><h4>Reusing code for events</h4><p>I will now use these two libraries to achieve the same things as in the example above, but also do the following that are omitted in the example:</p><ul><li>Show which of the fields have changed (before pressing the save button)</li><li>Submit the changes back to the server</li></ul><p><em>Maybe even with fewer lines of code!</em> Tidiness, readability and flexibility is high priority. It should be easy to combine with different ways to implement everything you might need to handle data in an application. It is boiler plate code we want to avoid, we should not lock ourselves into one way to make all processes.</p><pre>// actions.js<br>import { Http } from &#39;entity-state&#39;;<br>import { ReduxAC } from &#39;react-entity-data&#39;;</pre><pre>export const FETCH_USER = &#39;FETCH_USER&#39;;<br>export const TOGGLE_EDIT_USER = &#39;TOGGLE_EDIT_USER&#39;;<br>export const CHANGE_USER = &#39;CHANGE_USER&#39;;<br>export const UPDATE_USER = &#39;UPDATE_USER&#39;;</pre><pre>export const fetch = ReduxAC.httpRequest(<br>  FETCH_USER, <br>  () =&gt; Http.get(&#39;http://example.com/me&#39;),<br>  {<br>    loading: true,<br>    loadResponse: true<br>  }<br>);</pre><pre>export const toggleEdit = ReduxAC.toggleMode(TOGGLE_EDIT_USER, &#39;edit&#39;);</pre><pre>export const change = ReduxAC.stage(CHANGE_USER);</pre><pre>export const update = ReduxAC.httpRequest(<br>  UPDATE_USER,<br>  user=&gt; Http.put(`http://example.com/users/${user.id}`,<br>  {<br>    updating: true,<br>    loadResponse: true,<br>    clean: true<br>  }<br>);</pre><pre>// reducers.js<br>import { EntityState, ReduxReducers } from &#39;react-entity-data&#39;;<br>import {<br>  FETCH_USER,<br>  TOGGLE_EDIT_USER,<br>  CHANGE_USER,<br>  UPDATE_USER<br>} from &#39;./actions&#39;;</pre><pre>export default ReduxReducers.createReducer(EntityState.initialize(), {<br>  [FETCH_USER]: ReduxReducers.httpRequest,<br>  [TOGGLE_EDIT_USER]: ReduxReducers.toggleMode,<br>  [CHANGE_USER]: ReduxReducers.stage,<br>  [UPDATE_USER]: ReduxReducers.httpRequest<br>});</pre><pre>// UserForm.jsx<br>class UserForm extends React.PureComponent {</pre><pre>  render() {<br>    const {<br>      userState,<br>      onToggleEdit,<br>      onChange,<br>      onUpdate<br>    } = this.props;<br><br>    return (<br>      userState.mode === &#39;edit&#39; ?<br>        &lt;EntityData state={ userState } onChange={ onChange }&gt;<br>          &lt;h1&gt;Profile&lt;/h1&gt;<br>          <br>          &lt;EntityStringField label=&quot;Name&quot; path=&quot;name&quot; /&gt;<br>          &lt;EntityStringField label=&quot;E-mail&quot; path=&quot;email&quot; /&gt;<br>          &lt;button onClick={ onUpdate }&gt;Save&lt;/button&gt;<br>        &lt;/EntityData&gt;<br>      :<br>      &lt;div className=&quot;user-form&quot;&gt;<br>        &lt;h1&gt;<br>          Profile <br>          (&lt;a onClick={ onToggleEdit }&gt;Edit&lt;/a&gt;)<br>        &lt;/h1&gt;<br>        <br>        &lt;label&gt;Name:&lt;/label&gt; { user.name }<br>        &lt;label&gt;E-mail: { user.email }<br>      &lt;/div&gt;<br>    );<br>  }<br>  <br>}</pre><pre>const mapStateToProps = state =&gt; {<br>  return {<br>    userState: state.user<br>  };<br>}</pre><pre>const mapDispatchToProps = dispatch =&gt; {<br>  onFetch: () =&gt; dispatch(actions.fetch()),<br>  onToggleEdit: () =&gt; dispatch(actions.toggleEdit()),<br>  onChange: (...args) =&gt; dispatch(actions.change(...args)),<br>  onUpdate: (...args) =&gt; dispatch(actions.update(...args))<br>};</pre><pre>export default connect(mapStateToProps, mapDispatchToProps)(UserForm);</pre><p>That’s ~90 lines. Wohoo !! Here’s what has changed:</p><ol><li>All actions are replaced with results from calling to ReduxAC</li></ol><p>ReduxAC holds features that create action creators. That is, “Action creator creators” to be exact. Each action creator can then be called from another action to create more complex actions in each case. Like for example:</p><pre>export const onSubmit = user =&gt; async dispatch =&gt; {</pre><pre>  try {<br>    await dispatch(update(user));<br>  } catch(e) {<br>    dispatch(ReduxAC.error(USER_ERROR)(e));<br>  }<br>  dispatch(toggleEdit());</pre><pre>}</pre><p>2. The reducer is built with helper functions.</p><p>The reducer is built with a set of types that trigger a set of pre-fabricated reducers for such processes. Possibly if you don’t like the way with createReducer then the reducer can be written in the usual way like this:</p><pre>const initialState = EntityState.initialize();</pre><pre>export default function user(state = initialState, action) {</pre><pre>  switch (action.type) {<br>    case FETCH_USER:<br>    case UPDATE_USER:<br>      return ReduxReducers.httpRequest(state, action);<br>    case CHANGE_USER:<br>      return ReduxReducers.state(state, action);<br>  }</pre><pre>};</pre><p>Simple and flexible, because all the features of ReduxReducers are reducers themselves, ie they receive state and action and return new state. ReduxReducers.createReducer therefore creates a new reducer that runs the given reducers on the given types of actions and otherwise returns state untouched.</p><p>3. Edit state toggle is moved to Redux</p><p>Using the mode metadata from Entity State, it can easily be toggled between edit view and plain.</p><p>4. Update is made with the same reusable function for HTTP requests as the one used on fetch. This also contains a number of other checks and error handling which is not the first example.</p><h3>Scaling</h3><p>The data structure in the above example is a single flat object. But as all frontend coders know, all of the logic for both display and data processing can become significantly more complex and ugly when one begins to deal with more complex structures. For example, you have downloaded a list of customers from the server (an array of company objects), and are going to edit one of them. There are several ways to do this.</p><ol><li>Separate copy</li></ol><p>You place the object to be edited as a copy somewhere else in the application state, relate to it individually, and after you finish updating it, you can make a refetch on the original list. This is a fairly common way to solve such a case. You can probably imagine all the extra logic this entails.</p><p>2. Editing based on index</p><p>When you start editing, you can place an index that says which element in the array is being edited, eg in a component state variable. This allows the viewer to display the form when you are in the iterate loop for the objects (in a list or the like), while the rest is displayed in the usual way. The logic for this can quickly become a bit ugly, and unless you create a key-value object, only one element can be edited at a time.</p><h4>3. EntityData iterate</h4><p>Because EntityData is based on <a href="https://reactjs.org/docs/context.html">React Context</a>, there is a solution that allows you to manually traverse the objects in the display code, and can easily retrieve and modify the editing mode (and other metadata relevant for each object and not the whole array). Here’s a simplified example:</p><pre>import { EntityDataContext } from &#39;react-entity-data&#39;;</pre><pre>class CompanyItem extends React.PureComponent {</pre><pre>  static contextType = EntityDataContext;</pre><pre>  render() {<br>    return <strong>this.context.mode</strong> === &#39;edit&#39; ?<br>      &lt;form&gt;<br>        ...<br>      &lt;/form&gt;<br>      :<br>      &lt;div&gt;<br>        ...<br>      &lt;/div&gt;<br>    );<br>  }<br>}</pre><pre>class CompanyList extends React.PureComponent {</pre><pre>  render() {<br>    return (<br>      &lt;EntityData state={ companyListState } <strong>iterate</strong>&gt;<br>        { company =&gt; &lt;CompanyItem company={ company } /&gt; }<br>      &lt;/EntityData&gt;<br>    );<br>  }<br>}</pre><p>There is a lot going on between the lines here so you won’t have to repeat the logic for this everywhere. For example, an entity state while editing one of the elements of the array retrieved from server will look something like this:</p><pre>{<br>  data: [<br>    { id: 123, name: &#39;Company 1&#39; }<br>    { id: 234, name: &#39;Company 2&#39; }<br>  ],<br>  pathMode: {<br>    1: &#39;edit&#39;<br>  }<br>}</pre><p>This indicates that the data at path 1 (which is the second company object) is being edited. This entity state object (including the rest of the metadata) is thus the object that EntityData receives through the state property. But because iterate is set, the render function in children will receive one company at a time, and be called for all objects in the data set. And they will provide EntityDataContext to subcomponents as if they were enclosed by an EntityData that had received this:</p><pre>{<br>  data: { id: 234, name: &#39;Company 2&#39; }<br>  mode: &#39;edit&#39;<br>}</pre><p>This eliminates the need to know which key to read, one can only retrieve mode right from context to find out if the element to which you relate is in edit mode or not.</p><h4>Deep paths</h4><p>The way to indent in the structures shown above with iterate can also be done by giving any path. For example, take a structure like this:</p><pre>const example = {</pre><pre>  data: {<br>    id: 1,<br>    name: &#39;Our company&#39;<br>    location: {<br>      address: &#39;The streets&#39;,<br>      city: {<br>        id: 45,<br>        name: &#39;Example city<br>      }<br>    }<br>  }</pre><pre>}</pre><p>Here an EntityData context for forms or other views can be done this way:</p><pre>&lt;EntityData state={ example }&gt;</pre><pre>  &lt;h1&gt;Company&lt;/h1&gt; </pre><pre>  &lt;EntityStringField label=&quot;Company name&quot; path=&quot;name&quot; /&gt;</pre><pre>  &lt;h1&gt;Location&lt;/h1&gt;<br>  <br>  &lt;EntityData path=&quot;location.city&quot;&gt;<br>    ...<br>  &lt;/EntityData&gt;</pre><pre>&lt;/EntityData&gt;</pre><p>Everything within the innermost EntityData component will receive a state (read from the outer component through context, so you don’t have to provide it the state data) that only has the city object as data, and all path metadata in the context will be received as if this was the whole state.</p><h4>Additional metadata provided to components wrapped with withEntityData</h4><p>Similar to what was described in the <a href="https://medium.com/@henrik.haugberg/reusable-form-inputs-in-react-simple-and-flexible-d42fac20e451">first article</a>, EntityData provide components wrapped with <a href="https://github.com/henit/react-entity-data#entitydata">withEntityData</a> with what is relevant for that path, so you don’t have to provide every single Input component with error, mode and all other path-based metadata from the state. Like in this example:</p><pre>const state = {<br>  data: {<br>    name: &#39;John Doe&#39;,<br>    email: &#39;john@doe.com&#39;<br>  },<br>  pathChange: {<br>    email: &#39;john@doe.email&#39;<br>  }<br>};</pre><pre>function StringField({ value, changed, error }) {<br>  return (...);<br>}</pre><pre>const EntityStringField = withEntityData(StringField);</pre><pre>function UserForm({ user }) {<br>  return (<br>    &lt;EntityData state={ state }&gt;<br>      &lt;EntityStringField label=&quot;Name&quot; path=&quot;name&quot; /&gt;<br>      &lt;EntityStringField label=&quot;E-mail&quot; path=&quot;email&quot; /&gt;<br>    &lt;/EntityData&gt;<br>  );<br>}</pre><p>If the component (StringField in the pseudo-example above) have features for indicating that a field value was changed, or that there is an error, these props (along with a few others) will be provided to the component because they are inside an EntityData component, for the given path. So in that case, the email field will be indicated as changed, something similar to what is shown in this screenshot:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KkmsSGV4zZGnjClT4Sg0_A.png" /></figure><h4>Validation</h4><p>I have also included the possibility of validating the data with <a href="https://json-schema.org/">Json Schema</a>, and that the validation function inserts path errors in entity state so that the validation errors can be displayed directly under each field. Reusable field components (similar to the previous article example) can then display the error message for each field without having to receive any additional props from the form itself.</p><p>The goal of this standardization of data processing and logic surrounding them is to make the code simpler and reduce errors without limiting flexibility. At the time of writing, the libraries cover quite a few basic functions for data handling, and more will probably be added over time. Let’s work for the three S’s: <strong>Standardization</strong>, <strong>Scalability</strong> and <strong>Simplification</strong>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=482e53cd269b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techtive/reusable-data-handlers-in-react-redux-simple-and-flexible-482e53cd269b">Reusable data handlers in React &amp; Redux. Simple and flexible!</a> was originally published in <a href="https://medium.com/techtive">Techtive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reusable form-inputs in React. Simple and flexible!]]></title>
            <link>https://medium.com/techtive/reusable-form-inputs-in-react-simple-and-flexible-d42fac20e451?source=rss----902fa94cc487---4</link>
            <guid isPermaLink="false">https://medium.com/p/d42fac20e451</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Henri H]]></dc:creator>
            <pubDate>Mon, 13 Jan 2020 07:36:20 GMT</pubDate>
            <atom:updated>2019-10-22T12:27:37.721Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cHqZBmfZN2FYPasj4sOs9A.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/dvIz-5VZkbU?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">rawpixel</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>One of the important challenges when writing code, is to make standardized, reusable features, without losing flexibility. It’s usually not a good idea to make a function so flexible that it can do “everything”, but at the same time you want to avoid having to make too many different functions to cover needs that is relatively similar.</p><p>When making input fields for a web front end, this is no exception. Forms on the web does not work the way they did in the early days of HTML. Instead of having data in input tags until you press a submit button that sends the whole set of form-data to a server, a modern web application keeps a state in the browser memory. The form and input tags is just for display, while the masters of the data is the application state.</p><p>However, this also makes the javascript logic more complex. When the user input something, like writing in a text field, the state has to be changed during input, while keeping the display updated. React describes this difference as <a href="https://reactjs.org/docs/uncontrolled-components.html">controlled or uncontrolled</a> components. Let’s have a look at a simple example:</p><pre>&lt;input type=”text” value={ user.name } /&gt;<br>&lt;input type=”email” value={ user.email } /&gt;<br>&lt;input type=”text” value={ user.phone } /&gt;</pre><p>That’s it! Our form is ready with three input fields for the user to be able to edit their name, e-mail and phone number on the profile page. Easy and short code, right? This is of course never enough. If we want the form to be controlled, each input field need to receive an onChange property. Then we want a label above the input to tell what field it is. We also want the design unified with the same amount if air between and so on, so we wrap each field in another DOM-element to be able to style everything.</p><pre>&lt;div className=&quot;profile-form&quot;&gt;<br>  <br>  &lt;div className=&quot;field&quot;&gt;<br>    &lt;label&gt;<br>      Name<br>      &lt;input <br>        type=&quot;text&quot;<br>        value={ user.name }<br>        onChange={ e =&gt; this.handleChange(&#39;name&#39;, e.target.value) } /&gt;<br>    &lt;/label&gt;<br>  &lt;/div&gt;</pre><pre>  &lt;div className=&quot;field&quot;&gt;<br>    &lt;label&gt;<br>      E-mail<br>      &lt;input<br>        type=&quot;email&quot;<br>        value={ user.email }<br>        onChange={ e =&gt; this.handleChange(&#39;email&#39;, e.target.value) } /&gt;<br>    &lt;/label&gt;<br>  &lt;/div&gt;</pre><pre>  &lt;div className=&quot;field&quot;&gt;<br>    &lt;label&gt;<br>      Phone<br>      &lt;input<br>        type=&quot;text&quot;<br>        value={ user.phone }<br>        onChange={ e =&gt; this.handleChange(&#39;phone&#39;, e.target.value) } /&gt;<br>    &lt;/label&gt;<br>  &lt;/div&gt;</pre><pre>&lt;/div&gt;</pre><p>Notice how we need to repeat the pattern of reading the target value from the inputs. We also have to repeat the property keys twice per field (in the value reference, and in the argument for the handleChange method). This also leads to the problem that the handler- arrow function is created/replaced every time the render function is called, so everything that receives these functions will re-render even if the value for that field was not changed. So, <a href="https://www.youtube.com/watch?v=M-_5JJmNB6E">listen very carefully, for we will create these functions only once</a>:</p><pre>// ProfileForm.jsx</pre><pre>class ProfileForm extends React.PureComponent {<br>  <br>  constructor(props) {<br>    super(props);</pre><pre>    this.handleNameChange = this.handleNameChange.bind(this);<br>    this.handleEmailChange = this.handleEmailChange.bind(this);<br>    this.handlePhoneChange = this.handlePhoneChange.bind(this);<br>  }</pre><pre>  handleNameChange(e) {<br>    this.props.onChange(&#39;name&#39;, e.target.value);<br>  }</pre><pre>  handleEmailChange(e) {<br>    this.props.onChange(&#39;email&#39;, e.target.value);<br>  }</pre><pre>  handlePhoneChange(e) {<br>    this.props.onChange(&#39;phone&#39;, e.target.value);<br>  }</pre><pre>  render() {<br>    const { user } = this.props;<br>    <br>    return (<br>      &lt;div className=&quot;profile-form&quot;&gt;<br>      <br>        &lt;div className=&quot;field&quot;&gt;<br>          &lt;label&gt;<br>            Name<br>            &lt;input<br>              type=&quot;text&quot;<br>              value={ user.name }<br>              onChange={ this.handleNameChange } /&gt;<br>          &lt;/label&gt;<br>        &lt;/div&gt;</pre><pre>        &lt;div className=&quot;field&quot;&gt;<br>          &lt;label&gt;<br>            E-mail<br>            &lt;input<br>              type=&quot;email&quot;<br>              value={ user.email }<br>              onChange={ this.handleEmailChange } /&gt;<br>          &lt;/label&gt;<br>        &lt;/div&gt;</pre><pre>        &lt;div className=&quot;field&quot;&gt;<br>          &lt;label&gt;<br>            Phone<br>            &lt;input<br>              type=&quot;text&quot;<br>              value={ user.phone }<br>              onChange={ this.handlePhoneChange} /&gt;<br>          &lt;/label&gt;<br>        &lt;/div&gt;<br>      &lt;/div&gt;<br>    );</pre><pre>  }</pre><pre>}</pre><p>Now we have a complete form component. The problem is that the pattern of tags and logic surrounding handling of input change contains a lot of repeated code. It should be possible to render three form fields with less than 60 lines of code. Here is the solution I implemented for this.</p><h4>1. Input components</h4><p>We make our own “API” for how we want to interact with inputs in our web views. In 99.9% of the cases, you don’t need anything other than the value of the input from the event object. So no point in sending out the whole event object all the time. Let’s just send the value. Then we can add other reusable logic that we don’t want to repeat, like showing a text length counter, handling enter press (with an event instead of adding key-code comparison everywhere) and similar things.</p><pre>// StringInput.jsx</pre><pre>export default class StringInput extends React.PureComponent {</pre><pre>  constructor(props) {<br>    super(props);<br>    this.handleChange = this.handleChange.bind(this);<br>  }<br>  <br>  handleChange(e) {<br>    this.props.onChange &amp;&amp; this.props.onChange(e.target.value);<br>  }</pre><pre>  render() {<br>    const {<br>      className,<br>      value<br>    } = this.props;</pre><pre>    return (<br>      &lt;input<br>        className={ className }<br>        type=&quot;text&quot;<br>        value={ value }<br>        onChange={ this.handleChange } /&gt;<br>    );<br>  }</pre><pre>}</pre><p>Now we have turned this:</p><pre>&lt;input<br>  type=&quot;text&quot;<br>  value={ user.name }<br>  onChange={ e =&gt; this.handleChange(e.target.value) } /&gt;</pre><p>into this:</p><pre>&lt;StringInput<br>  value={ user.name }<br>  onChange={ this.handleChange } /&gt;</pre><h4>2. Field components</h4><p>In addition to labels and wrapper divs, we will probably need more view logic for each field. Like showing validation errors. Every element adds more boilerplate and when making large forms with a high number of fields (not just three simple user profile fields), this leads to some long and ugly render methods. Let’s wrap our inputs in some Field components.</p><pre>// StringField.jsx</pre><pre>function StringField({ label, ...inputProps }) {<br>  return (<br>    &lt;div className=&quot;string-field field&quot;&gt;<br>      { label &amp;&amp; &lt;label&gt;{ label }&lt;/label&gt; }<br>      &lt;StringInput { ...inputProps } /&gt;<br>    &lt;/div&gt;<br>  );</pre><pre>}</pre><p>Now, every field can be rendered with label and wrapping field-div with just one line:</p><pre>&lt;StringField label=&quot;Name&quot; value={ user.name } /&gt;</pre><p>Why not just have field-components instead of one input and one field? For flexibility! We want to be able to put inputs straight up without labels, error messages and so on in components where that is needed, but we don’t want to repeat all the logic inside the input components. We want our defined input component API everywhere.</p><h4>3. The magical EntityData</h4><p>Why should we repeat the property key for what part of the source entity to use several times per field? The sources of data for forms like these are usually JSON-data from a server. An object with a set of properties, possibly deep structures. In any case, all data is located at a given path inside an object, that can be accessed using tools like <a href="https://lodash.com/docs/4.17.11#get">lodash </a>get. So instead of passing values to each input by referring to the source object (like value={ user.name }), let’s just send the path to where the data is, and a reference to the source object.</p><pre>&lt;StringInput source={ user } path=&quot;name&quot; /&gt;</pre><p>And then we add the path as argument to onChange calls from the component so surrounding logic can have one function handle updates from multiple inputs:</p><pre>handleChange(e) {<br>  const { path, onChange } = this.props;</pre><pre>  onChange &amp;&amp; onChange(path, e.target.value);<br>}</pre><p>Possibly add a separate onValueChange etc for handling direct one-argument events for functional programming chains/compilations that only need the value.</p><p>However, this will require sending the source object in as prop to every input instead. Same as the onChange handler. Do you see a pattern emerging here?</p><p>The repeated properties is a nice opportunity for using the <a href="https://reactjs.org/docs/context.html">React Context</a>. The old context system in React was a bit like walking in the woods late at night. It could contain a lot of strange stuff you had no idea why was there, and you could collide with other things. The new context is much better. We can wrap all our fields in an EntityData component, that has a ContextProvider, and then wrap the input components in a <a href="https://reactjs.org/docs/higher-order-components.html">HOC</a> for reading this context. Here is a simple example:</p><pre>// EntityData.jsx</pre><pre>const EntityDataContext = React.createContext();</pre><pre>export function withEntityData(Component) {<br>  return function EntityDataComponent(props) {<br>    return (<br>      &lt;EntityDataContext.Consumer&gt;<br>        { entityProps =&gt; {<br>          const source = props.source || entityProps.source;<br>          const path = props.path;<br>          const sourceValue = _.get(path, source);<br>          const value = props.value !== undefined ?<br>            props.value : sourceValue;<br>          const onChange = props.onChange || entityProps.onChange;</pre><pre>          return (<br>            &lt;Component<br>              { ...props }<br>              source={ source }<br>              path={ path}<br>              value={ value } /&gt;<br>              onChange={ onChange } /&gt;<br>          );<br>        }}<br>      &lt;/EntityDataContext.Consumer&gt;<br>    );<br>  };<br>}</pre><pre>export default class EntityData extends React.PureComponent {</pre><pre>  render() {<br>    return (<br>      &lt;EntityDataContext.Provider value={{<br>        source: this.props.source,<br>        onChange: this.props.onChange<br>      }}&gt;<br>        { this.props.children }<br>      &lt;/EntityDataContext.Provider&gt;<br>    );<br>  }</pre><pre>}</pre><pre>// StringInput.jsx<br>import { withEntityData } from &#39;./EntityData&#39;;</pre><pre>class StringInput extends React.PureComponent {<br>   // ... Same as before<br>}</pre><pre>export default withEntityData(StringInput);</pre><p>Now we can simplify this:</p><pre>&lt;StringField<br>  label=&quot;Name&quot; <br>  value={ user.name } <br>  onChange={ value =&gt; this.handleChange(&#39;name&#39;, value) } /&gt;<br>&lt;StringField<br>  label=&quot;E-mail&quot; <br>  value={ user.email } <br>  onChange={ value =&gt; this.handleChange(&#39;email&#39;, value) } /&gt;<br>&lt;StringField<br>  label=&quot;Phone&quot; <br>  value={ user.phone } <br>  onChange={ value =&gt; this.handleChange(&#39;phone&#39;, value) } /&gt;</pre><p>into this:</p><pre>&lt;EntityData source={ user } onChange={ this.handleChange }&gt;<br>  &lt;StringField label=&quot;Name&quot; path=&quot;name&quot; /&gt;<br>  &lt;StringField label=&quot;E-mail&quot; path=&quot;email&quot; /&gt;<br>  &lt;StringField label=&quot;Phone&quot; path=&quot;phone&quot; /&gt;<br>&lt;/EntityData&gt;</pre><p>The source and onChangeargument is sent to all child components of the EntityData component (that is wrapped with the withEntityData HOC).</p><h4>4. Flexibility (values etc)</h4><p>For full flexibility of use, we still need to be able to send values, sources/paths and onChange (plus any other events/attributes) into our input components if we are using them in a non-EntityData implementation. So let’s have the inputs read the value-prop as first priority, then the source/path props for reading from an entity if the value is not set, and third priority is the context data:</p><pre>render() {<br>  const {<br>    value,<br>    path,<br>    source<br>  } = this.props;</pre><pre>  const inputValue = (value !== undefined ? value : _.get(path, source)) || &#39;&#39;;</pre><pre>  return (<br>    &lt;input type=&quot;text&quot; value={ inputValue } /&gt;<br>  );<br>}</pre><p>These properties are then received through the EntityData HOC, so any source/onChange argument to the EntityData will be sent into the input components inside, but if they receive source/onChange properties directly, that will override the ones from EntityData.</p><p>And, since the onChange calls from within the inputs send the path as first argument, any function (like a redux action) that can take a path and a value can be used to handle the data from the input. This avoids the need for separate handler functions per field, especially when it is for manipulating properties of the same entity object.</p><p>So now we can simplify the ProfileForm from above down to this:</p><pre>class ProfileForm extends React.PureComponent {</pre><pre>  render() {<br>    const { user, onChange } = this.props;<br>    <br>    return (<br>      &lt;div className=&quot;profile-form&quot;&gt;<br>        &lt;EntityData source={ user } onChange={ onChange }&gt;<br>          &lt;StringField label=&quot;Name&quot; path=&quot;name&quot; /&gt;<br>          &lt;StringField label=&quot;E-mail&quot; path=&quot;email&quot; /&gt;<br>          &lt;StringField label=&quot;Phone&quot; path=&quot;phone&quot; /&gt;<br>        &lt;/EntityData&gt;<br>      &lt;/div&gt;<br>    );<br>  }</pre><pre>}</pre><p>Our ~65 line form component is reduced to ~15 lines. WOHOO! Now we just need a flexible but boilerplate-limited way of handling http requests to the server and their state. But let’s leave that for another article.</p><p><em>UPDATE: I have now made open source libraries to make this kind of logic available. For more information, read the </em><a href="https://medium.com/@henrik.haugberg/reusable-data-handlers-in-react-redux-simple-and-flexible-482e53cd269b"><em>next article</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d42fac20e451" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techtive/reusable-form-inputs-in-react-simple-and-flexible-d42fac20e451">Reusable form-inputs in React. Simple and flexible!</a> was originally published in <a href="https://medium.com/techtive">Techtive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Interviewing developers]]></title>
            <link>https://medium.com/techtive/interviewing-developers-ae2d4dc260ae?source=rss----902fa94cc487---4</link>
            <guid isPermaLink="false">https://medium.com/p/ae2d4dc260ae</guid>
            <category><![CDATA[recruiting]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[job-interview]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[knowledge]]></category>
            <dc:creator><![CDATA[Henri H]]></dc:creator>
            <pubDate>Thu, 16 Aug 2018 17:51:01 GMT</pubDate>
            <atom:updated>2018-08-16T17:51:01.254Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YzohB0ZXiVkT9LjrC6yWXw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/-87JyMb9ZfU?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Joshua Earle</a> on <a href="https://unsplash.com/@joshuaearle?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Besides all the usual questions, what should you talk to developers about during a job interview? It is not enough to ask what programming languages and tools the candidate has worked with.</p><p>Naturally, it is important to talk about all the things that are not directly related to development. Such as history, work culture, motivation, role and responsibility, expectations and anything else relevant to the engagement. What is difficult is to go in depth on the candidate’s experience and skills within the actual development work. Especially if you do not have developer background yourself.</p><p>Here follows a series of example questions about development work. Most of them have no clear answer, and the answers must be weighed against your company’s needs and existing team. Under each question, I go through some important factors relating to the candidate’s answers.</p><h4><strong>Can you describe how you proceed when you start a new, average size developer task?</strong></h4><p>The question is about seeing their work in a context and structure. <em>Code bases are complex machinery consisting of a large network of decisions made by different developers at different times.</em> Even a relatively small task must be seen against similar architecture and existing logic. The candidate also has the opportunity to describe how they prefer to work, beyond what has to do with coding. Such as planning, specification, product development, etc.</p><h4><strong>Do you prefer a pre-made specification, or an open process?</strong></h4><p>The question is a bit vague, deliberately. Some developers are “doers” who prefer to get the tasks specified in advance and will avoid taking part in planning and decision making. Others like to work closely with product development, design and other surrounding processes.</p><h4><strong>What is most important, developing new product features or maintenance and refactoring of the code itself?</strong></h4><p>The answer is of course both, but what matters is that the candidate shows an understanding of the surrounding processes. Why different people and departments in a company have different approaches to the work that bring the product forward. And how these needs can often create challenges around prioritization.</p><h4>Are you fast and efficient, or creative and thorough?</h4><p>No correct or wrong answer here, but the least positive is a short answer that just says something like “Something in between?”. This topic is of great relevance to how the developer fits into existing teams and working methods.</p><p><strong>Read also:</strong> <a href="https://medium.com/techtive/developer-diversity-6c494094bf3a">Developer diversity</a></p><h4>To what extent do you like to participate in discussions and decisions about technology choices?</h4><p>Technology choices are about setting the premises for development work. Decide what will be in the toolbox of the team in the future. Some prefer that others take decisions on technology and architecture, others have great enthusiasm for this.</p><h4>You want to use a library you have used before and know well. Others on your team want to use another one. How do you relate to the situation?</h4><p>This is a follow-up from the question of technology choices. Here the candidate has room for sharing experiences about how they have previously made technology choices, especially when others in the team have different experience or preferred solution.</p><h4>What gives the code quality, and what characterizes a good code base?</h4><p>This provides many opportunities to show knowledge about building efficient technology. It’s about writing code that is easy for other developers to work with later, code that reduces maintenance, performance, security, and more.</p><p><strong>Read also:</strong> <a href="https://medium.com/techtive/does-your-team-write-good-code-8b1dcec6404d">Does your team write good code?</a></p><h4>Do you prefer small, simple tasks, or to be responsible for major architecture?</h4><p>In a development team, it is usually an advantage that one person or a small group is in charge of architecture. Someone who spends a little more time thinking through and working on how the whole system is built together, consider the framework in which the system is based on and similar. If this is not done in a structured manner, code quality will suffer.</p><h4>An entire product team is gathered for a status meeting. Product owner, project manager, designer, analysts, sellers, developers and support. In what parts of the meeting are you active?</h4><p>Learn what areas the developer is interested in. Some people is only involved in technology work, and maybe that’s exactly what you need. Others prefer to participate more in discussions and planning in all parts of the product work.</p><h4>When do you work most efficiently?</h4><p>Developers need to be able to immerse themselves in their work. Some tasks require high concentration, and even small disturbances can cause work to take significantly more time. Here, the candidate also has the opportunity to say more about what time of the day they are most effective, office landscapes, meeting culture etc.</p><h4>What is the biggest obstacle to effective development in general?</h4><p>I know that I believe code quality is what has the greatest impact on efficiency. But that is of course only one of the factors. Good maintenance of the code does not help if the team is not working well. Or if the user experience is poor. Let the candidate show their broad experience and ability in overall assessment.</p><h4>What was the biggest weaknesses of code bases you’ve worked with before?</h4><p>This could both say a lot about the candidate’s competence and ability to work well in teams.</p><h4>What do you think about code reviews?</h4><p>Code reviews are conducted quite differently. Some require that all code pushed to the repository will be reviewed by another developer. Some teams use this as a matter of need and scope, some do not have code reviews at all. It is also interesting to hear how the candidate looks at these processes in general, what advantages and disadvantages it offers, and how well it has worked where they has worked previously.</p><h4>How do you acquire new knowledge as a developer?</h4><p>It’s hard to keep up to date on everything happening in the technology world, even within just the languages and tools you use yourself. Many developers acquire knowledge both in and outside work. Many have it as a hobby in addition to work, may have some pet projects or read about new technology online. Find out more about the candidate’s interest in professional knowledge beyond the minimum required to get the job done.</p><h4>How do you like to share your expertise with others?</h4><p>Some people prefer to learn everything themselves and in their own way. Some like to hold presentations, write online and arrange meetups. Consider this against how you want to share knowledge within your company.</p><h4>Do you have any open projects on Github or similar? How active are you in the online technology communities?</h4><p>Activity in communities can be both through work and in spare time. Many have their own projects that they share with others, or contribute to Github issues, Stack overflow and similar environments where developers can learn and help each other.</p><h4>What do you like to spend time on in your job, outside of working with code?</h4><p>Some have a small designer in the stomach, some like to take part in product development work, some just want to write code.</p><h4>If you may want to focus on something else, or more than code work some time in the future, what do you think it could be?</h4><p>The answers here will depend much on what background, experience level and wishes the candidate may have for the future. For many, development is what is in focus. Although they may not be certain that it will be the majority of work the rest of their career, they may not know what the next step will be. Some may still enjoy developing, but want to take more responsibility around other parts of the processes such as project management or architecture choices. Some may want to work more with innovation. <em>The future is open!</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5HtC_wekjj2rujLxNVuQkQ.png" /></figure><p><a href="https://medium.com/techtive/productive-creative-innovative-tech-23f0fcf704d8"><em>Techtive is about combining productivity, creativity and innovation while working with technology.</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae2d4dc260ae" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techtive/interviewing-developers-ae2d4dc260ae">Interviewing developers</a> was originally published in <a href="https://medium.com/techtive">Techtive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is (good) UX?]]></title>
            <link>https://medium.com/techtive/what-is-good-ux-2e1cfc1dece1?source=rss----902fa94cc487---4</link>
            <guid isPermaLink="false">https://medium.com/p/2e1cfc1dece1</guid>
            <category><![CDATA[user-interface]]></category>
            <category><![CDATA[user-experience]]></category>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[product-development]]></category>
            <category><![CDATA[ui-design]]></category>
            <dc:creator><![CDATA[Henri H]]></dc:creator>
            <pubDate>Mon, 06 Aug 2018 04:51:01 GMT</pubDate>
            <atom:updated>2018-08-06T05:48:40.100Z</atom:updated>
            <content:encoded><![CDATA[<p>UX is everything! It is the overall perception users get from using the service you make. On UX you are not only in competition with similar products as your own, you are in competition with all the services your customers are using every single day.</p><h3>The difference between UX and UI</h3><p>First of all, UX (User eXperience) and UI (User Interface) are two different things. User interface is the interfaces between man and machine. The screen the user is looking at, the content and data they can see and the buttons they can tap are the User Interface. User Experience, is the whole experience and feelings the user gets of everything they relate to at the service, and the products that represent the service. In addition to the user interface, the whole structure of the customer journey plays a role for good UX. How the product is communicated, how it is experienced, what value and sense of value it provides, how well it adapts to the individual user, how easy it is to use, and not least how it is to contact support.</p><p>If users do not like the user experience, they will not return. Good UX is something you get used to. Bad UX, is annoying every single time you experience it. First and best advice is to use your product yourself. Make sure that as many as possible in the company who have the opportunity, use your product as intended. They are probably not the most independent testers and critics, but you can nevertheless notice many aspects of the product that may not be reported to you by users because they have already become used to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nn4ozf6iRpeLqdy5qW3YTg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/njLUrw8t8cQ?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Ricardo Mancía</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>Perfectionism</h3><p>It’s incredibly difficult, maybe impossible to create perfect UX. Users are different, have different needs and different perception of what is a good user experience. You as a product developer are responsible for working continuously to perfect the user experiences. Put yourself in the user’s context, review every detail, write down the improvement potentials you notice. Force yourself to be picky on details. Very picky!</p><p>Is the menu inconvenient to use? You can be sure that many users have also noticed! What shortcut keys can be used in the text box? Does the font give the right feeling the product wants to give? Do customers have to go through an onboarding process that is a bit difficult to understand? Rewrite the text and replace the images! Or go through the whole process, with a designer. Run A/B tests. How is your company perceived on your own websites? On social media? In which channels are you available for questions from users? How fast do they respond?</p><h3>Examples</h3><p>To show how little it takes, I’ll go through some examples I have experienced of good and bad UX.</p><h4>Netflix &amp; HBO</h4><p>Since I stopped using linear television in 2011, I have used different streaming services for movies and series. Netflix and HBO have been used the most, and are therefore natural to use as examples. At home we use Chromecast for everything we watch on TV. Implementations may vary slightly between service providers, but works mostly good. The user experience, on the other hand, varies a lot. The quality of the user interface in HBO’s application has varied a lot. Navigation has occasionally been completely illogical and cluttered, and sometimes I’ve wondered if they’ve done any user testing at all.</p><p>Netflix is in a league of their own here. Their application and user experience feels like it’s designed to provide a good experience, not just to look good. The last change they now implemented is that it is possible with a single tap in the player to skip episode intro or story recap. I often like to watch episode intros, especially if they have good music (like Game of Thrones, even if it’s not on Netflix). Nevertheless, I am pleased that they have made the opportunity to skip past. A feature that does not give them any more revenue, it only provides better user experience. I get the feeling they’re working a lot on this. It’s a long time since they ensured that subtitles moves to the top of the screen when there is other text on the video itself. This has been missing on HBO. A couple of years ago, <a href="https://www.facebook.com/Vipps/posts/1111005642385462">I wrote to them on Facebook and asked about this</a>, they replied that they were working on this and that it should be in place for new content. It has not worked afterwards either.</p><p>A small (but important!) detail where HBO has done far better than Netflix. When I watch series and the episode is at the end, there are changes in the mobile interface (for controlling Chromecast playback) in both services. On Netflix, you’ll see a display in which an image of the next episode slide across the screen, and you can tap to play. On the other hand, when you are done for the evening and want to stop, you first have to hit the close icon in the top right corner of the dialog, then tap to open the Chromecast playback bar to open the playback dialog, there you can tap the stop button so the next episode does not start playing automatically. Inconvenient and a bit annoying. On HBO there is no fancy screen with the next episode, but when the current episode is at the end, a stop button appears next to the play button down on the Chromecast bar, allowing you to choose between the two most logical choices in this situation: Start next episode, or stop. Thumbs up for HBO on UX there!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XW2OSLd4LZztYXVa3ZP2cQ.png" /></figure><p>By the way, I made another observation of my own perception of UX for the two film giants recently. I noticed that the subtitles on Netflix was in UPPERCASE. Suddenly I found myself thinking that maybe this is because Netflix have come across research showing that subtitles on TV are read more easily when they are in capital letters, and that they just made a choice that this therefore becomes a better user experience. It still felt somewhat unfamiliar, and I thought that if I had experienced the same on HBO, which I generally have a habit of perceiving as a service with poor user experience, I would probably have thought that this was stupid, and I hope they fix it soon.</p><h3>Some examples of bad UX</h3><h4><strong>Microsoft encourages to close all browser windows</strong></h4><p>Microsoft has traditionally had very messy interfaces in their applications. Because Word, Excel, Outlook and the others have gotten more and more functionality, they have tried to cram EVERYTHING into the top of the screen, whether they are relevant or not. In the new Office 365 applications, this has improved a bit, even though they still have great potential for improved user experience. But they manage to annoy me every morning when the Office 365 tab I’ve got in my browser shows a dialog saying “You’ve signed out of your account — It’s a good idea to close all browser windows.”</p><blockquote>No, Microsoft. This is not 1998. I do not close all programs and turn off my PC before I leave work!</blockquote><h4>Spotify tries to blow up loudspeakers</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5BWm5g2Hn_CGBZSQ_Z7sDQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/ASKeuOZqhYU?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Jason Rosewell</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Much can be said about Spotify. They are experimental, which leads to large variations between good and bad UX, and sometimes relatively large amounts of bugs. The worst thing I’ve experienced was when I switched to iPhone this winter after 9 years with Android. I installed the Spotify app and discovered that it automatically synchronizes the phone’s media volume with the volume set for playback on Chromecast players. So if I’ve turned the volume up to max on Chromecast when watching a Netflix movie (to adjust it with the amplifier for best sound quality), Spotify sets the volume on the phone to the max every time you open the Spotify app. This applies to all media playback. So next time I open a video in Youtube on my mobile, the sound is pounding away at full blast. It also once set the apmplifier volume on our wireless B&amp;W Zeppelin speaker to maximum during playback (when the mobile was not even in use). Fortunately, the treble element did not blow until I was able to pull out the power. I have set down the volume from max on the phone hundreds of times since I started using it, and not once set it up to max myself. A couple of weeks ago, I uninstalled the Spotify app, and it has not happened since. I’ve talked to Spotify support about it, done everything they asked (restarts, reinstalls etc) but nothing helped. I described the problem in detail <a href="https://community.spotify.com/t5/iOS-iPhone-iPad/Chromecast-auto-sync-of-volume/m-p/4532951/thread-id/103307">on their support forum</a>, but have not received an answer.</p><h4>LinkedIn comment-sorting</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tJB5oNmSZX-z6aXXUVMwcg.png" /></figure><p>Posts on LinkedIn can be commented. But even if a post has no comments, a selection will appear to sort the comments on the post. Small detail, but unnecessary feature to display. When I was going to take a screenshot for this, I switched to English language. While I changed the language in the dropdown option in settings, the entire form is submitted so that the web window is re-rendered. So if I click to change another setting right afterwards, the change will be gone and I have to wait for a page request before I can continue. This felt a bit like when I tried ASP programming almost 10 years ago, where all navigation and changes to a site were completed by submitting an endless big FORM tag around the entire html code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nWxgmIunejQuvFHyS84WRA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/uj6Q2BMd6F8?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Gabriel Gurrola</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h4>Vipps with two buttons for one feature</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dAEuhk2x6FCIaqvAzxbzIg.png" /></figure><p>The Norwegian micro-payment app Vipps has the option of payment to friends, as well as to shops and other businesses. You just specify a number of whom to pay to. For private users, this is their mobile number. For businesses, it’s short service-specific number. But users should not have to think about whether a payee is registered in their systems as an individual or company. However, there are two different menu items in the app for the two forms of payment. And if you go to “Pay” and enter a private number, it says there are no results. If you go to “Vipps a friend” and enter a business number, you will not get any results. This summer, I was going to pay for parking at a marina. It was possible to pay with Vipps, but I did not notice that there was a private number on the poster informing us how to pay. Since this was not a friend of mine, I went to “Pay” but did not find them. Why not just have one menu item and the app detects if I’m applying for a private number or business number and processing the payment differently from there? <a href="https://www.facebook.com/Vipps/posts/1111005642385462">I wrote to them about this on Facebook</a>, but unfortunately only got a futile response.</p><h3>Think smart!</h3><p>The best thing you can do for good UX in your products is to try them out carefully with a critical eye. Go through any process users go through when they use the service and think through every little detail. Everything visible, why things are visible or not, what appears in what steps, how logical it is that things are built up in the way they are etc. Remember to test all processes, not just the main functionality of your application.</p><p>Such testing can uncover many improvement potentials. Nevertheless, it is very useful to receive input from users. Take care of those who contact you about mistakes or suggestions for improvements. Remember that there are a very small minority of users who take the trouble to spend time on this at all. Most people only build up an opinion over time and take this into consideration next time they consider what service they are going to use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ydXDSS9mlkCJPntDn6IdQA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/SIU1Glk6v5k?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Neil Thomas</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>The most annoying I experience when I contact a service I use is to be forwarded. If it has been opened for posts by users on Facebook and after I’ve spent time writing an extensive post describing the details I think they need to be able to look at the issue, only to find that I’m asked to submit the same to an email address or write it to a Messenger user they have for support. Imagine how much better taken care of I had felt as a user, if instead they spent 30 seconds sending a message internally about my inquiry. From there, the individual on support who had contact with users on Messenger could have contacted me directly if needed. Asked any follow-up questions or asked me to test something, rather than just getting in response to my Facebook post that I have to write the same again somewhere else. Unfortunately, I have experienced this more than once.</p><p>Besides reviewing user experiences, it helps a lot if you manage to come up with some clever features that no-one has made. I can mention a small example of this. If you are sitting on a desktop computer and clicking in a video window that is playing a video, there are primarily two features the users expect. One is to pause the video, the other is that the video goes into full screen when it’s double-clicked. Here I experienced a few different solutions over the years. Some sites pause when clicked, and fullscreen is only available on a small clickable icon down at the control bar. Some have both features, but when double-clicked, the video is first paused at first click while it restarts playback with other clicks to go to full screen, but with the small stop in playback that is annoying if music or talking is in progress. But the best solution I’ve experienced was in TV2 Sumo’s video player on the web some years ago. If I clicked once in the window, it waited a fraction of a second before it paused the video. It was so short that you barely noticed it. But if there was a click number two in this short period of time (so it could be considered a double click), then it skipped pause, but instead opened fullscreen. No interruption in playback, and it was both possible to pause and open fullscreen by clicking in the same video window. Smart!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZNvenWL0uavMI32j9JIDWg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/MGR8OcCggSs?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Mint Owl</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>No one makes perfect UX. It’s all about striving for it. Work continuously on how the product is to be experienced. I think my awareness about this is one of the reasons I’ve become much more Apple friendly over the years. At the beginning of my career, I was skeptical about the limitations of Apple’s products and interfaces. Although they may still annoy me, I feel that I have gradually understood better how they think. That they have made a choice about how they think their products can best be experienced. Sometimes it’s just comfortable to use something that feels well thought out and convenient to use, even though it may not always be 100% tailored to my preferences.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5HtC_wekjj2rujLxNVuQkQ.png" /></figure><p><a href="https://medium.com/techtive/productive-creative-innovative-tech-23f0fcf704d8"><em>Techtive is about combining productivity, creativity and innovation while working with technology.</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e1cfc1dece1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techtive/what-is-good-ux-2e1cfc1dece1">What is (good) UX?</a> was originally published in <a href="https://medium.com/techtive">Techtive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Techtive vocabulary]]></title>
            <link>https://medium.com/techtive/techtive-vocabulary-a141228ad070?source=rss----902fa94cc487---4</link>
            <guid isPermaLink="false">https://medium.com/p/a141228ad070</guid>
            <category><![CDATA[vocabulary]]></category>
            <category><![CDATA[reference]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[phrases]]></category>
            <dc:creator><![CDATA[Henri H]]></dc:creator>
            <pubDate>Thu, 26 Jul 2018 18:16:02 GMT</pubDate>
            <atom:updated>2018-07-26T18:16:01.602Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oTySOUhld2PJyrp83Pblog.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/zeH-ljawHtg?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Giammarco Boscaro</a> on <a href="https://unsplash.com/@giamboscaro?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Since Techtive is about technology work, but not just written for technologists, I want a reference for technical words and phrases that are used or can b e used in the articles. The list is updated continuously.</p><p><strong>API</strong><br>Application Programming Interface is a set of methods, protocols or tools for building software. The term API occurs in many contexts, like which methods a given part of a system makes available for the rest of the system (eg arguments and return value for a programming function), and all the way up to a server API with many endpoints for data exchange.</p><p><strong>Backlog<br></strong>Ideas and tasks that a team wishes to implement, but without having any concrete scheduled time for when to perform, is placed in a backlog.</p><p><strong>Codebase</strong><br>A code base is a package of code for a given purpose. Such as an application, an API or a code library for use in other codebases. Sometimes multiple applications are aggregated into one code base.</p><p><strong>Compile</strong><br>Computers and devices can not read the code we write. They read only machine code, which is very inconvenient for people to write. There are therefore a number of programming languages that are transformed into machine code before they actually run on a machine. This process is called compiling.</p><p><strong>Compiler</strong><br>A program that compiles code into another language is called a compiler.</p><p><strong>CPU</strong><br>The central processing unit that performs the instructions from a computer program. This is the primary device that performs the functions of the machine, and is often called the “brain”.</p><p><strong>Database</strong><br>All data that applications need to display their content must be stored somewhere. Programs that save data on a storage device and make them available for program code is called a database.</p><p><strong>Deploy</strong><br>A deploy is a running instance of an application or a codebase. Deploying code means placing it in a location where it should run. Such as a production server.</p><p><strong>Environment</strong><br>An environment is a location on a device or server where a code base is running. Environments are often identified on the basis of intent, such as a production environment, staging environment and development environment.</p><p><strong>Git</strong><br>Git is a <em>version control system</em>. It keeps track of changes in a code base, so it is possible to follow the changes in steps.</p><p><strong>Github</strong><br>A hosting service for version control of code that uses Git.</p><p><strong>Hosting / Hosting service</strong><br>A service that stores or runs code, applications, APIs, or other features for others.</p><p><strong>Java</strong><br>A programming language</p><p><strong>JavaScript / JS</strong><br>A programming language / script language that is used primarily in web applications and web pages. JavaScript is formally called ECMAScript, and despite the name, has nothing directly with Java to do.</p><p><strong>Machine code / machine language</strong><br>Machine code is code that can be read and executed directly by a machine’s <em>CPU</em>.</p><p><strong>Meetup</strong><br>Meetings and gatherings arranged for professionals from different companies are often called meetups.</p><p><strong>MVP</strong><br>Minimum viable product is an early release of the product, often with limited features but enough for early customers to use it. An MVP can also consist partly or completely of mockups rather than real functionality so users can get an idea of how the finished product will be.</p><p><strong>Namespace</strong><br>In computer programming, variables, subroutines, functions and classes are often grouped into namespaces. This is to prevent unrelated parts of the code from affecting each other.</p><p><strong>Node / Node.js</strong><br>Node.js is a platform that can run JavaScript code on a server. By using JavaScript on both the server side and in the browser, part of the code can be shared rather than writing repeating code in one language for each platform.</p><p><strong>Object oriented programming / OOP</strong><br>Object-oriented programming is a programming paradigm. A syntax and method some languages offer to group functionality for same types of entities that may have different data.</p><p><strong>Production / production environment</strong><br>Production environment is the deployment environment where an application or API runs and is available to the target audience. This can be anything from a small simple machine to a large server park.</p><p><strong>Refactoring</strong><br>Code refactoring is to restructure existing code without changing the functionality available to users. This could be syntax rewriting, implementing new libraries and tools to solve the code’s tasks, introduce more reuse of code and other forms of maintenance.</p><p><strong>Repository / repo</strong><br>A repository is a code storage location. When multiple developers work on the same codebase, they retrieve it from a repository, such as from a local server or from Github. When changes to the code is fully developed, each developer then send the changes to the same repository. Other developers may then retrieve the new updated code without having to receive it from the developer who made the changes.</p><p><strong>SaaS</strong><br>Software as a Service is a product model that implies that a provider creates software that other companies make use of as part of their products. Customers of such products can save a lot of money by not having to develop all this software for themselves.</p><p><strong>Server</strong><br>A server is a computer that provides applications, code or APIs for customers or users through the internet.</p><p><strong>Staging / staging environment</strong><br>Staging environment is a deployment environment where test versions of applications or APIs is running with limited availability. It may be for internal testing in the company that offers the service or for a closed user group before it is deployed to production.</p><p><strong>UI / User Interface</strong><br>User Interface is the connection point where communication between humans and machines occurs. The screens in an application are the user interface to the service the application represents. In addition to digital surfaces, there are user interfaces like the buttons on the coffee maker, the light switch on the wall, the panel of the alarm center, etc.</p><p><strong>UX / User Experience</strong><br>User experience is the whole feeling and experience a user gets of using a service and their products. It is about giving a meaningful customer journey through all experiences a person get out of a product. It includes practical, visually engaging interface, the experience of what the product is and the value it provides the user. User experiences change in line with the user’s circumstances and changes in the product.</p><p><strong>Version control system</strong><br>A version control system keeps track of changes in a code base so that it is possible to follow the changes in steps. This way you can go back in history if, for example, a change failed and you have to go back to a previous version without manually changing the code. A version control system also takes care of merging code, allowing multiple developers to work in parallel on the same code base without having to go through the code in detail get everything included.</p><p><a href="https://medium.com/techtive/productive-creative-innovative-tech-23f0fcf704d8"><em>Techtive is about combining productivity, creativity and innovation while working with technology.</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a141228ad070" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techtive/techtive-vocabulary-a141228ad070">Techtive vocabulary</a> was originally published in <a href="https://medium.com/techtive">Techtive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The 20% Refactor]]></title>
            <link>https://medium.com/techtive/the-refactor-guy-62b1d8abc135?source=rss----902fa94cc487---4</link>
            <guid isPermaLink="false">https://medium.com/p/62b1d8abc135</guid>
            <category><![CDATA[refactoring]]></category>
            <category><![CDATA[code-quality]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[project-management]]></category>
            <category><![CDATA[motivation]]></category>
            <dc:creator><![CDATA[Henri H]]></dc:creator>
            <pubDate>Tue, 17 Jul 2018 04:41:01 GMT</pubDate>
            <atom:updated>2018-07-18T10:02:24.832Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M39G9Nrhkpsf_6LZ4mjGMQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/WBu97LnmG2o?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Dane Deaner</a> on <a href="https://unsplash.com/@danedeaner?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Bad code quality and architecture are expensive! This means that all work on further development and maintenance of the code base takes longer. This is easily underestimated since it is not possible to quantify or know anything about alternative outcomes. I’ve heard far greater estimates, but I’m going to limit myself to claim that good code quality gives 2–3 times greater efficiency compared to poor code quality. So you can get more than twice as much work done and features developed at the same time if the quality is at the top end of the scale.</p><p>How do you know that your product has good code quality? What if you spend 3 times as much time on all product development compared to what you could have done? Here is also the biggest dilemma. If we already have some legacy code and weaknesses that we know about, will it be worth re-writing or just focusing more on quality in the work ahead? How much time does it take to rewrite to improve the quality and when does this begin to yield a return on efficiency?</p><p><strong>Read also:</strong> <a href="https://medium.com/techtive/does-your-team-write-good-code-8b1dcec6404d">Does your team write good code?</a></p><p>The problem of course is that you will not notice the improvement directly because there will be nothing to compare with. Why is it difficult to estimate development work? Programming consists of so many small technical decisions that you never have a full overview of the work in advance. Even when a developer primarily works on code they’ve written themselves, an estimate will only be based on a rough overview they build up in their minds about what must be done to complete the task. To provide a more reliable estimate, it would be necessary to conduct a detailed review, which may take as long as to perform the task. This is also the reason why developers do not like to estimate their work in advance.<strong><em> </em></strong><em>The solution is developed while working on the task, because it is the only way to solve the problem without using an unnecessary amount of time.</em></p><h4>Code deteriorate</h4><p>Perfect code quality is something you can work towards, but never something you should expect. The technology is changing too fast to maintain top quality. You are bound to get at least a certain level and legacy. This makes it even more difficult to prioritize and choose between pure code quality tasks and further development of business logic. Tasks that provide obvious benefits are therefore prioritized. Since this can not be represented in numbers, let’s look at an example to see how much it pays to focus on code quality.</p><p>A team consists of five developers. They work on a relatively large code base, always have a lot to do and many things in the backlog. The threshold is high for spending a lot of time rewriting code, replacing old libraries, writing more tests, and the like. It’s time consuming and expensive. But the reality is that working on bad code requires a lot more time on average per task. If you over time can come to a point where work goes about twice as effectively, it will always pay off. Double efficiency is most likely an understatement in many cases, but it is at least quite realistic. So while it may seem costly to set a full-time resource (20% of a team of 5 developers) to work with code quality, it’s not hard to see that this will give a big return in the long run. And if developers think code quality is at a level where refactoring is not necessary, then everyone can work on product features.</p><h4>The Refactor Guy</h4><p>Take care of your teams commitment to code quality! Think about the good old story of everything Google has gotten out of their 20 percent time philosophy.</p><blockquote>“We encourage our employees, in addition to their regular projects, to spend 20% of their time working on what they think will most benefit Google. This empowers them to be more creative and innovative. Many of our significant advances have happened in this manner.</blockquote><blockquote><em>- Larry Page and Sergey Brin (2004 IPO letter)</em></blockquote><p>Give developers this kind of freedom around the code they are working on. Imagine that you set aside 20% of the working hours, which developers can allocate to code quality work. If this over time can almost double the rate of development on the product, is that valuable use of time? Find a practical way to organize this work. Set up tasks in your project management tool for what can be done on code quality. Discuss in the team and prioritize the tasks. Let a developer be “Refactor Guy” for a few days. Rotate between those who want to work with such tasks. Besides more efficiency and better code, this gives developers more ownership of what they are working on, which creates greater motivation in their daily work.</p><p><a href="https://medium.com/techtive/productive-creative-innovative-tech-23f0fcf704d8"><em>Techtive is about combining productivity, creativity and innovation while working with technology.</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62b1d8abc135" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techtive/the-refactor-guy-62b1d8abc135">The 20% Refactor</a> was originally published in <a href="https://medium.com/techtive">Techtive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>