25 January 2017, by Harry Cummings
There is a lot of writing on the importance of code reviews and how to go about them at a low-level (i.e. what to look for in the code). This series of posts takes a higher-level look at how to approach code reviews and how to maximise their benefits. We’ll also refer throughout to other useful writing on code reviewing and how to make the most of it.
At Softwire, we have always carried out code reviews in one form or another. But our methods and tooling have evolved over time, and often varied between projects. This allows each project team to find a way of working that best suits them.
We recently ran couple of internal lunchtime discussion forums to talk about code reviewing and pool our collective experience. The goal here wasn’t to try and agree on “one true code review methodology”, but just to share ideas between teams. We discussed the perceived benefits and overall aims of code review, and how we go about achieving these.
It turned out that the approaches to code reviews within the company are even more varied than I’d thought. But there was some broad consensus on the benefits and aims of code reviews. However, the benefits that we valued most may surprise you.
What value do we get from code reviews?
Both of our discussions came up with a similar consensus on the range of benefits provided by code reviews. In rough order of their prominence in the discussions, these were:
- Training and mentoring
- In fact, several people felt that the healthiest approach to code reviewing was to treat it as a training opportunity first
- Knowledge sharing
- In both directions (i.e. both the developer and the reviewer had opportunities to learn from one another)
- This includes sharing domain knowledge, general technical knowledge, and knowledge of the specific codebase
- Encouraging people to produce better work (knowing that it will be scrutinised by your peers)
- Keeping the codebase consistent, in terms of style and structure
- More generally, keeping the codebase maintainable
- Catching defects, or at least catching them earlier (and so making them cheaper to fix)
One point I found interesting here was that “catching defects” was one of the last points to come up, in both discussions. There was a lot more emphasis on the holistic benefits of code review: training, knowledge sharing, and improving the overall codebase.
Quality assurance is the main focus of some widely-referenced sources on code reviewing. For example, Jeff Atwood’s blog post Code Reviews: Just Do It, and the two books that it references (Peer Reviews in Software and Code Complete). These mainly focus on reducing errors/defects/bugs, and only briefly mention other benefits. Of course, improving defect detection is not a bad argument for doing code reviews. Perhaps it’s also the most persuasive one in organisations that don’t have a history of doing code reviews and are reluctant to let people start spending time on it.
Defect detection is a valuable and somewhat measurable benefit, which may make it a good angle to sell the idea of doing code reviews at all. However, for the developers and tech leads who actually carry out code review, it doesn’t need to be the only aim or even the primary aim of the exercise. So how do we go about code reviews at Softwire? We’ll cover this in the next post.
20 January 2017, by Yemi Olagbaiye
With so many new buzzwords and technologies, it is hard to determine which of these actually hold any clout in the modern business arena or have what it takes to become part of our lives in the future. Whilst we don’t profess to have all the answers here at Softwire, here are the top five trends that we believe will make a real impact in 2017.
We predict that VR will continue to be one of the most significant developments in the technology space this year. VR has the potential to complement and improve daily activities. Facebook has marked its space in this arena and we are likely to see VR-related upgrades from the leading social media players. Social media channels are one of the best routes for pushing the boundaries of this technology. Products including Google Daydream Viewer and Samsung VR have increased the level of content for consumers to digest and we’re likely to see this with games, movies, TV series and possibly gigs.
With the overwhelming success of games like Pokemon Go, brands now see the huge potential of this technology. It’s taken stampedes of people in parks, racing to catch their next Pikachu to make anyone pay attention. We predict that 2017 will see consumers less apprehensive of accepting AR on their smartphones and devices. In fact, with many of the shocks the world has faced in 2016, perhaps it may offer a more appealing ‘reality‘ whilst not completely detaching us from the outside world.
Following its recent upgrade, Microsoft’s mixed reality platform, ‘Windows Holographic’, now promises a varied new set of reality experiences for Windows users. Apple could make a play for a seat at the table with AR offerings. Who knows, Magic Leap may even start shipping at some point later this year (well, maybe…).
Where AR surpasses its counterpart, VR, is in its hardware simplicity. There is no need to purchase additional complimentary hardware, there’s a much easier gateway to the experience – a mobile device. AR has the potential to enhance existing games, toys, work and retail and we’re excited to see what comes next.
During 2016, AI has developed significantly and as a result machine learning has become more universally understood. Consumers have benefited from the increased choice of digital voice assistants and it’s likely that many big players will see 2017 as an opportunity to take advantage of consumers’ understanding and appreciation of this growing tech trend.
With Google’s Assistant, and Amazon’s Echo marketing themselves as must-haves in the home, we could see champions such as Microsoft and Apple releasing their own respective Cortana and Siri-based competitive devices. AI will continue to grow smarter and smarter.
We will take advantage of some of the emerging tech, AR and VR, on 4K screens and on smartphones. Yes, smartphones. HDTV technology is old news, curved screens and 3D just aren’t hitting the right buttons. Creating bigger and bigger TVs will not win any innovation prizes. Why is this one of our top trends? We believe that the manufacturing tides of transformation are turning towards the smaller screens, specifically those we have at our constant disposal.
We have seen OLED (organic light-emitting diode display) technology rise to become the flagship technology for smartphone screens. This year we’re likely to see the technology leveraged to help create thinner and more battery-efficient smartphones.
Why is this important? Why should anyone care? Will anyone ever really notice? Consumers are becoming more familiar with slipping their smartphones into their VR headset of choice.
With the screen so close, only higher resolutions can deliver the best experiences.
Security and Privacy
With the growth in artificial intelligence and IoT devices security is a key question. We will have thousands of connect devices, all communicating via the cloud, using real-time monitoring, logging, and data analytics – data on us. Security gaps with unpatched IoT devices could lead to significant compromises more damaging than previously thought. In order for these technologies to move forward security and privacy issues need to be taken seriously.
We will be closely monitoring these trends during 2017 and delivering bespoke digital solutions to our valued clients, to find out more read our blog.
16 January 2017, by Chris Arnott
In this short article, I’ll lead you through a crash course on what a stream is, and how you can harness them to make your code more understandable.
If you want to try out any of the examples here, they will work with the excellent library bacon.js.
So what is a stream?
A stream is a sequence of objects, but unlike other sequences, it’s handled lazily (so the items aren’t retrieved until they’re required). This means that unlike a normal List, it doesn’t have to be finitely long.
You can put anything in your stream characters, numbers or even user events (like keystrokes or mouse presses). Once you’ve got your sequence, you can manipulate it in lots of different ways.
Streams can also completely remove the requirement to think about time, meaning fewer race conditions and therefore more declarative code. This removal of the need to represent time in code also results in architecture diagrams which are easy to draw and reason about.
Manipulating your stream
Now that we know the purpose of a stream, how do we manipulate it? What follows is a selection of functions that can be called on streams along with visual representations of the effect of these functions when called. It should provide everything needed to set up and use some programs which utilise streams.
Map takes a function f. Then, for every item that appears in the stream, it applies the function f to it and produces a new stream with the new values.
Scan takes a function f. Then for each value in the stream, applies the function to the previous result along with the current value. This is similar to fold, but the output is a stream of all the values rather than just the final value, which fold would provide.
Filter takes a function f, then for each value computes the function, and if it evaluates to true, puts the value into the output stream, else discards the value.
There are several ways to combine two streams. Using merge will take values from both streams and output values (in the order they are received) into the output stream.
This differs from concat, which takes two streams and returns all of the first stream before returning all of the second stream.
SampledBy takes a function f and two streams (A and B). The function f is then called whenever a value is provided by stream A, passing in the last value from each stream. In the example below, a value is created in the output stream whenever a value occurs in the top stream. The output is then created from the value in the bottom stream.
SlidingWindow takes an integer n and returns the last n values from the stream as an array each time a new value occurs in the input stream.
So in summary, you can use stream functions to manipulate streams in a multitude of different ways. You should use streams to remove the time component from code, allowing for simpler to understand and debug code.
This post first appeared on Chris Arnott’s blog.
9 January 2017, by Jane Haysome
2016 is being commonly touted as the “worst year ever“, with people referencing the high number of artist deaths and the close political results of Brexit and the US election between increasingly polarised sides. Not everyone shares this view of course, and it has prompted some retaliatory positive news pieces you can read one here .
Whichever side of the political divide you are on, decisions taken in 2016 look to set us up for big changes in 2017 and beyond. Sorting out the finer details of Brexit, let alone assessing the impact, will be years in the making.
The pace of change has been accelerating over the recent decades, with new business and technologies coming and going at an incredible pace. Over the last few months alone, Vine is out, Snapspecs are in and Pokemon Go proved to be an instant hit across the globe.
Change means the end of certain things that we love and it means opportunity. Opportunity in your market, opportunity in training and leveraging your employees and opportunity in connecting with your clients. Technology is the foundation of all of this change. In 2016, we helped the BBC to bring coverage of Glastonbury and other events to the public as an interactive experience, we helped David Lloyd Leisure to win an award for their new mobile booking application and we started working with a leading bank to help them transform how they develop technology. You can read about them here.
An increase in change means an increase in the ways that we can help people to innovate and drive their businesses in 2017. And beyond.