To achieve clean code, programmers should value:
Clean code allows others to understand how it works. This improves:
If you’re given a choice between (1) code that’s prematurely optimized but hard to read and (2) code that’s less performant but easier to understand, you should prefer the latter over the former. Developers will thank you.
Colocating tests is putting your test next to its file.
Why colocate tests? Because colocating provides:
Example of a directory structure containing colocated tests:
Example of a directory structure containing non-colocated tests:
│ └── file.js
Colocated tests simplifies import paths:
const file = require('./file');
Compared to non-colocation:
const file = require('../test/file');
For small projects, non-colocation is manageable. But for larger projects, the import paths can get unwieldly:
const file = require('../../../test/dir/subdir/file');
For colocated tests…
Why use Context to handle React state? The same reason you use Redux to manage your application store. If your components talk to one another and lifting state becomes cumbersome, then Context is a native way to deal with your application state.
We will be refactoring
<App>—which uses local state—to use Context:
As you can see, there’s a counter with 2 buttons that increments or decrements the count.
<Provider> and set prop
value to 0:
<Provider> as the top-level component in
Get the Provider
What are Gherkin feature files? They’re human-readable documentation that can map to automated tests.
Here’s an example of using Gherkin to describe how to search for
remarkablemark on Google:
Given I am on "https://www.google.com/"
When I click on the search bar
And I type "remarkablemark"
And I press "Enter"
Then I see in the search results "remarkablemark.org"
Each line is a step:
Givensets up the scenario.
Whendescribes the action.
Thenstates the expected outcome.
Steps can be organized under
In Applications, check if Travis CI is added in:
Deny Travis CI access from Organization > Account settings > Third-party access:
This article describes the difference between planning, grooming, and estimation in agile methodology.
Based on the company goals and user research, the Product Manager (PM) comes up with the business case.
The Tech Lead (lead engineer) works on the tech design, which is reviewed by the team.
Once the tech design…
Create a Heroku app and save the app’s name and email associated with your account. Then go to Account settings and copy your
Go to your GitHub repository’s
Secrets and set the secrets:
Workflow to deploy using Deploy to Heroku action:
Check out the additional options.
Workflow to deploy using a custom job:
The differences between the 2 workflows are explained below.
Here’s the full example of setting up Node.js with the
.nvmrc version in a GitHub Actions workflow:
What’s a story kickoff? Like the name implies, it’s an event to kick off the story with key stakeholders before working on it.
Why should development teams do story kickoffs? Because a story kickoff:
Every ticket goes through a lifecycle from
Done. Changes are cheaper when they’re introduced early on, and they get more expensive to implement later on.
Imagine a developer who goes down the wrong path and isn’t called out until the review stage. The…