You have to write a research report, and you decide to take turns doing the work.
Your friend creates a doc with the introduction, calls it Project_v1, and emails it to you.
You add the next paragraph, rename it Project_v2, and email it back.
And so on, back and forth, adding paragraphs. Pretty inefficient, but gets the job done. Until the editing stage.
In Project_v19, you both edit the same paragraph, at the same time, and the email it to each other. Your changes overlap. You have to decide whose changes “win”.
It’s pretty confusing, but you figure it out.
Last year, my girlfriend and I were apartment hunting in Vancouver, a notoriously expensive city. Walking into a 700 sq foot apartment that’s listed for $2000 (and feels like a shoebox) makes one go “this is crazy.” Having that happen multiple times makes one go “wait, is everyone crazy?”
Well, let’s find out. Can we use machine learning to predict what a “good” rental price is for a given apartment size?
(This is the first of a few articles on the basics of machine learning. To set expectations, we’re not going to solve the problem in this article, but we…
Creativity doesn’t come from deep study of one particular field. It comes from combining ideas from multiple fields.
In fact, there’s no such thing as a truly original idea. Innovative ideas are just existing concepts, rearranged in novel ways.
To expand this idea, let’s look at the career of John Boyd.
John Boyd was a fighter pilot who went on to become one of the most original thinkers of the 20th century. His advocates call him the best military strategist since Sun Tzu.
His life’s work was a theory of strategy called maneuver warfare. But he also applied the principles…
Why you should care about AWS Lambda:
- it’s one of the most popular services on Amazon Web Services (AWS)… or at least one of the most talked about
- it’s an incredibly cheap way to build your application
- it’s a big part of AWS’s “serverless” architecture
Which leads us to our first question… what the heck is serverless, anyway?
Serverless architecture is a lie.
Or, at least, a misleading name.
Serverless doesn’t mean no servers are involved, it just means you don’t have to think about those servers.
You don’t have to manage them, or provision them, or…
The moment I decided to become a software developer, I was sitting in the basement of a hostel in Peru.
This was 2015. In 2014, I had graduated university with a degree in English Literature. But what was I supposed to do now?
(For those considering a degree in literature the answer is… not a lot.)
I had originally wanted to be a high school teacher, but decided I wanted more. More control over my time, more rewards for excelling.
Okay, so I wouldn’t be a teacher. So what would I be instead? What did I actually want?
Writing this article started with a question: if I could give a new developer one piece of advice to help them write great React, what would it be?
My answer: write clean components by following the rules of writing clean functions.
Our goal is to write React applications that are easy to read, easy to maintain, and easy to extend.
There are a lot of factors that go into this: architecture, state management, file structure, code formatting, etc etc.
But the bulk of our application—the bulk of the code our team will be working with—will be components.
If your components…
So you’re decided to try GraphQL in React.
But which one is right for you?
I can’t answer that question for you. …
The advantage of the component system in React (and view libraries like it) is that your UI gets split into small, digestible, reusable chunks.
Each component is usually compact (100–200 lines), a size which is easy for other developers to understand and modify.
But while component brevity tends to be the case, there’s no hard and fast rule. React will not complain if you decide to package your app into one monolithically monstrous 3000 line component.
…but you shouldn’t. In fact, most of your components are probably too big—or rather, doing too much.
Imagine you have a controller with some complex business logic.
class UserController < ApplicationController
user = User.new(user_params)
end # private methods
This code isn’t unreadable, but there’s a lot going on. The controller has too much to deal with—it needs private methods to cover everything from sending a welcome email to notifying slack to logging whether it’s an admin or user.
Clearly, if we want skinny controllers, the above approach isn’t the best.
We could extract all of the above into…
Since my first article on this subject, the React component API has changed significantly. Some lifecycle methods have been deprecated, and some new ones have been introduced. So it’s time for an update!
(See how I resisted making a
shouldArticleUpdate joke? That’s restraint.)
Since the lifecycle API is a bit more complex this time around, I’ve split the methods into four sections: mounting, updating, unmounting, and errors.
If you’re not super comfortable with React, my article here provides a thorough intro.
Build React apps faster with a collection of reusable components. Use Bit to share your components and use…