Patrick Monslaup
Technical Manager & Developer
Knowit Experience Bergen
patrick.monslaup@knowit.no
Part 1:
Creating less messy code
Part 2:
Eliminate existing monsters
Technical debt is a concept in software development that reflect the implied cost of additional rework caused by choosing an easy solution now instead of using a better approach that would take longer.
- wikipedia
Debt is paid back with interest
When you take a shortcut, you use your credit card
Only visible to developers.
... Only then can they make an informed decision if they should use their "credit card"
If you only measure speed then you incentivize writing ugly code without documentation. Be sure to measure the right things!”
... be mindful of what you measure,
you just might get it
The best way to boost performance is to create an environment where everyone can contribute and reach their potential
... both with managers and other devs
You're constantly paying interest on your technical debt, and the debt creates more debt
Online booking of health services through Storebrand Helse's BliFrisk app
We will examine filtering and fetching of providers
(some providers are in the sea due to
this being generated dummy data)
MapScreen
filtering logic & data
Drawer
Layout of drawer
Fields
Reset filter
Data & callbacks for updating/resetting it
Initial data & update CB's
Reset fields callback
button
Top of the map
Drawer
Referral form
MapScreen
filtering logic & data
Drawer
Layout of drawer
Fields
Navigation
Map
Hovering top filter
Referral flow
Reset filter
button
Drawer Fields
Hovering top filter
Referral flow
Views
Display data from stores
Stores
Store data
Filter data
e.g. "minRating"
set
get
Components can set & get data from here
..and rerender when the data changes
Instead of passing data around, store it a dedicated location and let components that need the data subscribe to changes.
This can easily be done in react with mobx
(or redux, or written yourself with listeners, or ...)
... the same way we put data into stores instead of sending it through many layers of components
Controllers
(E.g. "filterProviders")
Views
Display data from stores
Operate using data
from stores, and
Stores
Store data
Filter data
e.g. "minRating"
Providers
may update stores
set
get
get
MapView
Issue: doing this properly is a lot of code
Let the network layer handle authentication
and error logging
Consistent error logging is extremely nice for debugging
... make error logging and authentication easy, otherwise you can't debug production issues
Loosely coupled abstractions allow mocking & developers can work in parallel on different modules
The providers originate from different online provider/booking API's which present data on different formats.
Text
Handle format differences backend.
Our dependencies all rely on different coordinate systems
In better languages the solution is overloaded constructors
Originally implemented by Trygve Reenskaug in the 1970's for smalltalk