I have found PHP's PSRs to be a very good idea when it comes to having some sorts of standards for commonly performed tasks. Wheter it's logging, caching or performing HTTP calls.
What are PSRs? Here's a short description taken from Wikipedia:
#!/usr/bin/env bash | |
echo "Howdy!" |
#!/usr/bin/env node | |
console.log('Howdy!'); |
const allRequiredMethodsArePresent = requiredMethods.every(methodIsPresentIn(adaptersMethods)); |
describe('executing handlers', () => { | |
context('for synchronous handlers', () => { | |
it('should happen in sequence', async () => { | |
const hook1 = { | |
event: 'preEventName', | |
handler: sinon.spy() | |
}; | |
const hook2 = { | |
event: 'preEventName', | |
handler: sinon.spy() |
I have found PHP's PSRs to be a very good idea when it comes to having some sorts of standards for commonly performed tasks. Wheter it's logging, caching or performing HTTP calls.
What are PSRs? Here's a short description taken from Wikipedia:
// I have some testing framework in the scope | |
// Questions below: | |
// 1. Should the description be like it is here, in first `it`, or with `only` word added: | |
// "should return Fizz when the number is divisible only by 3" | |
// That would imply that the number is divisible by 3 only, which is technically not true, as it is divisible | |
// by 1 as well, and some numbers, e.g. 6, 9, and so on, are divisible by themselves. | |
it('should return Fizz when the number is divisible by 3', () => { | |
// 2. Is that name enough, having `any` in it, to be complete in what numbers are producing `fizz`. | |
// There is also a matter of adding `only` (similar to case #1) having `anyNumberDivisibleOnlyBy3`. |
(ns isbn-verifier) | |
(defn- digits | |
"Splits ISBN 10 string into collection of digits" | |
[col] | |
(keep #(cond | |
(Character/isDigit %) (Character/getNumericValue %) | |
(= \X %) 10) | |
col)) |