React

A 4-post collection

Ten programming books that can be read passively

By Matt Button |  Feb 22, 2024  | books

We’ve all got busy lives, and it can sometimes be difficult to find time to sit down and read a chunky and dense programming book. (I’m looking at you, SICP!!)

A reader recently asked which programing books can be more casually read, without having to commit to a long reading session.

Here are ten of my favorites:

Continue Reading...

Top useEffect mistakes made by React Developers

By Matt Button |  Jun 13, 2023  | react

useEffect is a kind of “escape hatch” which lets you perform side effects in functional components.

Effects let you step outside of React, giving you the ability to synchronise your components with systems that aren’t controlled by React such as a non-react widget, an external system (such as a browser API), a third party library, or a network connection.

Effects aren’t always necessary; if there is no external system involved, you shouldn’t need useEffect.

But it isn’t always clear when effects are necessary, and how to use them. Which leads to some common mistakes.

Here are some of the top mistakes that I’ve seen people make with useEffect:

Continue Reading...

Scaling yourself by Scott Hanselman

By Matt Button |  May 11, 2020  | notes

I recently watched a presentation by Scott Hanselman about scaling yourself and it was enlightening; the key message was that you can’t keep up with everything, and in the presentation, Scott talked about ways of taming the torrent of information and lists of things to do that sometimes leave us feeling ineffective and overwhelmed.

In the presentation, Scott combines ideas from Stephen Covey’s book The Seven Habits of Highly Effective People with ideas from David Allen’s system, Getting Things Done, and also Scott’s own life experiences.

In this article, I’ve summarised some of the highlights of Scott’s presentation, reorganised them a little, and added more context with links and quotes. At the end, there’s a link to the entire hour long presentation, which is absolutely worth a watch.

Continue Reading...

Using Docker for local web development

By Matt Button |  May 9, 2020  | asp.net, docker, sql, docker-compose

If you’re new to Docker, it’s hard figuring out even what to search for, and how the concepts tie together, let alone what to pay attention to for your use case.

To make things more difficult, there has been a lot of change over time, and stuff that was once recommended is now not recommended. For example, a lot of older video tutorials recommend using container links which have since been deprecated in favor of user-defined bridge networks .. in case you’re unfamiliar with this, I’ll cover what this means, and why you’d use it later in the blog post.

Once you learn the basics, using Docker in practice is fairly straightforward, and if you’re using Docker at home or at work, the time you spend learning now will save you a massive amount of time and effort in the future.

If you’ve used Docker a bit, are familiar with some of the concepts, how dabbled here and there, but sometimes struggle with connecting some of the concepts, or how to get things set up end-to-end, then this blog post is for you.

In this blog post, I’ll guide you through step by step on:

  • The distinction between docker image and containers
  • Best practices on how to persist data within containers, and how to control where data is persisted
  • How to continue developing on your local machine as usual, while your app is running within a docker container on your local machine
  • How to connect your containerised web app to a containerised Microsoft SQL Server
Continue Reading...

Redux made easy with Redux Toolkit and Typescript

By Matt Button |  Jan 20, 2020  | react, redux, typescript

Using Redux with React can be incredibly challenging for people to get their head around; while the core principles of Redux itself are fairly straightforward and don’t take too long to grasp, a lot of people struggle with using Redux in React apps. Partly because there are so many damn things to integrate:

  1. Redux
  2. React Redux
  3. Redux Thunk
  4. Typescript (getting more common in recent years)
  5. Redux Saga / Redux Observable (in more complex apps)

I spotted this quote which summed it up for me:

Redux was such a mental overhead for me when I started out with it. The amount of boilerplate code that I had to write for the project I worked on was very frustrating.

I struggled with that stuff too, even after I became familiar with the concepts, I often found it difficult to understand the flow of data and events within React Redux apps. This is not uncommon, even the original author of Redux had this to say:

Yup. Can totally relate.

Then I found Redux Toolkit, written by the maintainers of Redux, and recommended by the Redux style guide.

Continue Reading...

How to scrape stock upgrades and downgrades from Yahoo Finance

By Matt Button |  Dec 2, 2019  | yahoo-finance, python, beautiful-soup, web-scraping, pandas

In this blog post I’ll show you how to scrape stock upgrade and downgrade data from Yahoo Finance using Python, Beautiful Soup, json, and a bit of regular expression magic.

This technique can be applied to any stock symbol on Yahoo Finance, but for this blog post we’ll be scraping data for Apple (AAPL).

I’ll be guiding you through the process, describing my thought processes and techiques, and if you follow along, by the end of this blog post, you’ll have extracted stock upgrade and downgrade data in a Pandas dataframe which will look something like this:

From there, you can easily export the data into an Excel file, or if you’re a more advanced Python user, host the code in a Web API which can be accessed by Google Sheets, or your own custom code.

Continue Reading...

Accelerate - Building and Scaling High Performing Technology Organisations

By Matt Button |  Sep 19, 2019  | book-notes

I first read Accelerate by Nicole Forsgren, Jez Humble, Gene Kim back in 2018 when it was a hot topic in the office; only an hour or two would go by between overhearing somebody talk about it, internal blog posts were being written, and we’d receive emails about following the findings.

One of the goals behind the book was to run a series of surveys, gathering 23000 responses across 2000 organizations, then using statistical methods on the results in order to find a way to measure software delivery performance, and to find out what drives it. One of the most impressive things about the book is that it not only presents the research findings, but also goes into detail about why the findings are trustworthy, meaning that they not only tell us what they learned, but how they learned it.

I recently read through the book again and took a bunch of notes which cover the main points.

Continue Reading...

5 things that you need to consider before becoming a mentor

By Matt Button |  Aug 3, 2019  |

As your career progresses, you’ll discover an increasing number of opportunities for mentoring others, and being an effective mentor will become increasingly important.

This blog post covers 5 things that you need to consider before becoming a mentor, along with some tips on how to select a mentee, and some pitfalls to watch out for.

Continue Reading...

This Week: Ryan Holiday's 32 Thoughts From a 32-Year-Old

By Matt Button |  Jul 20, 2019  | product-development

A collection of 5 things from the week that I found interesting, am enjoying, or am working on.

This week:

  • I’ve been amazed by: Photopea - an advanced image editor, which looks and behaves a lot like Photoshop, and runs entirely in your browser
  • I’ve been experimenting with: CSS Grid. It makes my layout life easier, and it’ll make yours easier too.
  • I’ve been watching: Keep Betting on Javascript by Kyle Simpson
  • I’ve been reading: Ryan Holiday’s 32 Thoughts From a 32-Year-Old
  • I’ve been thinking about: How important it is to write online
Continue Reading...