Compare commits
142 Commits
gitlocaliz
...
build/page
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
beb3d57a6a | ||
|
|
decfccdfbc | ||
|
|
6d904cd9d7 | ||
|
|
44779074ca | ||
|
|
593fbcbba4 | ||
|
|
85112d267f | ||
|
|
9ff8039a43 | ||
|
|
b9ad4c6f99 | ||
|
|
4adcc2a090 | ||
|
|
eb34ea9a67 | ||
|
|
ae17de2b67 | ||
|
|
31d14b7deb | ||
|
|
dfc978df13 | ||
|
|
8dc1baa919 | ||
|
|
d66d8afae4 | ||
|
|
82af717edd | ||
|
|
5fd0a88927 | ||
|
|
34a7131aef | ||
|
|
3ce9be6081 | ||
|
|
01402ca31d | ||
|
|
69856f7ab2 | ||
|
|
274c008a0a | ||
|
|
96bf4635e5 | ||
|
|
1d0a24e547 | ||
|
|
8c3de66940 | ||
|
|
5412cfbde3 | ||
|
|
3adb816f30 | ||
|
|
2116b5cbd6 | ||
|
|
560ff0d9f1 | ||
|
|
c03384f370 | ||
|
|
c0ec1b5fdb | ||
|
|
4be482731b | ||
|
|
9bd03d8345 | ||
|
|
e4662cbc27 | ||
|
|
80bea4040f | ||
|
|
87ec516a23 | ||
|
|
6f177f4b46 | ||
|
|
97adc7dbb1 | ||
|
|
80e8ccff15 | ||
|
|
7c92a91988 | ||
|
|
bf758f436a | ||
|
|
722d79619c | ||
|
|
6b4572f590 | ||
|
|
e8acd18321 | ||
|
|
10937886b7 | ||
|
|
6ec4ecf503 | ||
|
|
c42fa2179e | ||
|
|
f9ff7d844d | ||
|
|
73010181d9 | ||
|
|
e24acac797 | ||
|
|
adc57da407 | ||
|
|
743595fee3 | ||
|
|
36492867d3 | ||
|
|
f15e6fdb0c | ||
|
|
a45f5ba757 | ||
|
|
8b280bee13 | ||
|
|
58c08b093b | ||
|
|
70b03354a8 | ||
|
|
847757c98d | ||
|
|
4b6d9b969c | ||
|
|
db065cf9a9 | ||
|
|
0a412ff6ae | ||
|
|
c6a173755e | ||
|
|
1ca5cb9345 | ||
|
|
ff00ccc5c3 | ||
|
|
269991a7cf | ||
|
|
0baacdbdcc | ||
|
|
e42035062e | ||
|
|
26e001b5b9 | ||
|
|
70970880d4 | ||
|
|
9d2ea60824 | ||
|
|
896c87f24b | ||
|
|
016c849a0f | ||
|
|
ff2732697f | ||
|
|
e3a242e974 | ||
|
|
813582f8a5 | ||
|
|
fa8016129e | ||
|
|
31e92a434c | ||
|
|
6635e8da51 | ||
|
|
3b78ae65f0 | ||
|
|
9ebebefa0e | ||
|
|
d6cb586e80 | ||
|
|
0ace74c8c2 | ||
|
|
193118ff2d | ||
|
|
7ed9f3d6ba | ||
|
|
619eabc9d2 | ||
|
|
9baa224340 | ||
|
|
f4e0acf525 | ||
|
|
716aef807e | ||
|
|
c6fccf4978 | ||
|
|
8152d6ffbb | ||
|
|
15bc98a2fc | ||
|
|
96aade10ff | ||
|
|
ddfa99d017 | ||
|
|
9bf87e4d37 | ||
|
|
887b9d3f20 | ||
|
|
34c38d87ed | ||
|
|
7da3edd242 | ||
|
|
bc041dbf62 | ||
|
|
015d25197f | ||
|
|
a07ab62114 | ||
|
|
2cd30d0845 | ||
|
|
3dbc237c1f | ||
|
|
7b341fc0d2 | ||
|
|
d8df4603ca | ||
|
|
0c35525fca | ||
|
|
0bf80bf8b5 | ||
|
|
50e2f2e6ce | ||
|
|
3ef9a5435e | ||
|
|
c18795765f | ||
|
|
93dec16bc9 | ||
|
|
4dd35e129e | ||
|
|
b6bd7b15d0 | ||
|
|
46a017ac55 | ||
|
|
abaca319be | ||
|
|
5a11b27c60 | ||
|
|
30008f11d5 | ||
|
|
e96ae13977 | ||
|
|
442a63aab5 | ||
|
|
c6c5d6d376 | ||
|
|
41289460fa | ||
|
|
e10a96dc31 | ||
|
|
a5236c0917 | ||
|
|
ea84113520 | ||
|
|
2c29ebe1b6 | ||
|
|
f03d9a502e | ||
|
|
cbbfdbb41c | ||
|
|
c21a06765b | ||
|
|
700e57f03d | ||
|
|
a387e3fc7e | ||
|
|
491ace1341 | ||
|
|
639465c7d8 | ||
|
|
5e57095aa6 | ||
|
|
f06b64ac38 | ||
|
|
7af3c2dde8 | ||
|
|
d3c4a9a3f2 | ||
|
|
97d358a3d3 | ||
|
|
d812cd79a5 | ||
|
|
933e7aa485 | ||
|
|
5f4fb690c3 | ||
|
|
f67e1dde05 | ||
|
|
98fa2e4a2d |
34
.github/contributing.md
vendored
@@ -2,11 +2,17 @@
|
||||
|
||||
<!-- vim-markdown-toc GFM -->
|
||||
|
||||
* [Goal of the Project](#goal-of-the-project)
|
||||
* [Example Law: The Law of Leaky Abstractions](#example-law-the-law-of-leaky-abstractions)
|
||||
* [Localisation](#localisation)
|
||||
* [Translations](#translations)
|
||||
* [How do I know if a law is relevant?](#how-do-i-know-if-a-law-is-relevant)
|
||||
* [How do I know if a law is 'well known' enough?](#how-do-i-know-if-a-law-is-well-known-enough)
|
||||
* [Use of Images](#use-of-images)
|
||||
|
||||
<!-- vim-markdown-toc -->
|
||||
|
||||
## Goal of the Project
|
||||
|
||||
The goal of this project is to have a set of _concise_ definitions to laws, principles, methodologies and patterns which hackers will find useful. They should be:
|
||||
|
||||
1. Short - one or two paragraphs.
|
||||
@@ -30,7 +36,7 @@ An example law is shown below, which covers most of the key points:
|
||||
|
||||
---
|
||||
|
||||
### Example Law: The Law of Leaky Abstractions
|
||||
## Example Law: The Law of Leaky Abstractions
|
||||
|
||||
[The Law of Leaky Abstractions on Joel on Software](https://www.joelonsoftware.com/2002/11/11/the-law-of-leaky-abstractions/)
|
||||
|
||||
@@ -54,10 +60,30 @@ Real-world examples:
|
||||
|
||||
- [Photoshop Slow Startup](https://forums.adobe.com/thread/376152) - an issue I encountered in the past. Photoshop would be slow to startup, sometimes taking minutes. It seems the issue was that on startup it reads some information about the current default printer. However, if that printer is actually a network printer, this could take an extremely long time. The _abstraction_ of a network printer being presented to the system similar to a local printer caused an issue for users in poor connectivity situations.
|
||||
|
||||
### Localisation
|
||||
## Translations
|
||||
|
||||
We are currently using [GitLocalize](https://gitlocalize.com) to handle translations. This provides features to make it easier for people to manage translations as changes come in:
|
||||
|
||||

|
||||
|
||||
This is still work in progress - if you would like to be a maintainer for a language just open an issue to get in touch!
|
||||
If you would like to moderate a language, please follow the steps below:
|
||||
|
||||
1. Log in to [Git Localize](https://gitlocalize.com) with your GitHub account, this will create a GitLocalize account for you.
|
||||
0. [Open an Issue](https://github.com/dwmkerr/hacker-laws/issues/new) with the name of the language you would like to moderate/translate.
|
||||
0. [Open a Pull Request](https://github.com/dwmkerr/hacker-laws/compare) that adds your details and the language details to the [Translators](https://github.com/dwmkerr/hacker-laws#translations) section of the README.
|
||||
3. I will then make you a moderator of the language and ensure the language is listed properly.
|
||||
|
||||
Thanks!
|
||||
|
||||
|
||||
## How do I know if a law is relevant?
|
||||
|
||||
In general, it should be reasonably applicable to the world of computer sciences, IT or coding in general.
|
||||
|
||||
## How do I know if a law is 'well known' enough?
|
||||
|
||||
A good test is 'If I search for it on Google, will I find it in the first few results?'.
|
||||
|
||||
## Use of Images
|
||||
|
||||
Please make sure to attribute images properly if you are referencing them. Also, include a white background, as some viewers will be viewing the site in 'Dark Mode' which can make images with a transparent background difficult to read.
|
||||
|
||||
28
.github/pages/index.html
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<!-- Bootstrap CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
|
||||
|
||||
<title>Hacker Laws</title>
|
||||
|
||||
<!-- Google tag (gtag.js) -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-RGJ5TDHWY9"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', 'G-RGJ5TDHWY9');
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hacker Laws</h1>
|
||||
|
||||
<!-- Bootstrap JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.min.js" integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF" crossorigin="anonymous"></script>
|
||||
</body>
|
||||
</html>
|
||||
43
.github/workflows/build-on-pull-request.yaml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
# This pipeline builds the PDF ebook on any pull request to master.
|
||||
name: "Build PDF"
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
prepare-pdf:
|
||||
# Focal Fossa. Please don't use 'latest' tags, it's an anti-pattern.
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
# Checkout the code.
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# Set a descriptive version. For PRs it'll be the short sha.
|
||||
- name: Set Version
|
||||
id: set_version
|
||||
run: echo ::set-output name=VERSION::$(git rev-parse --short HEAD)
|
||||
|
||||
# Prepare the content files.
|
||||
- name: Prepare Content
|
||||
run: ./scripts/prepare-markdown-for-ebook.sh ${{ steps.set_version.outputs.VERSION }}
|
||||
|
||||
# Create a PDF from the prepared markdown.
|
||||
- name: Prepare PDF
|
||||
uses: docker://pandoc/latex:2.9
|
||||
with:
|
||||
args: "-V toc-title:\"Table Of Contents\" --toc --pdf-engine=pdflatex --standalone --output hacker-laws.pdf hacker-laws.md"
|
||||
|
||||
# Publish the PDF and intermediate markdown as an artifact.
|
||||
- name: Publish PDF Artifact
|
||||
uses: actions/upload-artifact@master
|
||||
with:
|
||||
name: hacker-laws.pdf
|
||||
path: hacker-laws.pdf
|
||||
|
||||
- name: Publish Intermediate Markdown Artifact
|
||||
uses: actions/upload-artifact@master
|
||||
with:
|
||||
name: hacker-laws.md
|
||||
path: hacker-laws.md
|
||||
40
.github/workflows/pages.yaml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: Deploy to Pages
|
||||
|
||||
on:
|
||||
# Runs on pushes targeting the default branch (or runs manually).
|
||||
push:
|
||||
# branches: [$default-branch]
|
||||
branches: ['build/pages'] # we're deploying from a build branch for now.
|
||||
workflow_dispatch:
|
||||
|
||||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
|
||||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
|
||||
concurrency:
|
||||
group: "pages"
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
# Single deploy job since we're just deploying
|
||||
deploy:
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v5
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: './.github/pages'
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
69
.github/workflows/release-on-tag.yaml
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
# This pipeline builds the PDF ebook on any tag starting with 'v'.
|
||||
name: "Create Release"
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
prepare-pdf:
|
||||
# Focal Fossa. Please don't use 'latest' tags, it's an anti-pattern.
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
# Checkout the code.
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# Set a descriptive version. For PRs it'll be the short sha.
|
||||
- name: Set Version
|
||||
id: set_version
|
||||
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
|
||||
|
||||
# Prepare the content files.
|
||||
- name: Prepare Content
|
||||
run: ./scripts/prepare-markdown-for-ebook.sh ${{ steps.set_version.outputs.VERSION }}
|
||||
|
||||
# Create a PDF from the prepared markdown.
|
||||
- name: Prepare PDF
|
||||
uses: docker://pandoc/latex:2.9
|
||||
with:
|
||||
args: "-V toc-title:\"Table Of Contents\" --toc --pdf-engine=pdflatex --standalone --output hacker-laws.pdf hacker-laws.md"
|
||||
|
||||
# Publish the PDF artifact.
|
||||
- name: Publish PDF Artifacts
|
||||
uses: actions/upload-artifact@master
|
||||
with:
|
||||
name: hacker-laws.pdf
|
||||
path: hacker-laws.pdf
|
||||
|
||||
release:
|
||||
needs: prepare-pdf
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Download artifact
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: hacker-laws.pdf
|
||||
|
||||
- name: Create Release
|
||||
id: create-release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: ${{ github.ref }}
|
||||
body: |
|
||||
Hacker Laws E-Book
|
||||
draft: false
|
||||
prerelease: false
|
||||
|
||||
- name: Upload Release Asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create-release.outputs.upload_url }}
|
||||
asset_path: ./hacker-laws.pdf
|
||||
asset_name: hacker-laws.pdf
|
||||
asset_content_type: application/pdf
|
||||
2
LICENSE
@@ -1,4 +1,4 @@
|
||||
Copyright (c) Dave Kerr 2020
|
||||
Copyright (c) Dave Kerr 2021
|
||||
|
||||
# Attribution-ShareAlike 4.0 International
|
||||
|
||||
|
||||
414
README.md
@@ -2,71 +2,88 @@
|
||||
|
||||
Laws, Theories, Principles and Patterns that developers will find useful.
|
||||
|
||||
[Translations](#translations): [🇮🇩](./translations/pt-BR.md) [🇧🇷](./translations/pt-BR.md) [🇨🇳](https://github.com/nusr/hacker-laws-zh) [🇩🇪](./translations/de.md) [🇫🇷](./translations/fr.md) [🇬🇷](./translations/el.md) [🇮🇹](https://github.com/csparpa/hacker-laws-it) [🇱🇻](./translations/lv.md) [🇰🇷](https://github.com/codeanddonuts/hacker-laws-kr) [🇷🇺](https://github.com/solarrust/hacker-laws) [🇪🇸](./translations/es-ES.md) [🇹🇷](https://github.com/umutphp/hacker-laws-tr) [🇯🇵](./translations/jp.md)
|
||||
[Translations](#translations): [🇮🇩](./translations/id.md) [🇧🇷](./translations/pt-BR.md) [🇨🇳](https://github.com/nusr/hacker-laws-zh) [🇩🇪](./translations/de.md) [🇫🇷](./translations/fr.md) [🇬🇷](./translations/el.md) [🇮🇹](https://github.com/csparpa/hacker-laws-it) [🇱🇻](./translations/lv.md) [🇰🇷](https://github.com/codeanddonuts/hacker-laws-kr) [🇵🇱](./translations/pl.md) [🇷🇺](https://github.com/solarrust/hacker-laws) [🇪🇸](./translations/es-ES.md) [🇹🇷](https://github.com/umutphp/hacker-laws-tr) [🇯🇵](./translations/jp.md) [🇺🇦](./translations/uk.md) [🇻🇳](./translations/vi.md)
|
||||
|
||||
Like this project? Please considering [sponsoring me](https://github.com/sponsors/dwmkerr) and the [translators](#translations).
|
||||
Like this project? Please considering [sponsoring me](https://github.com/sponsors/dwmkerr) and the [translators](#translations). Also check out this podcast on [The Changelog - Laws for Hackers to Live By](https://changelog.com/podcast/403) to learn more about the project! You can also [download the latest PDF eBook](https://github.com/dwmkerr/hacker-laws/releases/latest/download/hacker-laws.pdf). Check the [Contributor Guide](./.github/contributing.md) if you are keen to contribute!
|
||||
|
||||
---
|
||||
|
||||
<!-- vim-markdown-toc GFM -->
|
||||
|
||||
* [Introduction](#introduction)
|
||||
* [Laws](#laws)
|
||||
* [90–9–1 Principle (1% Rule)](#9091-principle-1-rule)
|
||||
* [Amdahl's Law](#amdahls-law)
|
||||
* [The Broken Windows Theory](#the-broken-windows-theory)
|
||||
* [Brooks' Law](#brooks-law)
|
||||
* [CAP Theorem (Brewer's Theorem)](#cap-theorem-brewers-theorem)
|
||||
* [Conway's Law](#conways-law)
|
||||
* [Cunningham's Law](#cunninghams-law)
|
||||
* [Dunbar's Number](#dunbars-number)
|
||||
* [Fitts' Law](#fitts-law)
|
||||
* [Gall's Law](#galls-law)
|
||||
* [Goodhart's Law](#goodharts-law)
|
||||
* [Hanlon's Razor](#hanlons-razor)
|
||||
* [Hick's Law (Hick-Hyman Law)](#hicks-law-hick-hyman-law)
|
||||
* [Hofstadter's Law](#hofstadters-law)
|
||||
* [Hutber's Law](#hutbers-law)
|
||||
* [The Hype Cycle & Amara's Law](#the-hype-cycle--amaras-law)
|
||||
* [Hyrum's Law (The Law of Implicit Interfaces)](#hyrums-law-the-law-of-implicit-interfaces)
|
||||
* [Kernighan's Law](#kernighans-law)
|
||||
* [Metcalfe's Law](#metcalfes-law)
|
||||
* [Moore's Law](#moores-law)
|
||||
* [Murphy's Law / Sod's Law](#murphys-law--sods-law)
|
||||
* [Occam's Razor](#occams-razor)
|
||||
* [Parkinson's Law](#parkinsons-law)
|
||||
* [Premature Optimization Effect](#premature-optimization-effect)
|
||||
* [Putt's Law](#putts-law)
|
||||
* [Reed's Law](#reeds-law)
|
||||
* [The Law of Conservation of Complexity (Tesler's Law)](#the-law-of-conservation-of-complexity-teslers-law)
|
||||
* [The Law of Demeter](#the-law-of-demeter)
|
||||
* [The Law of Leaky Abstractions](#the-law-of-leaky-abstractions)
|
||||
* [The Law of Triviality](#the-law-of-triviality)
|
||||
* [The Unix Philosophy](#the-unix-philosophy)
|
||||
* [The Spotify Model](#the-spotify-model)
|
||||
* [Wadler's Law](#wadlers-law)
|
||||
* [Wheaton's Law](#wheatons-law)
|
||||
* [Principles](#principles)
|
||||
* [The Dead Sea Effect](#the-dead-sea-effect)
|
||||
* [The Dilbert Principle](#the-dilbert-principle)
|
||||
* [The Pareto Principle (The 80/20 Rule)](#the-pareto-principle-the-8020-rule)
|
||||
* [The Peter Principle](#the-peter-principle)
|
||||
* [The Robustness Principle (Postel's Law)](#the-robustness-principle-postels-law)
|
||||
* [SOLID](#solid)
|
||||
* [The Single Responsibility Principle](#the-single-responsibility-principle)
|
||||
* [The Open/Closed Principle](#the-openclosed-principle)
|
||||
* [The Liskov Substitution Principle](#the-liskov-substitution-principle)
|
||||
* [The Interface Segregation Principle](#the-interface-segregation-principle)
|
||||
* [The Dependency Inversion Principle](#the-dependency-inversion-principle)
|
||||
* [The DRY Principle](#the-dry-principle)
|
||||
* [The KISS principle](#the-kiss-principle)
|
||||
* [YAGNI](#yagni)
|
||||
* [The Fallacies of Distributed Computing](#the-fallacies-of-distributed-computing)
|
||||
* [Reading List](#reading-list)
|
||||
* [Translations](#translations)
|
||||
* [Related Projects](#related-projects)
|
||||
* [Contributing](#contributing)
|
||||
* [TODO](#todo)
|
||||
- [Introduction](#introduction)
|
||||
- [Laws](#laws)
|
||||
- [90–9–1 Principle (1% Rule)](#9091-principle-1-rule)
|
||||
- [90–90 Rule](#9090-rule)
|
||||
- [Amdahl's Law](#amdahls-law)
|
||||
- [The Broken Windows Theory](#the-broken-windows-theory)
|
||||
- [Brooks' Law](#brooks-law)
|
||||
- [CAP Theorem (Brewer's Theorem)](#cap-theorem-brewers-theorem)
|
||||
- [Clarke's three laws](#clarkes-three-laws)
|
||||
- [Conway's Law](#conways-law)
|
||||
- [Cunningham's Law](#cunninghams-law)
|
||||
- [Dunbar's Number](#dunbars-number)
|
||||
- [The Dunning-Kruger Effect](#the-dunning-kruger-effect)
|
||||
- [Fitts' Law](#fitts-law)
|
||||
- [Gall's Law](#galls-law)
|
||||
- [Goodhart's Law](#goodharts-law)
|
||||
- [Hanlon's Razor](#hanlons-razor)
|
||||
- [Hick's Law (Hick-Hyman Law)](#hicks-law-hick-hyman-law)
|
||||
- [Hofstadter's Law](#hofstadters-law)
|
||||
- [Hutber's Law](#hutbers-law)
|
||||
- [The Hype Cycle & Amara's Law](#the-hype-cycle--amaras-law)
|
||||
- [Hyrum's Law (The Law of Implicit Interfaces)](#hyrums-law-the-law-of-implicit-interfaces)
|
||||
- [Input-Process-Output (IPO)](#input-process-output-ipo)
|
||||
- [Kernighan's Law](#kernighans-law)
|
||||
- [Linus's Law](#linuss-law)
|
||||
- [Metcalfe's Law](#metcalfes-law)
|
||||
- [Moore's Law](#moores-law)
|
||||
- [Murphy's Law / Sod's Law](#murphys-law--sods-law)
|
||||
- [Occam's Razor](#occams-razor)
|
||||
- [Parkinson's Law](#parkinsons-law)
|
||||
- [Premature Optimization Effect](#premature-optimization-effect)
|
||||
- [Putt's Law](#putts-law)
|
||||
- [Reed's Law](#reeds-law)
|
||||
- [The Ringelmann Effect](#the-ringelmann-effect)
|
||||
- [The Law of Conservation of Complexity (Tesler's Law)](#the-law-of-conservation-of-complexity-teslers-law)
|
||||
- [The Law of Demeter](#the-law-of-demeter)
|
||||
- [The Law of Leaky Abstractions](#the-law-of-leaky-abstractions)
|
||||
- [The Law of the Instrument](#the-law-of-the-instrument)
|
||||
- [The Law of Triviality](#the-law-of-triviality)
|
||||
- [The Unix Philosophy](#the-unix-philosophy)
|
||||
- [The Scout Rule](#the-scout-rule)
|
||||
- [The Spotify Model](#the-spotify-model)
|
||||
- [The Two Pizza Rule](#the-two-pizza-rule)
|
||||
- [Twyman's law](#twymans-law)
|
||||
- [Wadler's Law](#wadlers-law)
|
||||
- [Wheaton's Law](#wheatons-law)
|
||||
- [Principles](#principles)
|
||||
- [All Models Are Wrong (George Box's Law)](#all-models-are-wrong-george-boxs-law)
|
||||
- [Chesterton's Fence](#chestertons-fence)
|
||||
- [The Dead Sea Effect](#the-dead-sea-effect)
|
||||
- [The Dilbert Principle](#the-dilbert-principle)
|
||||
- [The Pareto Principle (The 80/20 Rule)](#the-pareto-principle-the-8020-rule)
|
||||
- [The Shirky Principle](#the-shirky-principle)
|
||||
- [The Peter Principle](#the-peter-principle)
|
||||
- [The Robustness Principle (Postel's Law)](#the-robustness-principle-postels-law)
|
||||
- [SOLID](#solid)
|
||||
- [The Single Responsibility Principle](#the-single-responsibility-principle)
|
||||
- [The Open/Closed Principle](#the-openclosed-principle)
|
||||
- [The Liskov Substitution Principle](#the-liskov-substitution-principle)
|
||||
- [The Interface Segregation Principle](#the-interface-segregation-principle)
|
||||
- [The Dependency Inversion Principle](#the-dependency-inversion-principle)
|
||||
- [The DRY Principle](#the-dry-principle)
|
||||
- [The KISS principle](#the-kiss-principle)
|
||||
- [YAGNI](#yagni)
|
||||
- [The Fallacies of Distributed Computing](#the-fallacies-of-distributed-computing)
|
||||
- [The Principle of Least Astonishment](#the-principle-of-least-astonishment)
|
||||
- [Reading List](#reading-list)
|
||||
- [Online Resources](#online-resources)
|
||||
- [PDF eBook](#pdf-ebook)
|
||||
- [Podcast](#podcast)
|
||||
- [Translations](#translations)
|
||||
- [Related Projects](#related-projects)
|
||||
- [Contributing](#contributing)
|
||||
- [TODO](#todo)
|
||||
|
||||
<!-- vim-markdown-toc -->
|
||||
|
||||
@@ -80,6 +97,7 @@ There are lots of laws which people discuss when talking about development. This
|
||||
|
||||
And here we go!
|
||||
|
||||
|
||||
### 90–9–1 Principle (1% Rule)
|
||||
|
||||
[1% Rule on Wikipedia](https://en.wikipedia.org/wiki/1%25_rule_(Internet_culture))
|
||||
@@ -94,6 +112,19 @@ See Also:
|
||||
|
||||
- [Pareto principle](#the-pareto-principle-the-8020-rule)
|
||||
|
||||
### 90–90 Rule
|
||||
|
||||
[90-90 Rule on Wikipedia](https://en.wikipedia.org/wiki/Ninety%E2%80%93ninety_rule)
|
||||
|
||||
> The first 90 percent of the code accounts for the first 90 percent of the development time. The remaining 10 percent of the code accounts for the other 90 percent of the development time.
|
||||
|
||||
A wry reinterpretation of the [Pareto Principe (or 80-20 rule)](#the-pareto-principle-the-8020-rule) that highlights the real-world challenges of completing engineering work. This sentiment is also echoed in [Hofstadter's Law](#hofstadters-law).
|
||||
|
||||
See also:
|
||||
|
||||
- [Hofstadter's Law](#hofstadters-law)
|
||||
- [The Pareto Principe](#the-pareto-principle-the-8020-rule)
|
||||
|
||||
### Amdahl's Law
|
||||
|
||||
[Amdahl's Law on Wikipedia](https://en.wikipedia.org/wiki/Amdahl%27s_law)
|
||||
@@ -131,7 +162,7 @@ See also:
|
||||
|
||||
Examples:
|
||||
|
||||
- [The Pragmatic Programming: Software Entropy](https://pragprog.com/the-pragmatic-programmer/extracts/software-entropy)
|
||||
- [The Pragmatic Programming: Software Entropy](https://flylib.com/books/en/1.315.1.15/1/)
|
||||
- [Coding Horror: The Broken Window Theory](https://blog.codinghorror.com/the-broken-window-theory/)
|
||||
- [OpenSource: Joy of Programming - The Broken Window Theory](https://opensourceforu.com/2011/05/joy-of-programming-broken-window-theory/)
|
||||
|
||||
@@ -141,7 +172,7 @@ Examples:
|
||||
|
||||
> Adding human resources to a late software development project makes it later.
|
||||
|
||||
This law suggests that in many cases, attempting to accelerate the delivery of a project which is already late, by adding more people, will make the delivery even later. Brooks is clear that this is an over-simplification, however, the general reasoning is that given the ramp up time of new resources and the communication overheads, in the immediate short-term velocity decreases. Also, many tasks may not be divisible, i.e. easily distributed between more resources, meaning the potential velocity increase is also lower.
|
||||
This law suggests that in many cases, attempting to accelerate the delivery of a project which is already late, by adding more people, will make the delivery even later. Brooks is clear that this is an over-simplification, however, the general reasoning is that given the ramp-up time of new resources and the communication overheads, in the immediate short-term velocity decreases. Also, many tasks may not be divisible, i.e. easily distributed between more resources, meaning the potential velocity increase is also lower.
|
||||
|
||||
The common phrase in delivery "Nine women can't make a baby in one month" relates to Brooks' Law, in particular, the fact that some kinds of work are not divisible or parallelisable.
|
||||
|
||||
@@ -160,7 +191,7 @@ The CAP Theorem (defined by Eric Brewer) states that for a distributed data stor
|
||||
- Availability: when reading data, every request receives _a non error response_, without the guarantee that it is the _most recent_ data
|
||||
- Partition Tolerance: when an arbitrary number of network requests between nodes fail, the system continues to operate as expected
|
||||
|
||||
The core of the reasoning is as follows. It is impossible to guarantee that a network partition will not occur (see [The Fallacies of Distributed Computing](#The_Fallacies_of_Distributed_Computing)). Therefore in the case of a partition we can either cancel the operation (increasing consistency and decreasing availability) or proceed (increasing availability but decreasing consistency).
|
||||
The core of the reasoning is as follows. It is impossible to guarantee that a network partition will not occur (see [The Fallacies of Distributed Computing](#the-fallacies-of-distributed-computing)). Therefore in the case of a partition we can either cancel the operation (increasing consistency and decreasing availability) or proceed (increasing availability but decreasing consistency).
|
||||
|
||||
The name comes from the first letters of the guarantees (Consistency, Availability, Partition Tolerance). Note that it is very important to be aware that this does _not_ relate to [_ACID_](#TODO), which has a different definition of consistency. More recently, [PACELC](#TODO) theorem has been developed which adds constraints for latency and consistency when the network is _not_ partitioned (i.e. when the system is operating as expected).
|
||||
|
||||
@@ -173,14 +204,26 @@ Real world examples:
|
||||
See also:
|
||||
|
||||
- [ACID](#TODO)
|
||||
- [The Fallacies of Distributed Computing](#The_Fallacies_of_Distributed_Computing)
|
||||
- [The Fallacies of Distributed Computing](#the-fallacies-of-distributed-computing)
|
||||
- [PACELC](#TODO)
|
||||
|
||||
### Clarke's three laws
|
||||
|
||||
[Clarke's three laws on Wikipedia](https://en.wikipedia.org/wiki/Clarke's_three_laws)
|
||||
|
||||
Arthur C. Clarke, an british science fiction writer, formulated three adages that are known as Clarke's three laws. The third law is the best known and most widely cited.
|
||||
|
||||
These so-called laws are:
|
||||
- When a distinguished but elderly scientist states that something is possible, they are almost certainly right. When they state that something is impossible, they are very probably wrong.
|
||||
- The only way of discovering the limits of the possible is to venture a little way past them into the impossible.
|
||||
- Any sufficiently advanced technology is indistinguishable from magic.
|
||||
|
||||
|
||||
### Conway's Law
|
||||
|
||||
[Conway's Law on Wikipedia](https://en.wikipedia.org/wiki/Conway%27s_law)
|
||||
|
||||
This law suggests that the technical boundaries of a system will reflect the structure of the organisation. It is commonly referred to when looking at organisation improvements, Conway's Law suggests that if an organisation is structured into many small, disconnected units, the software it produces will be. If an organisation is built more around 'verticals' which are orientated around features or services, the software systems will also reflect this.
|
||||
This law suggests that the technical boundaries of a system will reflect the structure of the organisation. It is commonly referred to when looking at organisation improvements, Conway's Law suggests that if an organisation is structured into many small, disconnected units, the software it produces will be. If an organisation is built more around 'verticals' which are oriented around features or services, the software systems will also reflect this.
|
||||
|
||||
See also:
|
||||
|
||||
@@ -204,12 +247,31 @@ See also:
|
||||
|
||||
"Dunbar's number is a suggested cognitive limit to the number of people with whom one can maintain stable social relationships— relationships in which an individual knows who each person is and how each person relates to every other person." There is some disagreement to the exact number. "... [Dunbar] proposed that humans can comfortably maintain only 150 stable relationships." He put the number into a more social context, "the number of people you would not feel embarrassed about joining uninvited for a drink if you happened to bump into them in a bar." Estimates for the number generally lay between 100 and 250.
|
||||
|
||||
Like stable relationships between individuals, a developer's relationship with a codebase takes effort to maintain. When faced with large complicated projects, or ownership of many projects we lean on convention, policy, and modeled procedure to scale. Dunbar's number is not only important to keep in mind as an office grows, but also when setting the scope for team efforts or deciding when a system should invest in tooling to assist in modeling and automating logistical overhead. Putting the number into an engineering context, it is the number of projects (or normalized complexity of a single project) for which you would feel confident in joining an on-call rotation to support.
|
||||
Like stable relationships between individuals, a developer's relationship with a codebase takes effort to maintain. When faced with large complicated projects, or ownership of many projects, we lean on convention, policy, and modeled procedure to scale. Dunbar's number is not only important to keep in mind as an office grows, but also when setting the scope for team efforts or deciding when a system should invest in tooling to assist in modeling and automating logistical overhead. Putting the number into an engineering context, it is the number of projects (or normalized complexity of a single project) for which you would feel confident in joining an on-call rotation to support.
|
||||
|
||||
See also:
|
||||
|
||||
- [Conway's Law](#conways-law)
|
||||
|
||||
|
||||
### The Dunning-Kruger Effect
|
||||
|
||||
[The Dunning-Kruger Effect on Wikipedia](https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect)
|
||||
|
||||
> If you're incompetent, you can't know you're incompetent... The skills you need to produce a right answer are exactly the skills you need to recognize what a right answer is.
|
||||
>
|
||||
> ([David Dunning](https://en.wikipedia.org/wiki/David_Dunning))
|
||||
|
||||
The Dunning–Kruger effect is a theoretical cognitive bias which was described by David Dunning and Justin Kruger in a 1999 psychological study and paper. The study suggests that people with a low level of ability at a task are likely to overestimate their ability of the task. The proposed reason for this bias is that a sufficient _awareness_ of the complexity of a problem or domain is required for a person to be able to make an informed opinion of their capability to work in that domain.
|
||||
|
||||
The Dunning-Kruger effect has sometimes been used to describe a related, but not necessarily implied effect which could be described as "The less a person understands a domain, the more they are likely to believe they can easily solve problems in that domain, as they are more likely to see the domain as _simple_". This more general effect is highly relevant in technology. It would suggest that people who are less familiar with a domain, such as non-technical team members or less experienced team members, are more likely to _underestimate_ the effort required to solve a problem in this space.
|
||||
|
||||
As a person's understanding and experience in a domain grows, they may well encounter another effect, which is that they tend to _overestimate_ the ability of _others_ or _underestimate_ their own ability, as they are have become so experienced in the domain. In all cases these effects are _cognitive biases_. As with any bias, an understanding that it may be present will often be sufficient to help avoid the challenges — as when there is awareness of a bias, more inputs and opinions can be included to attempt to eliminate these biases. A closely related bias is that of [Illusory superiority](https://en.wikipedia.org/wiki/Illusory_superiority).
|
||||
|
||||
Real-world examples:
|
||||
|
||||
* [Apple vs. FBI: Why This Anti-Terror Hawk Switched Sides](https://fortune.com/2016/03/10/apple-fbi-lindsay-graham/) - In 2016 Senator Lindsey Graham changed his stance on Apple creating a 'backdoor' in their encryption of devices. Initially Graham had been critical of Apple challenging a request to create a 'backdoor', which he saw as necessary to investigate potential terrorist plots. However, by Graham's own admission, as he learned more about the technical complexity of the domain, he realised that he had assumed it to be far more simple than he had realised, and that such a backdoor could have serious negative consequences. This could potentially be considered an example of the Dunning-Kruger effect - a cyber-security expert would likely understand immediately how such a backdoor could be exploited, as they have deep understanding of the domain, a layperson might assume that phone security is more similar to _physical security_ where the practice of having a 'master key' for law enforcement is possible, but this analogy does not apply sufficiently well to describe modern encryption in cyber-security.
|
||||
|
||||
### Fitts' Law
|
||||
|
||||
[Fitts' Law on Wikipedia](https://en.wikipedia.org/wiki/Fitts%27s_law)
|
||||
@@ -222,7 +284,7 @@ Fitts' law predicts that the time required to move to a target area is a functio
|
||||
|
||||
The consequences of this law dictate that when designing UX or UI, interactive elements should be as large as possible and the distance between the users attention area and interactive element should be as small as possible. This has consequences on design, such as grouping tasks that are commonly used with one another close.
|
||||
|
||||
It also formalises the concept of 'magic corners', the corners of the screen which a user can 'sweep' their mouse too to easily hit - which is where key UI elements can be placed. The Windows Start button is in a magic corner, making it easy to select, and as an interesting contrast, the MacOS 'close window' button is _not_ in a magic corner, making it hard to hit by mistake.
|
||||
It also formalises the concept of 'magic corners', the corners of the screen to which a user can 'sweep' their mouse to easily hit - which is where key UI elements can be placed. The Windows Start button is in a magic corner, making it easy to select, and as an interesting contrast, the MacOS 'close window' button is _not_ in a magic corner, making it hard to hit by mistake.
|
||||
|
||||
See also:
|
||||
|
||||
@@ -363,6 +425,24 @@ See also:
|
||||
- [The Law of Leaky Abstractions](#the-law-of-leaky-abstractions)
|
||||
- [XKCD 1172](https://xkcd.com/1172/)
|
||||
|
||||
### Input-Process-Output (IPO)
|
||||
|
||||
[Input–Process–Output on Wikipedia](https://en.wikipedia.org/wiki/IPO_model)
|
||||
|
||||
Systems can be incredibly complex, but can typically be broken down into smaller parts that follow a simple pattern:
|
||||
|
||||
1. Input is provided
|
||||
2. Some kind of processing or transformation is performed
|
||||
3. Output is returned
|
||||
|
||||
A sort function in a programming language or system could be a classic example of the IPO pattern; where arbitrary input is sorted based on a predicate and returned back. A web server could be modelled as an IPO system, where HTTP requests are transformed into HTTP responses. A highly complex Generative AI system could likewise be modelled in this way, with user input being passed through a complex model and a response being generated.
|
||||
|
||||
The IPO pattern is present in different forms across almost all technological domains, from [functional programming](https://en.wikipedia.org/wiki/Functional_programming) languages that explicitly follow IPO patterns to [The Unix Philosophy](#the-unix-philosophy), which suggests that highly complex systems can be built by chaining together many simple IPO programs.
|
||||
|
||||
See also:
|
||||
|
||||
- [The Unix Philosophy](#the-unix-philosophy)
|
||||
|
||||
### Kernighan's Law
|
||||
|
||||
> Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
|
||||
@@ -381,6 +461,24 @@ See also:
|
||||
- [The Unix Philosophy](#the-unix-philosophy)
|
||||
- [Occam's Razor](#occams-razor)
|
||||
|
||||
### Linus's Law
|
||||
|
||||
[Linus's Law on Wikipedia](https://en.wikipedia.org/wiki/Linus%27s_law)
|
||||
|
||||
> Given enough eyeballs, all bugs are shallow.
|
||||
>
|
||||
> _Eric S. Raymond_
|
||||
|
||||
This law simply states that the more people who can see a problem, the higher the likelihood that someone will have seen and solved the problem before, or something very similar.
|
||||
|
||||
Although it was originally used to describe the value of open-source models for projects it can be accepted for any kind of software project. It can also be extended to processes - more code reviews, more static analysis and multi-disciplined test processes will make the problems more visible and easy to identify.
|
||||
|
||||
A more formal statement can be:
|
||||
|
||||
> Given a large enough beta-tester and co-developer base, almost every problem will be characterized quickly and can be solved by someone who has encountered a similar problem before.
|
||||
|
||||
This law was named in honour of [Linus Torvalds](https://en.wikipedia.org/wiki/Linus_Torvalds) in Eric S. Raymond's book "[The Cathedral and the Bazaar](https://en.wikipedia.org/wiki/The_Cathedral_and_the_Bazaar)".
|
||||
|
||||
### Metcalfe's Law
|
||||
|
||||
[Metcalfe's Law on Wikipedia](https://en.wikipedia.org/wiki/Metcalfe's_law)
|
||||
@@ -455,7 +553,7 @@ See also:
|
||||
|
||||
### Premature Optimization Effect
|
||||
|
||||
[Premature Optimization on WikiWikiWeb](http://wiki.c2.com/?PrematureOptimization)
|
||||
[Premature Optimization on WikiWeb](http://wiki.c2.com/?PrematureOptimization)
|
||||
|
||||
> Premature optimization is the root of all evil.
|
||||
>
|
||||
@@ -484,7 +582,6 @@ See also:
|
||||
- [The Peter Principle](#the-peter-principle)
|
||||
- [The Dilbert Principle](#the-dilbert-principle)
|
||||
|
||||
|
||||
### Reed's Law
|
||||
|
||||
[Reed's Law on Wikipedia](https://en.wikipedia.org/wiki/Reed's_law)
|
||||
@@ -497,6 +594,15 @@ See also:
|
||||
- [Metcalfe's Law](#metcalfes-law)
|
||||
- [Dunbar's Number](#dunbars-number)
|
||||
|
||||
### The Ringelmann Effect
|
||||
|
||||
[The Ringelmann effect on Wikipedia](https://en.wikipedia.org/wiki/Ringelmann_effect)
|
||||
|
||||
The Ringelmann Effect is the tendency of an individual to become increasingly inefficient as more and more people are involved in a task. In other words, as more individuals are added to a team, the more the average individual performance decreases. Multiple causes are believed to be at work, including loss of motivation ("[social loafing](https://en.wikipedia.org/wiki/Social_loafing)") and challenges related to coordination.
|
||||
|
||||
See also:
|
||||
- [Brooks' Law](#brooks-law)
|
||||
|
||||
### The Law of Conservation of Complexity (Tesler's Law)
|
||||
|
||||
[The Law of Conservation of Complexity on Wikipedia](https://en.wikipedia.org/wiki/Law_of_conservation_of_complexity)
|
||||
@@ -543,6 +649,25 @@ Real-world examples:
|
||||
|
||||
- [Photoshop Slow Startup](https://forums.adobe.com/thread/376152) - an issue I encountered in the past. Photoshop would be slow to startup, sometimes taking minutes. It seems the issue was that on startup it reads some information about the current default printer. However, if that printer is actually a network printer, this could take an extremely long time. The _abstraction_ of a network printer being presented to the system similar to a local printer caused an issue for users in poor connectivity situations.
|
||||
|
||||
### The Law of the Instrument
|
||||
|
||||
[The Law of the Instrument](https://en.wikipedia.org/wiki/Law_of_the_instrument)
|
||||
|
||||
> I call it the law of the instrument, and it may be formulated as follows: Give a small boy a hammer, and he will find that everything he encounters needs pounding.
|
||||
>
|
||||
> _Abraham Kaplan_
|
||||
|
||||
> If all you have is a hammer, everything looks like a nail.
|
||||
>
|
||||
> _Abraham Maslow_
|
||||
|
||||
In the context of computer programming, this law suggests that people tend to use tools that are familiar with, rather than the best possible tool. This over-reliance on a familiar tool is an anti-pattern referred to as 'the golden hammer'.
|
||||
|
||||
See also:
|
||||
|
||||
- [Avoiding the law of the instrument](https://josemdev.com/avoiding-the-law-of-the-instrument/)
|
||||
- [Anti-Pattern - The Golden Hammer](https://archive.org/details/antipatternsrefa0000unse/page/111/mode/2up)
|
||||
|
||||
### The Law of Triviality
|
||||
|
||||
[The Law of Triviality on Wikipedia](https://en.wikipedia.org/wiki/Law_of_triviality)
|
||||
@@ -561,6 +686,26 @@ The Unix Philosophy is that software components should be small, and focused on
|
||||
|
||||
Modern practices like 'Microservice Architecture' can be thought of as an application of this law, where services are small, focused and do one specific thing, allowing complex behaviour to be composed of simple building blocks.
|
||||
|
||||
### The Scout Rule
|
||||
|
||||
[The Scout Rule on O'Reilly](https://www.oreilly.com/library/view/97-things-every/9780596809515/ch08.html)
|
||||
|
||||
> Always leave the code better than you found it.
|
||||
>
|
||||
> (Robert C. Martin (Uncle Bob))
|
||||
|
||||
Based on the "Scout Rule", which is "always leave the campground cleaner than you found it", the Scout Rule in programming is simply "always leave the code cleaner than you found it".
|
||||
|
||||
This was introduced in the first chapter of the book [Clean Code](https://www.goodreads.com/book/show/3735293-clean-code) by Bob Martin. The rule suggests that developers should perform 'optimistic refactoring', which means to endeavour to improve the overall quality of the code when you work on it. If you see a mistake, attempt to fix it or clean it up. However, when making changes to code which seems incorrect, it may be worth remembering [Chesterton's Fence](#chestertons-fence)!
|
||||
|
||||
See also:
|
||||
|
||||
- [Reading List: Clean Code](#reading-list)
|
||||
- [Chesterton's Fence](#chestertons-fence)
|
||||
- [The Broken Windows Theory](#broken-windows-theory)
|
||||
|
||||
https://www.amazon.sg/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882
|
||||
|
||||
### The Spotify Model
|
||||
|
||||
[The Spotify Model on Spotify Labs](https://labs.spotify.com/2014/03/27/spotify-engineering-culture-part-1/)
|
||||
@@ -571,6 +716,30 @@ The Spotify Model also popularises the concepts of Tribes, Guilds, Chapters, whi
|
||||
|
||||
Members of the organisation have described that the actual meaning of these groups changes, evolves and is an on-going experiment. The fact that the model is a _process in motion_, rather than a fixed model continues to lead to varying interpretations of the structure, which may be based on presentations given by employees at conferences. This means 'snapshots' may be 're-packaged' by third parties as a _fixed structure_, with the fact that the model is dynamic being lost.
|
||||
|
||||
### The Two Pizza Rule
|
||||
|
||||
> If you can't feed a team with two pizzas, it's too large.
|
||||
>
|
||||
> (Jeff Bezos)
|
||||
|
||||
This rule suggests that regardless of the size of the company, teams should be small enough to be fed by two pizzas. Attributed to Jeff Bezos and Amazon, this belief suggests that large teams are inherently inefficient. This is supported by the fact that as the team size increases linearly, the links between people increases quadratically; thus the cost of coordinating and communicating also grows quadratically. If this cost of coordination is essentially overhead, then smaller teams should be preferred.
|
||||
|
||||
The number of links between people can be expressed as `n(n-1)/2` where n = number of people.
|
||||
|
||||
<img width="200px" alt="Complete graph; Links between people" src="./images/complete_graph.png" />
|
||||
|
||||
### Twyman's law
|
||||
|
||||
[Twyman's Law on Wikipedia](https://en.wikipedia.org/wiki/Twyman%27s_law)
|
||||
|
||||
> The more unusual or interesting the data, the more likely they are to have been the result of an error of one kind or another.
|
||||
|
||||
This law suggests that when there are particularly unusual data points, it is more likely that they are the result of errors or manipulation. For example, if a dataset of long-jump results from a sporting event showed a maximum value of 20 meters (more than twice the world record), it is more likely to be due to an error (such as recording a value in feet rather than meters) than due to an unusually long jump. It is also more likely in this case that the results could have been manipulated.
|
||||
|
||||
See also:
|
||||
|
||||
- [Sagan Standard](#TODO)
|
||||
|
||||
### Wadler's Law
|
||||
|
||||
[Wadler's Law on wiki.haskell.org](https://wiki.haskell.org/Wadler's_Law)
|
||||
@@ -606,6 +775,32 @@ Coined by Wil Wheaton (Star Trek: The Next Generation, The Big Bang Theory), thi
|
||||
|
||||
Principles are generally more likely to be guidelines relating to design.
|
||||
|
||||
### All Models Are Wrong (George Box's Law)
|
||||
|
||||
[All Models Are Wrong](https://en.wikipedia.org/wiki/All_models_are_wrong)
|
||||
|
||||
> All models are wrong, but some are useful.
|
||||
>
|
||||
> _George Box_
|
||||
|
||||
This principle suggests that all models of systems are flawed, but that as long as they are not _too_ flawed they may be useful. This principle has its roots in statistics but applies to scientific and computing models as well.
|
||||
|
||||
A fundamental requirement of most software is to model a system of some kind. Regardless of whether the system being modeled is a computer network, a library, a graph of social connections or any other kind of system, the designer will have to decide an appropriate level of detail to model. Excessive detail may lead to too much complexity, too little detail may prevent the model from being functional.
|
||||
|
||||
See also:
|
||||
|
||||
- [The Law of Leaky Abstractions](#the-law-of-leaky-abstractions)
|
||||
|
||||
### Chesterton's Fence
|
||||
|
||||
[Chesterton's Fence on Wikipedia](https://en.wikipedia.org/wiki/Wikipedia:Chesterton%27s_fence)
|
||||
|
||||
> Reforms should not be made until the reasoning behind the existing state of affairs is understood.
|
||||
|
||||
This principle is relevant in software engineering when removing technical debt. Each line of a program was originally written by someone for some reason. Chesterton's Fence suggests that one should try to understand the context and meaning of the code fully, before changing or removing it, even if at first glance it seems redundant or incorrect.
|
||||
|
||||
The name of this principle comes from a story by [G.K. Chesterton](https://en.wikipedia.org/wiki/G._K._Chesterton). A man comes across a fence crossing the middle of the road. He complains to the mayor that this useless fence is getting in the way, and asks to remove it. The mayor asks why the fence is there in the first place. When the man says he doesn't know, the mayor says, "If you don't know its purpose, I certainly won't let you remove it. Go and find out the use of it, and then I may let you destroy it."
|
||||
|
||||
### The Dead Sea Effect
|
||||
|
||||
[The Dead Sea Effect on Bruce F. Webster](http://brucefwebster.com/2008/04/11/the-wetware-crisis-the-dead-sea-effect/)
|
||||
@@ -618,7 +813,6 @@ The "Dead Sea Effect" suggests that in any organisation, the skills/talent/effic
|
||||
|
||||
Typically, highly skilled engineers find it easy to gain employment elsewhere and are the first to do so. Engineers who have obsolete or weak skills will tend to remain with the company, as finding employment elsewhere is difficult. This is particularly pronounced if they have gained incremental pay rises over their time in the company, as it can be challenging to get equivalent remuneration elsewhere.
|
||||
|
||||
|
||||
### The Dilbert Principle
|
||||
|
||||
[The Dilbert Principle on Wikipedia](https://en.wikipedia.org/wiki/Dilbert_principle)
|
||||
@@ -656,6 +850,25 @@ Real-world examples:
|
||||
|
||||
- In 2002 Microsoft reported that by fixing the top 20% of the most-reported bugs, 80% of the related errors and crashes in windows and office would become eliminated ([Reference](https://www.crn.com/news/security/18821726/microsofts-ceo-80-20-rule-applies-to-bugs-not-just-features.htm)).
|
||||
|
||||
### The Shirky Principle
|
||||
|
||||
[The Shirky Principle explained](https://kk.org/thetechnium/the-shirky-prin/)
|
||||
|
||||
> Institutions will try to preserve the problem to which they are the solution.
|
||||
>
|
||||
> _Clay Shirky_
|
||||
|
||||
The Shirky Principle suggests that complex solutions - a company, an industry, or a technology - can become so focused on the problem that they are solving, that they can inadvertently perpetuate the problem itself. This may be deliberate (a company striving to find new nuances to a problem which justify continued development of a solution), or inadvertent (being unable or unwilling to accept or build a solution which solves the problem completely or obviates it).
|
||||
|
||||
Related to:
|
||||
|
||||
- Upton Sinclair's famous line, _"It is difficult to get a man to understand something, when his salary depends upon his not understanding it!"_
|
||||
- Clay Christensen's _The Innovator's Dilemma_
|
||||
|
||||
See also:
|
||||
|
||||
- [Pareto Principle](#the-pareto-principle-the-8020-rule)
|
||||
|
||||
### The Peter Principle
|
||||
|
||||
[The Peter Principle on Wikipedia](https://en.wikipedia.org/wiki/Peter_principle)
|
||||
@@ -666,7 +879,7 @@ Real-world examples:
|
||||
|
||||
A management concept developed by Laurence J. Peter, the Peter Principle observes that people who are good at their jobs are promoted, until they reach a level where they are no longer successful (their "level of incompetence"). At this point, as they are more senior, they are less likely to be removed from the organisation (unless they perform spectacularly badly) and will continue to reside in a role which they have few intrinsic skills at, as their original skills which made them successful are not necessarily the skills required for their new jobs.
|
||||
|
||||
This is of particular interest to engineers - who initially start out in deeply technical roles, but often have a career path which leads to _managing_ other engineers - which requires a fundamentally different skills-set.
|
||||
This is of particular interest to engineers - who initially start out in deeply technical roles, but often have a career path which leads to _managing_ other engineers - which requires a fundamentally different skill set.
|
||||
|
||||
See Also:
|
||||
|
||||
@@ -689,7 +902,6 @@ See Also:
|
||||
|
||||
- [Hyrum's Law](#hyrums-law-the-law-of-implicit-interfaces)
|
||||
|
||||
|
||||
### SOLID
|
||||
|
||||
This is an acronym, which refers to:
|
||||
@@ -710,7 +922,7 @@ These are key principles in [Object-Oriented Programming](#todo). Design princip
|
||||
|
||||
The first of the '[SOLID](#solid)' principles. This principle suggests that modules or classes should do one thing and one thing only. In more practical terms, this means that a single, small change to a feature of a program should require a change in one component only. For example, changing how a password is validated for complexity should require a change in only one part of the program.
|
||||
|
||||
Theoretically, this should make the code more robust, and easier to change. Knowing that a component which is being changed has a single responsibility only means that _testing_ that change should be easier. Using the earlier example, changing the password complexity component should only be able to affect the features which relate to password complexity. It can be much more difficult to reason about the impact of a change to a component which has many responsibilities.
|
||||
Theoretically, this should make the code more robust, and easier to change. Knowing that a component being changed has a single responsibility only means that _testing_ that change should be easier. Using the earlier example, changing the password complexity component should only be able to affect the features which relate to password complexity. It can be much more difficult to reason about the impact of a change to a component which has many responsibilities.
|
||||
|
||||
See also:
|
||||
|
||||
@@ -742,7 +954,7 @@ See also:
|
||||
|
||||
The third of the '[SOLID](#solid)' principles. This principle states that if a component relies on a type, then it should be able to use subtypes of that type, without the system failing or having to know the details of what that subtype is.
|
||||
|
||||
As an example, imagine we have a method which reads an XML document from a structure which represents a file. If the method uses a base type 'file', then anything which derives from 'file' should be able to be used in the function. If 'file' supports seeking in reverse, and the XML parser uses that function, but the derived type 'network file' fails when reverse seeking is attempted, then the 'network file' would be violating the principle.
|
||||
As an example, imagine we have a method which reads an XML document from a structure which represents a file. If the method uses a base type 'file', then anything which derives from 'file' should be usable in the function. If 'file' supports seeking in reverse, and the XML parser uses that function, but the derived type 'network file' fails when reverse seeking is attempted, then the 'network file' would be violating the principle.
|
||||
|
||||
This principle has particular relevance for object-oriented programming, where type hierarchies must be modeled carefully to avoid confusing users of a system.
|
||||
|
||||
@@ -776,7 +988,7 @@ See also:
|
||||
|
||||
> High-level modules should not be dependent on low-level implementations.
|
||||
|
||||
The fifth of the '[SOLID](#solid)' principles. This principle states that higher level orchestrating components should not have to know the details of their dependencies.
|
||||
The fifth of the '[SOLID](#solid)' principles. This principle states that higher-level orchestrating components should not have to know the details of their dependencies.
|
||||
|
||||
As an example, imagine we have a program which read metadata from a website. We would assume that the main component would have to know about a component to download the webpage content, then a component which can read the metadata. If we were to take dependency inversion into account, the main component would depend only on an abstract component which can fetch byte data, and then an abstract component which would be able to read metadata from a byte stream. The main component would not know about TCP/IP, HTTP, HTML, etc.
|
||||
|
||||
@@ -795,7 +1007,7 @@ See also:
|
||||
|
||||
> Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
|
||||
|
||||
DRY is an acronym for _Don't Repeat Yourself_. This principle aims to help developers reducing the repetition of code and keep the information in a single place and was cited in 1999 by Andrew Hunt and Dave Thomas in the book [The Pragmatic Developer](https://en.wikipedia.org/wiki/The_Pragmatic_Programmer)
|
||||
DRY is an acronym for _Don't Repeat Yourself_. This principle aims to help developers reducing the repetition of code and keep the information in a single place and was cited in 1999 by Andrew Hunt and Dave Thomas in the book [The Pragmatic Programmer](https://en.wikipedia.org/wiki/The_Pragmatic_Programmer)
|
||||
|
||||
> The opposite of DRY would be _WET_ (Write Everything Twice or We Enjoy Typing).
|
||||
|
||||
@@ -803,7 +1015,7 @@ In practice, if you have the same piece of information in two (or more) differen
|
||||
|
||||
See also:
|
||||
|
||||
- [The Pragmatic Developer](https://en.wikipedia.org/wiki/The_Pragmatic_Programmer)
|
||||
- [The Pragmatic Programmer](https://en.wikipedia.org/wiki/The_Pragmatic_Programmer)
|
||||
|
||||
### The KISS principle
|
||||
|
||||
@@ -854,7 +1066,7 @@ Also known as _Fallacies of Networked Computing_, the Fallacies are a list of co
|
||||
|
||||
The first four items were listed by [Bill Joy](https://en.wikipedia.org/wiki/Bill_Joy) and [Tom Lyon](https://twitter.com/aka_pugs) around 1991 and first classified by [James Gosling](https://en.wikipedia.org/wiki/James_Gosling) as the "Fallacies of Networked Computing". [L. Peter Deutsch](https://en.wikipedia.org/wiki/L._Peter_Deutsch) added the 5th, 6th and 7th fallacies. In the late 90's Gosling added the 8th fallacy.
|
||||
|
||||
The group were inspired by what was happening at the time inside [Sun Microsystems](https://en.wikipedia.org/wiki/Sun_Microsystems).
|
||||
The group was inspired by what was happening at the time inside [Sun Microsystems](https://en.wikipedia.org/wiki/Sun_Microsystems).
|
||||
|
||||
These fallacies should be considered carefully when designing code which is resilient; assuming any of these fallacies can lead to flawed logic which fails to deal with the realities and complexities of distributed systems.
|
||||
|
||||
@@ -862,24 +1074,61 @@ See also:
|
||||
|
||||
- [Foraging for the Fallacies of Distributed Computing (Part 1) - Vaidehi Joshi
|
||||
on Medium](https://medium.com/baseds/foraging-for-the-fallacies-of-distributed-computing-part-1-1b35c3b85b53)
|
||||
- [Deutsch's Fallacies, 10 Years After](http://java.sys-con.com/node/38665)
|
||||
|
||||
### The Principle of Least Astonishment
|
||||
|
||||
[The Principle of Least Astonishment on Wikipedia](https://en.wikipedia.org/wiki/Principle_of_least_astonishment)
|
||||
|
||||
> People are part of the system. The design should match the user's experience, expectations, and mental models.
|
||||
>
|
||||
> Frans Kaashoek
|
||||
|
||||
This principle proposes that systems and interfaces should be designed in a way that features and functionality is easily discovered and matches users expectations. Features that 'surprise' users should be discouraged in favour of features that can be intuitively reasoned about based on existing patterns and practices.
|
||||
|
||||
Many examples are present in user interfaces, such as a 'pull down' gesture on a mobile appliation to refresh content. Another example would be command line tools, where many standards exist for how parameters are named, common parameters that should be available and so on.
|
||||
|
||||
See also:
|
||||
|
||||
- [Convention Over Configuration](#todo)
|
||||
|
||||
## Reading List
|
||||
|
||||
If you have found these concepts interesting, you may enjoy the following books.
|
||||
|
||||
- [Clean Code - Robert C. Martin](https://www.goodreads.com/book/show/3735293-clean-code) - One of the most well respected books on how to write clean, maintainable code.
|
||||
- [Extreme Programming Installed - Ron Jeffries, Ann Anderson, Chet Hendrikson](https://www.goodreads.com/en/book/show/67834) - Covers the core principles of Extreme Programming.
|
||||
- [The Mythical Man Month - Frederick P. Brooks Jr.](https://www.goodreads.com/book/show/13629.The_Mythical_Man_Month) - A classic volume on software engineering. [Brooks' Law](#brooks-law) is a central theme of the book.
|
||||
- [Gödel, Escher, Bach: An Eternal Golden Braid - Douglas R. Hofstadter.](https://www.goodreads.com/book/show/24113.G_del_Escher_Bach) - This book is difficult to classify. [Hofstadter's Law](#hofstadters-law) is from the book.
|
||||
- [Structure and Interpretation of Computer Programs - Harold Abelson, Gerald Jay Sussman, Julie Sussman](https://www.goodreads.com/book/show/43713) - If you were a comp sci or electical engineering student at MIT or Cambridge this was your intro to programming. Widely reported as being a turning point in people's lives.
|
||||
- [The Cathedral and the Bazaar - Eric S. Raymond](https://en.wikipedia.org/wiki/The_Cathedral_and_the_Bazaar) - a collection of essays on open source. This book was the source of [Linus's Law](#linuss-law).
|
||||
- [The Dilbert Principle - Scott Adams](https://www.goodreads.com/book/show/85574.The_Dilbert_Principle) - A comic look at corporate America, from the author who created the [Dilbert Principle](#the-dilbert-principle).
|
||||
- [The Mythical Man Month - Frederick P. Brooks Jr.](https://www.goodreads.com/book/show/13629.The_Mythical_Man_Month) - A classic volume on software engineering. [Brooks' Law](#brooks-law) is a central theme of the book.
|
||||
- [The Peter Principle - Lawrence J. Peter](https://www.goodreads.com/book/show/890728.The_Peter_Principle) - Another comic look at the challenges of larger organisations and people management, the source of [The Peter Principle](#the-peter-principle).
|
||||
|
||||
## Online Resources
|
||||
|
||||
Some useful resources and reading.
|
||||
|
||||
- [CB Insights: 8 Laws Driving Success In Tech: Amazon's 2-Pizza Rule, The 80/20 Principle, & More](https://www.cbinsights.com/research/report/tech-laws-success-failure) - an interesting write up of some laws which have been highly influential in technology.
|
||||
|
||||
## PDF eBook
|
||||
|
||||
The project is available as a PDF eBook, [download the latest PDF eBook with this link](https://github.com/dwmkerr/hacker-laws/releases/latest/download/hacker-laws.pdf) or check the [release](https://github.com/dwmkerr/hacker-laws/releases) page for older versions.
|
||||
|
||||
A new version of the eBook is created automatically when a new version tag is pushed.
|
||||
|
||||
## Podcast
|
||||
|
||||
Hacker Laws has been featured in [The Changelog](https://changelog.com/podcast/403), you can check out the Podcast episode with the link below:
|
||||
|
||||
<a href="https://changelog.com/podcast/403" target="_blank"><img src="./images/changelog-podcast.png" width="800px" alt="Changelog Podcast Image" /></a>
|
||||
|
||||
## Translations
|
||||
|
||||
Thanks to a number of wonderful contributors, Hacker Laws is available in a number of languages. Please consider sponsoring moderators!
|
||||
|
||||
| Language | Moderator | Status |
|
||||
|----------|-----------|--------|
|
||||
| [AR Arabic / Arabic](./translations/ar-AR.md) | [Abdurrahman Rajab - a0m0rajab](https://github.com/a0m0rajab) | . |
|
||||
| [🇮🇩 Bahasa Indonesia / Indonesian](./translations/pt-BR.md) | [arywidiantara](https://github.com/arywidiantara) | [](https://gitlocalize.com/repo/2513/id?utm_source=badge) |
|
||||
| [🇧🇷 Brasileiro / Brazilian](./translations/pt-BR.md) | [Eugênio Moreira](https://github.com/eugenioamn), [Leonardo Costa](https://github.com/leofc97) | [](https://gitlocalize.com/repo/2513/pt-BR?utm_source=badge) |
|
||||
| [🇨🇳 中文 / Chinese](https://github.com/nusr/hacker-laws-zh) | [Steve Xu](https://github.com/nusr) | Partially complete |
|
||||
@@ -890,16 +1139,21 @@ Thanks to a number of wonderful contributors, Hacker Laws is available in a numb
|
||||
| [🇯🇵 JP 日本語 / Japanese](./translations/jp.md) | [Fumikazu Fujiwara](https://github.com/freddiefujiwara)| [](https://gitlocalize.com/repo/2513/ja?utm_source=badge) |
|
||||
| [🇰🇷 한국어 / Korean](https://github.com/codeanddonuts/hacker-laws-kr) | [Doughnut](https://github.com/codeanddonuts) | Partially complete |
|
||||
| [🇱🇻 Latviešu Valoda / Latvian](./translations/lv.md) | [Arturs Jansons](https://github.com/iegik) | [](https://gitlocalize.com/repo/2513/lv?utm_source=badge) |
|
||||
| [🇮🇷 فارسی / Persian](./translations/fa.md) | [MohammadErfan Gooneh](https://github.com/MEgooneh) | . |
|
||||
| [🇵🇱 Polski / Polish](./translations/pl.md) | [Mariusz Kogen](https://github.com/k0gen) | [](https://gitlocalize.com/repo/2513/pl?utm_source=badge) |
|
||||
| [🇷🇺 Русская версия / Russian](https://github.com/solarrust/hacker-laws) | [Alena Batitskaya](https://github.com/solarrust) | Partially complete |
|
||||
| [🇪🇸 Castellano / Spanish](./translations/es-ES.md) | [Manuel Rubio](https://github.com/manuel-rubio) ([Sponsor](https://github.com/sponsors/manuel-rubio)) | Partially complete |
|
||||
| [🇹🇷 Türkçe / Turkish](https://github.com/umutphp/hacker-laws-tr) | [Umut Işık](https://github.com/umutphp) | [](https://gitlocalize.com/repo/2513/tr?utm_source=badge) |
|
||||
| [🇺🇦 українська мова / Ukrainian](./translations/uk.md) | [Nazar](https://github.com/troyane), [Helga Lastivka](https://github.com/HelgaLastivka) | [](https://gitlocalize.com/repo/2513/uk?utm_source=badge) |
|
||||
| [🇻🇳 Tiếng Việt / Vietnamese](./translations/vu.md) | [Nguyên](https://github.com/truonghoangnguyen), [Trương Hoàng](https://github.com/truonghoangnguyen) | [](https://gitlocalize.com/repo/2513/vi?utm_source=badge) |
|
||||
|
||||
If you would like to update a translation, just [open a pull request](https://github.com/dwmkerr/hacker-laws/pulls). If you want to add a new language, log onto [GitLocalize](https://gitlocalize.com/) to create an account, then open an issue asking to administer the language and I will add you to the project! It would also be super helpful if you can open a pull request which updates the table above and link at the top of the file.
|
||||
If you would like to update a translation, follow the [Translators Contributor Guide](https://github.com/dwmkerr/hacker-laws/blob/main/.github/contributing.md#translations).
|
||||
|
||||
## Related Projects
|
||||
|
||||
- [Tip of the Day](https://tips.darekkay.com/html/hacker-laws-en.html) - Receive a daily hacker law/principle.
|
||||
- [Hacker Laws CLI](https://github.com/umutphp/hacker-laws-cli) - List, view and see random laws from the terminal!
|
||||
- [Hacker Laws Action](https://github.com/marketplace/actions/hacker-laws-action) - Adds a random Hacker Law to a pull request as a small gift for the contributor, thanks [Umut Işık](https://github.com/umutphp)
|
||||
|
||||
## Contributing
|
||||
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Requirements:
|
||||
# - pandoc
|
||||
# - xelatex
|
||||
# brew install
|
||||
# brew cask install basictex
|
||||
|
||||
# Create the frontmatter.
|
||||
cat << EOF > frontmatter.md
|
||||
---
|
||||
title: "Hacker Laws"
|
||||
author: "Dave Kerr, github.com/dwmkerr/hacker-laws"
|
||||
subtitle: "Laws, Theories, Principles and Patterns that developers will find useful."
|
||||
---
|
||||
EOF
|
||||
|
||||
# Combine the frontmatter and the laws.
|
||||
cat frontmatter.md README.md >> hacker-laws.md
|
||||
|
||||
# Remove the title - we have it in the front-matter of the doc, so it will
|
||||
# automatically be added to the PDF.
|
||||
sed -i '' '/💻📖.*/d' hacker-laws.md
|
||||
|
||||
# We can't have emojis in the final content with the PDF generator we're using.
|
||||
sed -i '' 's/❗/Warning/' hacker-laws.md
|
||||
|
||||
# Now rip out the translations line.
|
||||
sed -i '' '/^\[Translations.*/d' hacker-laws.md
|
||||
|
||||
# # Now rip out any table of contents items.
|
||||
sed -i '' '/\*.*/d' hacker-laws.md
|
||||
sed -i '' '/ \*.*/d' hacker-laws.md
|
||||
|
||||
# Delete everything from 'Translations' onwards (we don't need the translations
|
||||
# lists, related projects, etc).
|
||||
sed -i ' ' '/## Translations/,$d' hacker-laws.md
|
||||
|
||||
# Now build the e-book as a PDF.
|
||||
pandoc -V toc-title:"Table Of Contents" --toc --pdf-engine=pdflatex -s -o hacker-laws.pdf hacker-laws.md
|
||||
@@ -1,42 +1,363 @@
|
||||
<svg width="640" height="480" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
width="640"
|
||||
height="480"
|
||||
version="1.1"
|
||||
id="svg195"
|
||||
sodipodi:docname="Fitts_Law.svg"
|
||||
inkscape:version="1.1 (c68e22c387, 2021-05-23)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<defs
|
||||
id="defs199" />
|
||||
<sodipodi:namedview
|
||||
id="namedview197"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
showgrid="false"
|
||||
inkscape:zoom="1.2197592"
|
||||
inkscape:cx="253.73861"
|
||||
inkscape:cy="240.21135"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1043"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="layer2" />
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer2"
|
||||
inkscape:label="Layer 2"
|
||||
style="display:inline">
|
||||
<rect
|
||||
style="fill:#ffffff;stroke-width:0"
|
||||
id="rect557"
|
||||
width="100%"
|
||||
height="100%"
|
||||
x="0"
|
||||
y="0" />
|
||||
</g>
|
||||
<!-- Created with SVG-edit - http://svg-edit.googlecode.com/ -->
|
||||
|
||||
<g>
|
||||
<title>Layer 1</title>
|
||||
<g id="svg_14" transform="rotate(38.2092, 97, 276.029)">
|
||||
<line stroke-linecap="round" id="svg_10" y2="276" x2="92" y1="301" x1="92.000002" stroke-width="4" stroke="#000000" fill="none"/>
|
||||
<line stroke-linecap="round" id="svg_7" y2="281" x2="112" y1="276" x1="102" stroke-width="4" stroke="#000000" fill="none"/>
|
||||
<line id="svg_8" stroke-linecap="round" y2="276" x2="102" y1="301.058297" x1="102" stroke-width="4" stroke="#000000" fill="none"/>
|
||||
<line id="svg_11" stroke-linecap="round" y2="276" x2="92" y1="281" x1="82" stroke-width="4" stroke="#000000" fill="none"/>
|
||||
<line id="svg_12" y2="251" x2="97" y1="281" x1="82" stroke-linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="4" stroke="#000000" fill="none"/>
|
||||
<line id="svg_13" y2="251" x2="97" y1="281" x1="112" stroke-linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="4" stroke="#000000" fill="none"/>
|
||||
<g
|
||||
id="g193">
|
||||
<title
|
||||
id="title161">Layer 1</title>
|
||||
<g
|
||||
id="svg_14"
|
||||
transform="rotate(38.2092, 97, 276.029)">
|
||||
<line
|
||||
stroke-linecap="round"
|
||||
id="svg_10"
|
||||
y2="276"
|
||||
x2="92"
|
||||
y1="301"
|
||||
x1="92.000002"
|
||||
stroke-width="4"
|
||||
stroke="#000000"
|
||||
fill="none" />
|
||||
<line
|
||||
stroke-linecap="round"
|
||||
id="svg_7"
|
||||
y2="281"
|
||||
x2="112"
|
||||
y1="276"
|
||||
x1="102"
|
||||
stroke-width="4"
|
||||
stroke="#000000"
|
||||
fill="none" />
|
||||
<line
|
||||
id="svg_8"
|
||||
stroke-linecap="round"
|
||||
y2="276"
|
||||
x2="102"
|
||||
y1="301.058297"
|
||||
x1="102"
|
||||
stroke-width="4"
|
||||
stroke="#000000"
|
||||
fill="none" />
|
||||
<line
|
||||
id="svg_11"
|
||||
stroke-linecap="round"
|
||||
y2="276"
|
||||
x2="92"
|
||||
y1="281"
|
||||
x1="82"
|
||||
stroke-width="4"
|
||||
stroke="#000000"
|
||||
fill="none" />
|
||||
<line
|
||||
id="svg_12"
|
||||
y2="251"
|
||||
x2="97"
|
||||
y1="281"
|
||||
x1="82"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="null"
|
||||
stroke-dasharray="null"
|
||||
stroke-width="4"
|
||||
stroke="#000000"
|
||||
fill="none" />
|
||||
<line
|
||||
id="svg_13"
|
||||
y2="251"
|
||||
x2="97"
|
||||
y1="281"
|
||||
x1="112"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="null"
|
||||
stroke-dasharray="null"
|
||||
stroke-width="4"
|
||||
stroke="#000000"
|
||||
fill="none" />
|
||||
</g>
|
||||
<g id="svg_16">
|
||||
<line fill="none" stroke="#7f7f7f" stroke-width="2" stroke-linejoin="round" stroke-linecap="round" x1="570" y1="135" x2="420" y2="135" id="svg_1" stroke-dasharray="5,5"/>
|
||||
<line fill="none" stroke="#7f7f7f" stroke-width="2" stroke-linejoin="round" stroke-linecap="round" x1="495" y1="210" x2="495" y2="60" id="svg_4" stroke-dasharray="5,5"/>
|
||||
<rect fill="none" stroke="#000000" stroke-width="5" stroke-linejoin="round" stroke-linecap="round" x="445" y="85" width="100" height="100" id="svg_2"/>
|
||||
<text fill="#000000" stroke="#000000" stroke-width="0" stroke-dasharray="null" stroke-linejoin="round" stroke-linecap="round" x="495.91669" y="118.66669" id="svg_3" font-size="24" font-family="Sans-serif" text-anchor="middle" xml:space="preserve" font-weight="bold">Target</text>
|
||||
<g
|
||||
id="svg_16">
|
||||
<line
|
||||
fill="none"
|
||||
stroke="#7f7f7f"
|
||||
stroke-width="2"
|
||||
stroke-linejoin="round"
|
||||
stroke-linecap="round"
|
||||
x1="570"
|
||||
y1="135"
|
||||
x2="420"
|
||||
y2="135"
|
||||
id="svg_1"
|
||||
stroke-dasharray="5,5" />
|
||||
<line
|
||||
fill="none"
|
||||
stroke="#7f7f7f"
|
||||
stroke-width="2"
|
||||
stroke-linejoin="round"
|
||||
stroke-linecap="round"
|
||||
x1="495"
|
||||
y1="210"
|
||||
x2="495"
|
||||
y2="60"
|
||||
id="svg_4"
|
||||
stroke-dasharray="5,5" />
|
||||
<rect
|
||||
fill="none"
|
||||
stroke="#000000"
|
||||
stroke-width="5"
|
||||
stroke-linejoin="round"
|
||||
stroke-linecap="round"
|
||||
x="445"
|
||||
y="85"
|
||||
width="100"
|
||||
height="100"
|
||||
id="svg_2" />
|
||||
<text
|
||||
fill="#000000"
|
||||
stroke="#000000"
|
||||
stroke-width="0"
|
||||
stroke-dasharray="null"
|
||||
stroke-linejoin="round"
|
||||
stroke-linecap="round"
|
||||
x="495.91669"
|
||||
y="118.66669"
|
||||
id="svg_3"
|
||||
font-size="24"
|
||||
font-family="Sans-serif"
|
||||
text-anchor="middle"
|
||||
xml:space="preserve"
|
||||
font-weight="bold">Target</text>
|
||||
</g>
|
||||
<text font-weight="bold" xml:space="preserve" text-anchor="middle" font-family="Sans-serif" font-size="24" id="svg_5" y="35" x="494" stroke-linecap="round" stroke-linejoin="null" stroke-dasharray="5,5" stroke-width="0" stroke="#7f7f7f" fill="#000000">W</text>
|
||||
<g id="svg_21">
|
||||
<line fill="none" stroke="#000000" stroke-width="3" stroke-linejoin="null" stroke-linecap="round" x1="445" y1="45" x2="545" y2="45" id="svg_9"/>
|
||||
<line id="svg_17" y2="55" x2="455" y1="45" x1="445" stroke-linecap="round" stroke-linejoin="null" stroke-width="3" stroke="#000000" fill="none"/>
|
||||
<line id="svg_18" y2="35" x2="455" y1="45" x1="445" stroke-linecap="round" stroke-linejoin="null" stroke-width="3" stroke="#000000" fill="none"/>
|
||||
<line id="svg_19" y2="55" x2="535" y1="45" x1="545" stroke-linecap="round" stroke-linejoin="null" stroke-width="3" stroke="#000000" fill="none"/>
|
||||
<line id="svg_20" y2="35" x2="535" y1="45" x1="545" stroke-linecap="round" stroke-linejoin="null" stroke-width="3" stroke="#000000" fill="none"/>
|
||||
<text
|
||||
font-weight="bold"
|
||||
xml:space="preserve"
|
||||
text-anchor="middle"
|
||||
font-family="Sans-serif"
|
||||
font-size="24"
|
||||
id="svg_5"
|
||||
y="35"
|
||||
x="494"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="null"
|
||||
stroke-dasharray="5,5"
|
||||
stroke-width="0"
|
||||
stroke="#7f7f7f"
|
||||
fill="#000000">W</text>
|
||||
<g
|
||||
id="svg_21">
|
||||
<line
|
||||
fill="none"
|
||||
stroke="#000000"
|
||||
stroke-width="3"
|
||||
stroke-linejoin="null"
|
||||
stroke-linecap="round"
|
||||
x1="445"
|
||||
y1="45"
|
||||
x2="545"
|
||||
y2="45"
|
||||
id="svg_9" />
|
||||
<line
|
||||
id="svg_17"
|
||||
y2="55"
|
||||
x2="455"
|
||||
y1="45"
|
||||
x1="445"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="null"
|
||||
stroke-width="3"
|
||||
stroke="#000000"
|
||||
fill="none" />
|
||||
<line
|
||||
id="svg_18"
|
||||
y2="35"
|
||||
x2="455"
|
||||
y1="45"
|
||||
x1="445"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="null"
|
||||
stroke-width="3"
|
||||
stroke="#000000"
|
||||
fill="none" />
|
||||
<line
|
||||
id="svg_19"
|
||||
y2="55"
|
||||
x2="535"
|
||||
y1="45"
|
||||
x1="545"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="null"
|
||||
stroke-width="3"
|
||||
stroke="#000000"
|
||||
fill="none" />
|
||||
<line
|
||||
id="svg_20"
|
||||
y2="35"
|
||||
x2="535"
|
||||
y1="45"
|
||||
x1="545"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="null"
|
||||
stroke-width="3"
|
||||
stroke="#000000"
|
||||
fill="none" />
|
||||
</g>
|
||||
<g id="svg_37" transform="rotate(-17.3352, 328.667, 273.333)">
|
||||
<line fill="none" stroke="#7f7f7f" stroke-width="2" stroke-dasharray="5,5" stroke-linejoin="null" stroke-linecap="round" x1="128.666668" y1="191.333333" x2="528.666668" y2="191.333333" id="svg_6"/>
|
||||
<text id="svg_15" font-weight="bold" xml:space="preserve" text-anchor="middle" font-family="Sans-serif" font-size="24" y="349.333338" x="327.000016" stroke-linecap="round" stroke-linejoin="null" stroke-dasharray="5,5" stroke-width="0" stroke="#7f7f7f" fill="#000000">D</text>
|
||||
<g id="svg_34">
|
||||
<line fill="none" stroke="#000000" stroke-width="3" stroke-linejoin="null" stroke-linecap="round" x1="128.666668" y1="316.000005" x2="528.666668" y2="316.000005" id="svg_29"/>
|
||||
<line y2="326.000005" x2="138.666668" y1="316.000005" x1="128.666668" stroke-linecap="round" stroke-linejoin="null" stroke-width="3" stroke="#000000" fill="none" id="svg_30"/>
|
||||
<line y2="306.000005" x2="138.666668" y1="316.000005" x1="128.666668" stroke-linecap="round" stroke-linejoin="null" stroke-width="3" stroke="#000000" fill="none" id="svg_31"/>
|
||||
<line y2="326.000005" x2="518.666668" y1="316.000005" x1="528.666668" stroke-linecap="round" stroke-linejoin="null" stroke-width="3" stroke="#000000" fill="none" id="svg_32"/>
|
||||
<line y2="306.000005" x2="518.666668" y1="316.000005" x1="528.666668" stroke-linecap="round" stroke-linejoin="null" stroke-width="3" stroke="#000000" fill="none" id="svg_33"/>
|
||||
<g
|
||||
id="svg_37"
|
||||
transform="rotate(-17.3352, 328.667, 273.333)">
|
||||
<line
|
||||
fill="none"
|
||||
stroke="#7f7f7f"
|
||||
stroke-width="2"
|
||||
stroke-dasharray="5,5"
|
||||
stroke-linejoin="null"
|
||||
stroke-linecap="round"
|
||||
x1="128.666668"
|
||||
y1="191.333333"
|
||||
x2="528.666668"
|
||||
y2="191.333333"
|
||||
id="svg_6" />
|
||||
<text
|
||||
id="svg_15"
|
||||
font-weight="bold"
|
||||
xml:space="preserve"
|
||||
text-anchor="middle"
|
||||
font-family="Sans-serif"
|
||||
font-size="24"
|
||||
y="349.333338"
|
||||
x="327.000016"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="null"
|
||||
stroke-dasharray="5,5"
|
||||
stroke-width="0"
|
||||
stroke="#7f7f7f"
|
||||
fill="#000000">D</text>
|
||||
<g
|
||||
id="svg_34">
|
||||
<line
|
||||
fill="none"
|
||||
stroke="#000000"
|
||||
stroke-width="3"
|
||||
stroke-linejoin="null"
|
||||
stroke-linecap="round"
|
||||
x1="128.666668"
|
||||
y1="316.000005"
|
||||
x2="528.666668"
|
||||
y2="316.000005"
|
||||
id="svg_29" />
|
||||
<line
|
||||
y2="326.000005"
|
||||
x2="138.666668"
|
||||
y1="316.000005"
|
||||
x1="128.666668"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="null"
|
||||
stroke-width="3"
|
||||
stroke="#000000"
|
||||
fill="none"
|
||||
id="svg_30" />
|
||||
<line
|
||||
y2="306.000005"
|
||||
x2="138.666668"
|
||||
y1="316.000005"
|
||||
x1="128.666668"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="null"
|
||||
stroke-width="3"
|
||||
stroke="#000000"
|
||||
fill="none"
|
||||
id="svg_31" />
|
||||
<line
|
||||
y2="326.000005"
|
||||
x2="518.666668"
|
||||
y1="316.000005"
|
||||
x1="528.666668"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="null"
|
||||
stroke-width="3"
|
||||
stroke="#000000"
|
||||
fill="none"
|
||||
id="svg_32" />
|
||||
<line
|
||||
y2="306.000005"
|
||||
x2="518.666668"
|
||||
y1="316.000005"
|
||||
x1="528.666668"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="null"
|
||||
stroke-width="3"
|
||||
stroke="#000000"
|
||||
fill="none"
|
||||
id="svg_33" />
|
||||
</g>
|
||||
<line fill="none" stroke="#7f7f7f" stroke-width="2" stroke-dasharray="5,5" stroke-linejoin="null" stroke-linecap="round" x1="128.666668" y1="191.333333" x2="128.666668" y2="341.333333" id="svg_35"/>
|
||||
<line fill="none" stroke="#7f7f7f" stroke-width="2" stroke-dasharray="5,5" stroke-linejoin="null" stroke-linecap="round" x1="528.666668" y1="191.333333" x2="528.666668" y2="341.333333" id="svg_36"/>
|
||||
<line
|
||||
fill="none"
|
||||
stroke="#7f7f7f"
|
||||
stroke-width="2"
|
||||
stroke-dasharray="5,5"
|
||||
stroke-linejoin="null"
|
||||
stroke-linecap="round"
|
||||
x1="128.666668"
|
||||
y1="191.333333"
|
||||
x2="128.666668"
|
||||
y2="341.333333"
|
||||
id="svg_35" />
|
||||
<line
|
||||
fill="none"
|
||||
stroke="#7f7f7f"
|
||||
stroke-width="2"
|
||||
stroke-dasharray="5,5"
|
||||
stroke-linejoin="null"
|
||||
stroke-linecap="round"
|
||||
x1="528.666668"
|
||||
y1="191.333333"
|
||||
x2="528.666668"
|
||||
y2="341.333333"
|
||||
id="svg_36" />
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
inkscape:label="Layer 1" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 8.6 KiB |
BIN
images/changelog-podcast.png
Normal file
|
After Width: | Height: | Size: 88 KiB |
BIN
images/complete_graph.png
Normal file
|
After Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 96 KiB |
@@ -1,5 +1,6 @@
|
||||
<svg xmlns:xlink="http://www.w3.org/1999/xlink" width="18.644ex" height="2.843ex" style="vertical-align: -0.838ex;" viewBox="0 -863.1 8027.4 1223.9" role="img" focusable="false" xmlns="http://www.w3.org/2000/svg" aria-labelledby="MathJax-SVG-1-Title">
|
||||
<title id="MathJax-SVG-1-Title">{\displaystyle T=b\cdot \log _{2}(n+1)}</title>
|
||||
<rect style="fill:#ffffff" id="rect557" width="100%" height="100%" x="0" y="-863.1" />
|
||||
<defs aria-hidden="true">
|
||||
<path stroke-width="1" id="E1-MJMATHI-54" d="M40 437Q21 437 21 445Q21 450 37 501T71 602L88 651Q93 669 101 677H569H659Q691 677 697 676T704 667Q704 661 687 553T668 444Q668 437 649 437Q640 437 637 437T631 442L629 445Q629 451 635 490T641 551Q641 586 628 604T573 629Q568 630 515 631Q469 631 457 630T439 622Q438 621 368 343T298 60Q298 48 386 46Q418 46 427 45T436 36Q436 31 433 22Q429 4 424 1L422 0Q419 0 415 0Q410 0 363 1T228 2Q99 2 64 0H49Q43 6 43 9T45 27Q49 40 55 46H83H94Q174 46 189 55Q190 56 191 56Q196 59 201 76T241 233Q258 301 269 344Q339 619 339 625Q339 630 310 630H279Q212 630 191 624Q146 614 121 583T67 467Q60 445 57 441T43 437H40Z"></path>
|
||||
<path stroke-width="1" id="E1-MJMAIN-3D" d="M56 347Q56 360 70 367H707Q722 359 722 347Q722 336 708 328L390 327H72Q56 332 56 347ZM56 153Q56 168 72 173H708Q722 163 722 153Q722 140 707 133H70Q56 140 56 153Z"></path>
|
||||
|
||||
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.6 KiB |
32
scripts/prepare-markdown-for-ebook.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
# This script prepares a `hacker-laws.md` file for export to PDF or e-book format.
|
||||
|
||||
# Require a version number and get the current date.
|
||||
version=$1
|
||||
date=$(date "+%Y-%m-%d")
|
||||
|
||||
if [ -z "$version" ]; then
|
||||
echo "Usage: $0 <version>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create `hacker-laws.md` with frontmatter and README content in one step.
|
||||
cat << EOF > hacker-laws.md
|
||||
---
|
||||
title: "Hacker Laws"
|
||||
author: "Dave Kerr, github.com/dwmkerr/hacker-laws"
|
||||
subtitle: "Laws, Theories, Principles, and Patterns that developers will find useful. ${version}, ${date}."
|
||||
---
|
||||
|
||||
EOF
|
||||
cat README.md >> hacker-laws.md
|
||||
|
||||
# Use a single `sed` command to clean up unwanted lines and emojis in one pass.
|
||||
sed -i'' -e '/💻📖.*/d' \
|
||||
-e 's/❗/Warning/g' \
|
||||
-e '/^\[Translations.*/d' \
|
||||
-e '/\*.*/d' \
|
||||
-e '/ \*.*/d' \
|
||||
-e '/## Translations/,$d' hacker-laws.md
|
||||
|
||||
echo "hacker-laws.md prepared successfully."
|
||||
@@ -193,7 +193,7 @@ Souvent aussi énoncée de cette manière :
|
||||
> Lorsqu'une mesure devient un objectif, elle cesse d'être une bonne mesure.
|
||||
> *Marilyn Strathern*
|
||||
|
||||
Cette loi indique que les optimisations basées sur une mesure peuvent amener à une perte de valeur de la mesure elle même. Un ensemble de mesures ([KPIs](https://en.wikipedia.org/wiki/Performance_indicator)) trop restraint appliqué aveuglément à un process déforme le résultat. Les gens tendent à "tricher" localement pour satisfaire une mesure en particulier sans faire attention aux effect globaux de leurs actions sur le système.
|
||||
Cette loi indique que les optimisations basées sur une mesure peuvent amener à une perte de valeur de la mesure elle même. Un ensemble de mesures ([KPIs](https://en.wikipedia.org/wiki/Performance_indicator)) trop restraint appliqué aveuglément à un process déforme le résultat. Les gens tendent à "tricher" localement pour satisfaire une mesure en particulier sans faire attention aux effets globaux de leurs actions sur le système.
|
||||
|
||||
Exemples concrets :
|
||||
|
||||
@@ -244,7 +244,7 @@ Par exemple, un abaissement de la latence de réponse sur une route (end-point)
|
||||
|
||||
[Cycle du hype sur Wikipedia](https://fr.wikipedia.org/wiki/Cycle_du_hype)
|
||||
|
||||
> On a tendance à surestimer l'effet d'une technologie sur le court terme et à le surestimer sur le long terme.
|
||||
> On a tendance à surestimer l'effet d'une technologie sur le court terme et à le sous-estimer sur le long terme.
|
||||
> (Roy Amara)
|
||||
|
||||
Le cycle du hype est une représentation visuelle de l'attrait et du développement d'une technologie au fil du temps. Initialement réalisé par Gartner, le concept est plus clair avec un diagramme :
|
||||
@@ -259,7 +259,7 @@ En clair, ce cycle montre qu'il y a généralement un pic d'excitation concernan
|
||||
|
||||
[Loi d'Hyrum en ligne](http://www.hyrumslaw.com/)
|
||||
|
||||
> > Passé un certain nombre d'utilisateur d'une API, peu importe ce qui est promis par l'interface, tous les comportements possibles du système seront utilisés.
|
||||
> Passé un certain nombre d'utilisateur d'une API, peu importe ce qui est promis par l'interface, tous les comportements possibles du système seront utilisés.
|
||||
> (Hyrum Wright)
|
||||
|
||||
La loi d'Hyrum décris le fait que lorsqu'une API a un *nombre suffisamment élevé d'utilisateurs*, tous les comportements de l'API (y compris ceux qui ne sont pas définis publiquement) seront utilisés par quelqu'un. Un exemple trivial peut concerner les éléments non fonctionnels de l'API comme le temps de réponse. Un exemple plus subtil peut être l'utilisation d'une regex sur les messages d'erreurs pour en déterminer le *type*. Même si la spécification de l'API ne mentionne rien quant au contenu des messages, *certains* utilisateurs peuvent utiliser ces messages. Un changement au niveau de ces messages reviendrait à casser l'API pour ces utilisateurs.
|
||||
@@ -486,7 +486,7 @@ Voir aussi :
|
||||
> Ne soyez pas un connard.
|
||||
> *Wil Wheaton*
|
||||
|
||||
Inventée par Will Wheaton (Star Trek: The Next Generation, The Big Bang Theory), cette loi simple, concise et puissante vise à augmenter l'harmonie et le respect au sein d'un environnement professionnel. Elle peut être appliquée lorsqu'on parle à ses collègues, effectue une code review, argumente contre un autre point de vue, critique et de manière générale, lors de la plupart des interactions entre humains.
|
||||
Inventée par Will Wheaton (Star Trek: The Next Generation, The Big Bang Theory), cette loi simple, concise et puissante vise à augmenter l'harmonie et le respect au sein d'un environnement professionnel. Elle peut être appliquée lorsqu'on parle à ses collègues, effectue une revue de code (*code review*), argumente contre un autre point de vue, critique et de manière générale, lors de la plupart des interactions entre humains.
|
||||
|
||||
## Principes
|
||||
|
||||
@@ -499,7 +499,7 @@ Les principes sont généralement des lignes directrices liés à la conception.
|
||||
> Les entreprises tendent à promouvoir systématiquement les employés incompétents afin de les sortir du workflow.
|
||||
> *Scott Adams*
|
||||
|
||||
Un concept de gestion inventé par Scott Adams (créateur du comic strip Dilbert) inspiré par le [principe de Peter](#principe-de-peter). Suivant le principe de Dilbert, les employés qui n'ont jamais montré de compétence dans leur travail sont promus à des postes de management afin de limité les dommages qu'ils peuvent causer. Adams expliqua initialement le principe dans un article du Wall Street Journal datant de 1995, et élabora le concept dans son livre de 1996: [The Dilbert Principle](#a-lire).
|
||||
Un concept de gestion inventé par Scott Adams (créateur du comic strip Dilbert) inspiré par le [principe de Peter](#principe-de-peter). Suivant le principe de Dilbert, les employés qui n'ont jamais montré de compétence dans leur travail sont promus à des postes de management afin de limiter les dommages qu'ils peuvent causer. Adams expliqua initialement le principe dans un article du Wall Street Journal datant de 1995, et élabora le concept dans son livre de 1996: [The Dilbert Principle](#a-lire).
|
||||
|
||||
Voir aussi :
|
||||
|
||||
@@ -593,7 +593,7 @@ Voir aussi :
|
||||
|
||||
> Les entités devraient être ouvertes à l'extension et fermées à la modification.
|
||||
|
||||
Le deuxième des principes '[SOLID](#solid)'. Il énonce que le comportement des entités (classes, modules, fonctions, etc.) devraient pouvoir être *étendu*, mais que le comportement *existant* ne devrait pas pouvoir être modifié.
|
||||
Le deuxième des principes '[SOLID](#solid)'. Il énonce que le comportement des entités (classes, modules, fonctions, etc.) devrait être *étendu*, mais que le comportement *existant* ne devrait pas être modifié.
|
||||
|
||||
Imaginons par exemple un module capable de changer un document rédigé en Markdown en HTML. Ce module peut être étendu en y ajoutant le support pour une nouvelle fonctionnalité Markdown sans modifier son fonctionnement interne. Le module est en revanche *fermé* à la modification dans le sens où un utilisateur *ne peut pas* changer la manière dont le code existant est rédigé.
|
||||
|
||||
@@ -679,7 +679,7 @@ Voir aussi :
|
||||
|
||||
[KISS sur Wikipedia](https://fr.wikipedia.org/wiki/Principe_KISS)
|
||||
|
||||
> > Keep it simple, stupid. (Ne complique pas les choses)
|
||||
> Keep it simple, stupid. (Ne complique pas les choses)
|
||||
|
||||
Le principe KISS énonce que la plupart des systèmes fonctionnent mieux s'ils sont simples que compliqués. Par conséquent, la simplicité devrait être un but essentiel dans la conception et toute complexité inutile devrait être évité. Provenant de la marine Américaine en 1960, la phrase est attribuée à l'ingénieur Kelly Johnson.
|
||||
|
||||
@@ -700,7 +700,7 @@ Il s'agit d'un acronyme pour ***Y**ou **A**in't **G**onna **N**eed **I**t*. Que
|
||||
|
||||
Ce principe *d'Extreme Programming* (XP) suggère que les développeurs ne devraient implémenter que les fonctionnalités qui sont nécessaires immédiatement et éviter de tenter de prédire l'avenir en implémentant des fonctionnalités qui pourraient être nécessaires plus tard.
|
||||
|
||||
Adhérer à ce principe devrait réduire la quantité de code inutilisé dans la codebase et permettre d'éviter de passer du temps et des efforts sur des fonctionnalités qui n'apportent rien.
|
||||
Adhérer à ce principe devrait réduire la quantité de code inutilisé dans le codebase et permet d'éviter de passer du temps sur des fonctionnalités qui n'apportent rien.
|
||||
|
||||
Voir aussi :
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
- [ハイプサイクルとアマラの法則](#ハイプサイクルとアマラの法則)
|
||||
- [ハイラムの法則(暗黙のインターフェースの法則)](#ハイラムの法則暗黙のインターフェースの法則)
|
||||
- [カーニガンの法則](#カーニガンの法則)
|
||||
- [リーナスの法則](#リーナスの法則)
|
||||
- [メトカーフの法則](#メトカーフの法則)
|
||||
- [ムーアの法則](#ムーアの法則)
|
||||
- [マーフィーの法則/ソッドの法則](#マーフィーの法則ソッドの法則)
|
||||
@@ -136,7 +137,7 @@
|
||||
|
||||
> 遅延しているソフトウェア開発プロジェクトに人材を追加するとプロジェクトがさらに遅延する。
|
||||
|
||||
この法則は、多くの場合、すでに遅れているプロジェクトを挽回させようとして、人的リソースを追加することで、プロジェクトが更に遅延することを示唆しています。ブルックスは、これが単純化しすぎであることを明らかにしていますが、一般的な推論としては、新しい人的リソースの立ち上げにかかる時間とコミュニケーションのオーバーヘッドを考えると、短期的には速度が低下するということです。また、多くのタスクは分割ないことがあり、リソース間で簡単にタスク分散されない可能性があり、期待するベロシティも得られなくなることを意味します。
|
||||
この法則は、多くの場合、すでに遅れているプロジェクトを挽回させようとして、人的リソースを追加することで、プロジェクトが更に遅延することを示唆しています。ブルックスは、これが単純化しすぎであることを明らかにしていますが、一般的な推論としては、新しい人的リソースの立ち上げにかかる時間とコミュニケーションのオーバーヘッドを考えると、短期的には速度が低下するということです。また、多くのタスクは分割出来ないことがあり、リソース間で簡単にタスク分散されない可能性があり、期待するベロシティも得られなくなることを意味します。
|
||||
|
||||
出産でよく言われる「9人の女性は1ヶ月で子作りができない」という言葉は、ブルックスの法則、特にある種のタスクは分割や並列化できないという事実に関連しています。
|
||||
|
||||
@@ -301,6 +302,24 @@
|
||||
- [UNIX哲学](#unix哲学)
|
||||
- [オッカムのかみそり](#オッカムの剃刀)
|
||||
|
||||
### リーナスの法則
|
||||
|
||||
[リーナスの法則-Wikipedia](https://ja.wikipedia.org/wiki/%E3%83%AA%E3%83%BC%E3%83%8A%E3%82%B9%E3%81%AE%E6%B3%95%E5%89%87)
|
||||
|
||||
> 十分な目ん玉があれば、全てのバグは洗い出される。
|
||||
>
|
||||
> _エリック・S・レイモンド_
|
||||
|
||||
この法則は簡単に言うと、あるプログラムを見る人が多ければ多いほど、誰かがその問題を以前に見て解決している可能性が高くなる、あるいはそれに非常に近い状況になる、というものです。
|
||||
|
||||
元々はプロジェクトのオープンソースモデルの価値を説明するために使われましたが、どんなソフトウェアプロジェクトにも当てはまります。プロセスにも拡大して適用できます。より多くのコードレビューや静的解析、また多角的なテストプロセスによって、問題をより可視化されて識別しやすくなります。
|
||||
|
||||
より格式ばって言うと以下のようになります。
|
||||
|
||||
> ベータテスターと共同開発者が十分多くいれば、ほとんど全ての問題はすぐに明確になり、似た問題に以前遭遇したことのある人によって解決されるだろう。
|
||||
|
||||
この法則は、エリック・S・レイモンドの著作『[伽藍とバザール](https://ja.wikipedia.org/wiki/%E4%BC%BD%E8%97%8D%E3%81%A8%E3%83%90%E3%82%B6%E3%83%BC%E3%83%AB)』の中で、[リーナス・トーバルズ](https://ja.wikipedia.org/wiki/%E3%83%AA%E3%83%BC%E3%83%8A%E3%82%B9%E3%83%BB%E3%83%88%E3%83%BC%E3%83%90%E3%83%AB%E3%82%BA)に敬意を表して名付けられました。
|
||||
|
||||
### メトカーフの法則
|
||||
|
||||
[メトカーフの法則-Wikipedia](https://ja.wikipedia.org/wiki/%E3%83%A1%E3%83%88%E3%82%AB%E3%83%BC%E3%83%95%E3%81%AE%E6%B3%95%E5%89%87)
|
||||
@@ -435,7 +454,7 @@ Donald Knuthの論文「 [Structured Programming With Go To Statements」で](ht
|
||||
|
||||
この法則では、複雑なシステムでの作業を簡略化するためにコンピューティングで一般的に使用される抽象化は、特定の状況では、基礎となるシステムの要素を「漏らし」、抽象化が予期しない方法で動作することになると述べています。
|
||||
|
||||
例としては、ファイルをロードしてその内容を読むことが挙げられます。ァイルシステム API は低レベルのカーネルシステムの *抽象化*であり、それ自体が磁気プラッター (または SSD のフラッシュメモリ) 上のデータの変更に関連する物理的なプロセスを抽象化したものです。ほとんどの場合、ファイルをバイナリデータのストリームのように扱うという抽象化が機能します。磁気ドライブの場合、データを連続的に読み込むと、ランダム・アクセスよりも(ページ・フォルトのオーバーヘッドが増加するため)*大幅に*速くなりますが、SSD ドライブの場合は、このオーバーヘッドは存在しません。この場合に対処するためには、基本的な詳細を理解する必要があります(例えば、データベースのインデックスファイルはランダムアクセスのオーバーヘッドを減らすために構造化されています)が、抽象化された実装の詳細は、開発者が注意する必要があるかもしれません。
|
||||
例としては、ファイルをロードしてその内容を読むことが挙げられます。ファイルシステム API は低レベルのカーネルシステムの *抽象化*であり、それ自体が磁気プラッター (または SSD のフラッシュメモリ) 上のデータの変更に関連する物理的なプロセスを抽象化したものです。ほとんどの場合、ファイルをバイナリデータのストリームのように扱うという抽象化が機能します。磁気ドライブの場合、データを連続的に読み込むと、ランダム・アクセスよりも(ページ・フォルトのオーバーヘッドが増加するため)*大幅に*速くなりますが、SSD ドライブの場合は、このオーバーヘッドは存在しません。この場合に対処するためには、基本的な詳細を理解する必要があります(例えば、データベースのインデックスファイルはランダムアクセスのオーバーヘッドを減らすために構造化されています)が、抽象化された実装の詳細は、開発者が注意する必要があるかもしれません。
|
||||
|
||||
上記の例は、より多くの抽象化が導入されると、*より*複雑になる可能性があります。Linux オペレーティングシステムでは、ネットワーク経由でファイルにアクセスすることができますが、ローカルでは「通常の」ファイルとして表現されます。この抽象化は、ネットワーク障害が発生した場合に「漏れ」ます。開発者がこれらのファイルをネットワークの遅延や障害の影響を受ける可能性があることを考慮せずに「通常の」ファイルとして扱ってしまうと、解決策がバグだらけになってしまいます。
|
||||
|
||||
@@ -608,9 +627,9 @@ Spotifyモデルとは、「Spotify」によって普及したチームと組織
|
||||
|
||||
> エンティティは拡張のために開かれ、修正のために閉じられるべきです。
|
||||
|
||||
「 [SOLID](#solid) 」第二原則。この原則では、エンティティー(クラス、モジュール、関数など)は動作を*拡張*ることができなければならないが、 *既存*の振る舞いは修正することができないべきではないということを述べています。
|
||||
「 [SOLID](#solid) 」第二原則。この原則では、エンティティー(クラス、モジュール、関数など)は動作を*拡張*することができなければならないが、 *既存*の振る舞いは修正することができないべきではないということを述べています。
|
||||
|
||||
仮定としてMarkdown文書をHTMLに変換することができるモジュールを想像してください。ジュールがモジュール内部を修正することなく、新しく提案されたMarkdown機能を処理するために拡張できた場合、拡張のためにオープンになります。既存のMarkdown機能が処理されるように、モジュールが利用者によって*修正されない*場合、修正のために*クローズド*になります。
|
||||
仮定としてMarkdown文書をHTMLに変換することができるモジュールを想像してください。モジュールがモジュール内部を修正することなく、新しく提案されたMarkdown機能を処理するために拡張できた場合、拡張のためにオープンになります。既存のMarkdown機能が処理されるように、モジュールが利用者によって*修正されない*場合、修正のために*クローズド*になります。
|
||||
|
||||
この原則は、オブジェクト指向プログラミングに特に関連しています。簡単に拡張するオブジェクトを設計するかもしれませんが、予期しない方法で変更された既存の動作を持つことができるオブジェクトを設計することを避けます。
|
||||
|
||||
@@ -786,7 +805,7 @@ KISSの原則は、ほとんどのシステムは複雑にするのではなく
|
||||
|
||||
## 貢献方法
|
||||
|
||||
貢献してください! 追加や変更を提案したい場合は [Raise an issue](https://github.com/dwmkerr/hacker-laws/issues/new)、変更を提案したい場合は [Open a pull request](https://github.com/dwmkerr/hacker-laws/compare)t をご利用ください。
|
||||
貢献してください! 追加や変更を提案したい場合は [Raise an issue](https://github.com/dwmkerr/hacker-laws/issues/new)、変更を提案したい場合は [Open a pull request](https://github.com/dwmkerr/hacker-laws/compare) をご利用ください。
|
||||
|
||||
文章やスタイルなどの要件については、[Contributing Guidelines](./.github/contributing.md) を必ずお読みください。プロジェクトの議論に参加する際には、[Code of Conduct](./.github/CODE_OF_CONDUCT.md)を意識してください。
|
||||
|
||||
@@ -794,4 +813,4 @@ KISSの原則は、ほとんどのシステムは複雑にするのではなく
|
||||
|
||||
こんにちは!あなたがここに来たということは、私がまだ書き上げていないトピックへのリンクをクリックしたことにですね。
|
||||
|
||||
リクエストしたい場合は [Raise an Issue](https://github.com/dwmkerr/hacker-laws/issues) rをクリックするか、トピックの定義案を提出したい場合は [Open a Pull Request](https://github.com/dwmkerr/hacker-laws/pulls) をクリックしてください。
|
||||
リクエストしたい場合は [Raise an Issue](https://github.com/dwmkerr/hacker-laws/issues) をクリックするか、トピックの定義案を提出したい場合は [Open a Pull Request](https://github.com/dwmkerr/hacker-laws/pulls) をクリックしてください。
|
||||
|
||||
1058
translations/pl.md
Normal file
@@ -95,7 +95,7 @@ Veja também:
|
||||
|
||||
> A lei de Amdahl, também conhecida como argumento de Amdahl, é usada para encontrar a máxima melhora esperada para um sistema em geral quando apenas uma única parte do mesmo é melhorada. Isto é frequentemente usado em computação paralela para prever o máximo speedup teórico usando múltiplos processadores. A lei possui o nome do Arquiteto computacional Gene Amdahl, e foi apresentada a AFIPS na Conferência Conjunta de Informática na primavera de 1967.
|
||||
|
||||
Fica mais fácil de entender com um exemplo prático. Se um programa é feito de duas partes, parte A, que é executada por um processador único, e parte B, que pode ser feito paralelamente com N processadores. Se adicionarmos mais processaores ao sistema, só vai ter aumento nas tarefas relacionadas à parte B do programa. A velocidade de A se mantém a mesma.
|
||||
Fica mais fácil de entender com um exemplo prático. Se um programa é feito de duas partes, parte A, que é executada por um processador único, e parte B, que pode ser feito paralelamente com N processadores. Se adicionarmos mais processadores ao sistema, só vai ter aumento nas tarefas relacionadas à parte B do programa. A velocidade de A se mantém a mesma.
|
||||
|
||||
O diagrama abaixo mostra alguns exemplos de melhoria na velocidade:
|
||||
|
||||
@@ -125,15 +125,13 @@ Exemplos:
|
||||
|
||||
### Lei de Brook
|
||||
|
||||
[Lei de Brooks na Wikipeia](https://en.wikipedia.org/wiki/Brooks%27s_law)
|
||||
[Lei de Brooks na Wikipedia](https://en.wikipedia.org/wiki/Brooks%27s_law)
|
||||
|
||||
> Adicionar recursos humanos em um projeto, de desenvolvimento de software, atrasado, faz ficar ainda mais atrasado.
|
||||
|
||||
> Adicionar recursos humanos em um projeto, de desenvolvimento de sotware, atrasado, faz ficar ainda mais atrasado.
|
||||
|
||||
Essa lei sugere que em muitos casos, na tentativa de acelerar uma entrega, que já está atrasada, adcionando mais pessoas atrasa ainda mais essa entrega. Brooke assume que essa afirmação é uma generalização excessiva, entretanto, o principal motivo para isso acontecer é dado pelo simples fato de adicionar pessoas requer um gasto com comunicação e construção de novos recursos para a equipe suportar novos membros. Logo, a curto prazo esse investimento não tem um retorno. Também existem tarefas que não podem ser dividias, portanto adicionar mais pessoas não vai fazer ela ser concluida mais rápido.
|
||||
|
||||
"Nove mulheres não podem parir uma criança em um mês" e "Dois pilotos não fazem o carro ir mais rápido" são frases relacionadas a Lei de Brooke, principalmente porque algumas tarefas nao podem ser divididas.
|
||||
Essa lei sugere que em muitos casos, na tentativa de acelerar uma entrega, que já está atrasada, adicionando mais pessoas atrasa ainda mais essa entrega. Brooks assume que essa afirmação é uma generalização excessiva, entretanto, o principal motivo para isso acontecer é dado pelo simples fato de adicionar pessoas requer um gasto com comunicação e construção de novos recursos para a equipe suportar novos membros. Logo, a curto prazo esse investimento não tem um retorno. Também existem tarefas que não podem ser dividias, portanto adicionar mais pessoas não vai fazer ela ser concluída mais rápido.
|
||||
|
||||
"Nove mulheres não podem parir uma criança em um mês" e "Dois pilotos não fazem o carro ir mais rápido" são frases relacionadas a Lei de Brooks, principalmente porque algumas tarefas não podem ser divididas.
|
||||
|
||||
Esse é um tema central do livro '[The Mythical Man Month](#lista-de-livros)'.
|
||||
|
||||
@@ -146,7 +144,7 @@ Veja também:
|
||||
|
||||
[Lei de Conway na wikipedia](https://en.wikipedia.org/wiki/Conway%27s_law)
|
||||
|
||||
Essa lei sugere que limites técnicos de um sistema refletirão na estrutura da organização. Se uma organização é estruturada em pequenos setores, desconexas unidades, o sofware que ela produz sera assim também. Se uma organização é construida de forma vertical, em torno de funcionalidades e serviços, terá reflexo disso dentro do sistema.
|
||||
Essa lei sugere que limites técnicos de um sistema refletirão na estrutura da organização. Se uma organização é estruturada em pequenos setores, desconexas unidades, o software que ela produz sera assim também. Se uma organização é construída de forma vertical, em torno de funcionalidades e serviços, terá reflexo disso dentro do sistema.
|
||||
|
||||
Veja também:
|
||||
|
||||
@@ -168,11 +166,11 @@ Veja também:
|
||||
|
||||
[Número de Dunbar na Wikipedia](https://en.wikipedia.org/wiki/Dunbar%27s_number)
|
||||
|
||||
Dunbar propós que humanos só conseguem manter de forma confortável, 150 relacionamentos estáveis. Esse número está mais em um contexto social, "o número de pessoas que você não se sentiria sem graça para se juntar em uma bebiba se esbarrase com ela em um bar". Esse número geralmente está entra 100 e 250.
|
||||
Dunbar propôs que humanos só conseguem manter de forma confortável, 150 relacionamentos estáveis. Esse número está mais em um contexto social, "o número de pessoas que você não se sentiria sem graça para se juntar em uma bebida se esbarrasse com ela em um bar". Esse número geralmente está entra 100 e 250.
|
||||
|
||||
Esse número é uma sugestão cognitiva limite para o número de pessoass para qual consegue-se manter uma relação social estável.
|
||||
Esse número é uma sugestão cognitiva limite para o número de pessoas para qual consegue-se manter uma relação social estável.
|
||||
|
||||
Como uma relação entre pessoas, manter uma relação entre desenvolvedor e codigo requer esforço. É necessário usar politicas, padrões e procedimentos para encarar projetos complicados ou qualquer adversidade possível nesse tipo de relação. Número de Dunbar é importante em vários aspectos, não somente quando a empresa está em crescimento, mas também ao definir o escopo para os esforços da equipe ou decidir quando u msistema deve investir em ferramentas para axuliar na sobrecarga da logística. Colocando em contexto de engrenharia, é o número de projetos para os quais você se sentiria confiante para ingresssar em uma rotação de plantão de suporte.
|
||||
Como uma relação entre pessoas, manter uma relação entre desenvolvedor e código requer esforço. É necessário usar politicas, padrões e procedimentos para encarar projetos complicados ou qualquer adversidade possível nesse tipo de relação. Número de Dunbar é importante em vários aspectos, não somente quando a empresa está em crescimento, mas também ao definir o escopo para os esforços da equipe ou decidir quando um sistema deve investir em ferramentas para auxiliar na sobrecarga da logística. Colocando em contexto de engrenharia, é o número de projetos para os quais você se sentiria confiante para ingressar em uma rotação de plantão de suporte.
|
||||
|
||||
Veja também:
|
||||
|
||||
@@ -207,7 +205,7 @@ Também referenciada como:
|
||||
>
|
||||
> _Marilyn Strathern_
|
||||
|
||||
A lei diz que otimizações orientadas por medidas podem levar à uma desvalorização do próprio resultado da medição. O conjunto de medidas excessivamente seletivo ([KPIs](https://en.wikipedia.org/wiki/Performance_indicator)) aplicado cegamenta a um processo resulta em um efeito distorcido. As pessoas tentem a otimizar localmente "jogando com" o sistema para satisfazer métricas específicas ao invés de prestar atenção ao resultado holístico de suas ações.
|
||||
A lei diz que otimizações orientadas por medidas podem levar à uma desvalorização do próprio resultado da medição. O conjunto de medidas excessivamente seletivo ([KPIs](https://en.wikipedia.org/wiki/Performance_indicator)) aplicado cegamente a um processo resulta em um efeito distorcido. As pessoas tentem a otimizar localmente "jogando com" o sistema para satisfazer métricas específicas ao invés de prestar atenção ao resultado holístico de suas ações.
|
||||
|
||||
Exemplos do mundo real:
|
||||
- Testes sem `assertions` atendem à cobertura de código esperada, apesar do objetivo da métrica era criar software bem testado
|
||||
@@ -225,7 +223,7 @@ Veja também:
|
||||
>
|
||||
> Robert J. Hanlon
|
||||
|
||||
Esse principio sugeste que ações negativas não são sempre resultado de má vontade. Em vez disso, é mais provável que o resultado negativo seja atribuido à ações que não foram totalmente entendidas.
|
||||
Esse principio sugere que ações negativas não são sempre resultado de má vontade. Em vez disso, é mais provável que o resultado negativo seja atribuído à ações que não foram totalmente entendidas.
|
||||
|
||||
### Lei de Hofstadter
|
||||
|
||||
@@ -248,7 +246,7 @@ This is from the book '[Gödel, Escher, Bach: An Eternal Golden Braid](#lista-de
|
||||
>
|
||||
> _([Patrick Hutber](https://en.wikipedia.org/wiki/Patrick_Hutber))_
|
||||
|
||||
Essa lei sugere que melhorias em um sistema irão levar à deterioração em outras partes, ou ela ocultarão outras deteriorações, levando a uma degradação do estado atual do sistema.
|
||||
Essa lei sugere que melhorias em um sistema irão levar à deterioração em outras partes, ou elas ocultarão outras deteriorações, levando a uma degradação do estado atual do sistema.
|
||||
|
||||
Por exemplo, a diminuição na latência da resposta para um `end-point` particular pode causar um aumento na taxa de transferência e na capacidade ao longo de um fluxo de solicitação, afetando um subsistema totalmente diferente.
|
||||
|
||||
@@ -266,7 +264,7 @@ O Ciclo Hype é uma representação visual da empolgação e desenvolvimento da
|
||||
|
||||
*(Image Reference: By Jeremykemp at English Wikipedia, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=10547051)*
|
||||
|
||||
Em curto prazo, o ciclo sugere que acontece uma explosão de empolgação a cerca de uma nova tecnologia e seu impacto em potencial. Equipes geralmente entram juntas nessas tecnlogias de forma rápida e em alguns casos ficam desapontados com os resutados. Uma das possíveis causas para isso é o fato da tecnologia em questão não ser madura o suficiente, ou aplicações do mundo real que não estão totalmente prontas. Depois de um certo tempo, a capacidade da tecnologia aumenta e oportunidades práticas para uso dela aumentam, as equipes finalmente podem ser produtivas. A citação de Amara resume isso de forma sucinta - "Nós tendemos a superestimar os efeitos da tecnologia em curto prazo e subestimar os efeitos a longo prazo".
|
||||
Em curto prazo, o ciclo sugere que acontece uma explosão de empolgação a cerca de uma nova tecnologia e seu impacto em potencial. Equipes geralmente entram juntas nessas tecnologias de forma rápida e em alguns casos ficam desapontadas com os resultados. Uma das possíveis causas para isso é o fato da tecnologia em questão não ser madura o suficiente, ou aplicações do mundo real que não estão totalmente prontas. Depois de um certo tempo, a capacidade da tecnologia aumenta e oportunidades práticas para uso dela aumentam, as equipes finalmente podem ser produtivas. A citação de Amara resume isso de forma sucinta - "Nós tendemos a superestimar os efeitos da tecnologia em curto prazo e subestimar os efeitos a longo prazo".
|
||||
|
||||
|
||||
### Lei de Hyrum (Lei das Interfaces Implícitas)
|
||||
@@ -280,7 +278,7 @@ Em curto prazo, o ciclo sugere que acontece uma explosão de empolgação a cerc
|
||||
>
|
||||
> Hyrum Wright
|
||||
|
||||
A lei de Hyrum sugere que quando você tem um número muito grande de consumidores de uma API, todos os comportamentos dessa API (mesmo aqueles que não estão definidos como parte de um contrato público) eventualmente irão dependender de outra parte do sistema, ou outra API. Um exemplo trivial pode ser elementos não funcionais, como o tempo de resposta de uma API. Um exemplo mais sutil pode ser os consumidores que estão confiando em aplicar um regex a uma mensagem de erro para determinar o _tipo_ de erro de uma API. Mesmo que o contrato público da API não especifique nada sobre o conteúdo da mensagem, indicando que os usuários devem usar um código de erro associado, alguns usuários podem usar a mensagem e alterar a mensagem essencialmente interrompe a API para esses usuários.
|
||||
A lei de Hyrum sugere que quando você tem um número muito grande de consumidores de uma API, todos os comportamentos dessa API (mesmo aqueles que não estão definidos como parte de um contrato público) eventualmente irão depender de outra parte do sistema, ou outra API. Um exemplo trivial pode ser elementos não funcionais, como o tempo de resposta de uma API. Um exemplo mais sutil pode ser os consumidores que estão confiando em aplicar um regex a uma mensagem de erro para determinar o _tipo_ de erro de uma API. Mesmo que o contrato público da API não especifique nada sobre o conteúdo da mensagem, indicando que os usuários devem usar um código de erro associado, alguns usuários podem usar a mensagem e alterar a mensagem essencialmente interrompe a API para esses usuários.
|
||||
|
||||
Veja Também:
|
||||
|
||||
@@ -289,11 +287,11 @@ Veja Também:
|
||||
|
||||
### Lei de Kernighan
|
||||
|
||||
> A depuração é duplamente mais difícil do que escrever o código em primeiro lugar. Portanto, se você escrever o código da maneira mais inteligente possível, por definição, você não é inteligente o sufiencte para depurá-lo.
|
||||
> A depuração é duplamente mais difícil do que escrever o código em primeiro lugar. Portanto, se você escrever o código da maneira mais inteligente possível, por definição, você não é inteligente o suficiente para depurá-lo.
|
||||
>
|
||||
> Brian Kernighan
|
||||
|
||||
A Lei de Kerningham é nomeada por [Brian Kernighan](https://en.wikipedia.org/wiki/Brian_Kernighan) e devivada de uma citação de Kerningham no livro [The Elements of Programming Style](https://en.wikipedia.org/wiki/The_Elements_of_Programming_Style):
|
||||
A Lei de Kerningham é nomeada por [Brian Kernighan](https://en.wikipedia.org/wiki/Brian_Kernighan) e derivada de uma citação de Kerningham no livro [The Elements of Programming Style](https://en.wikipedia.org/wiki/The_Elements_of_Programming_Style):
|
||||
|
||||
> Todo mundo sabe que depurar é duplamente mais difícil do que programar em primeiro lugar. Então, se você é o mais inteligente possível quando escreve, como você conseguirá depurar o código?
|
||||
|
||||
@@ -320,7 +318,7 @@ Veja também:
|
||||
|
||||
### Lei de Moore
|
||||
|
||||
[Lei de Moore na wikipedia](https://en.wikipedia.org/wiki/Moore%27s_law)
|
||||
[Lei de Moore na Wikipedia](https://en.wikipedia.org/wiki/Moore%27s_law)
|
||||
|
||||
> O número de transistores dentro de um circuito integrado dobra a cada 2 anos, aproximadamente.
|
||||
|
||||
@@ -343,7 +341,7 @@ Isso é um ditado comum entre desenvolvedores. Muitas vezes o inesperado ocorre
|
||||
|
||||
> Se algo pode dar errado, dará errado, no pior momento possível.
|
||||
|
||||
Essas 'leis' são geralmente utilizadas em um sentido cômico. Contudo, fenômenos como [_Confirmation Bias_](#TODO) e [_Selection Bias_](#TODO) podem pevar as pessoas a enfatizarem demais essas leis (na maioria das vezes quando as coisas funcionam, elas passam desapercebidas, as falhas são mais perceptíveis e atraem mais discussões).
|
||||
Essas 'leis' são geralmente utilizadas em um sentido cômico. Contudo, fenômenos como [_Confirmation Bias_](#TODO) e [_Selection Bias_](#TODO) podem levar as pessoas a enfatizarem demais essas leis (na maioria das vezes quando as coisas funcionam, elas passam desapercebidas, as falhas são mais perceptíveis e atraem mais discussões).
|
||||
|
||||
Veja também:
|
||||
|
||||
@@ -375,7 +373,7 @@ Exemplo:
|
||||
|
||||
>O trabalho se expande de modo a preencher o tempo disponível para a sua realização.
|
||||
|
||||
A lei de Parkinson foi publicada por Cyril Northcote Parkinson num artigo na revista The Economist em 1955, sendo depois reimpresso com outros artigos no livro Parkinson's Law: The Pursuit of Progress [A lei de Parkinson: a busca do progresso].Em seu contexto original, essa Lei foi baseada em estudos de burocracia. E pode ser pessimisticamente aplicado a desenvolvimento de software, a teoria diz que equipes serão ineficientes até os prazos finais, quando irão dar o máximo até o prazo final.
|
||||
A lei de Parkinson foi publicada por Cyril Northcote Parkinson num artigo na revista The Economist em 1955, sendo depois reimpresso com outros artigos no livro Parkinson's Law: The Pursuit of Progress [A lei de Parkinson: a busca do progresso]. Em seu contexto original, essa Lei foi baseada em estudos de burocracia. E pode ser pessimisticamente aplicado a desenvolvimento de software, a teoria diz que equipes serão ineficientes até os prazos finais, quando irão dar o máximo até o prazo final.
|
||||
|
||||
### Efeito de Otimização Prematura
|
||||
|
||||
@@ -385,7 +383,7 @@ A lei de Parkinson foi publicada por Cyril Northcote Parkinson num artigo na rev
|
||||
>
|
||||
> [(Donald Knuth)](https://twitter.com/realdonaldknuth?lang=en)
|
||||
|
||||
No artigo de Donald Knuth, [Structured Programming With Go To Statements](http://wiki.c2.com/?StructuredProgrammingWithGoToStatements), ele escreve: "Programadores perdem grandes quantidades de tempo pensando ou se preocupando com a velocidade de partes não críticas de seus programas, e essas tentativas de eficiência possuem um forte impacto negativo quando depuração e manutenção são consideradas. Nós devemos esquecer essas pequenas eficiências, cerca de 97% das vezes: **otimização prematura é a raiz de todo o mal.** No entando, não devemos perder a oportunidade nesses 3% críticos".
|
||||
No artigo de Donald Knuth, [Structured Programming With Go To Statements](http://wiki.c2.com/?StructuredProgrammingWithGoToStatements), ele escreve: "Programadores perdem grandes quantidades de tempo pensando ou se preocupando com a velocidade de partes não críticas de seus programas, e essas tentativas de eficiência possuem um forte impacto negativo quando depuração e manutenção são consideradas. Nós devemos esquecer essas pequenas eficiências, cerca de 97% das vezes: **otimização prematura é a raiz de todo o mal.** No entanto, não devemos perder a oportunidade nesses 3% críticos".
|
||||
|
||||
Contudo, _Otimização Prematura_ pode ser definida (em termos menos carregados) como otimizar antes de saber o que precisamos.
|
||||
|
||||
@@ -399,7 +397,9 @@ A Lei de Putt é frequentemente seguida pelo Corolário de Putt:
|
||||
|
||||
> Cada hierarquia técnica, no tempo, desenvolve uma inversão de competência.
|
||||
|
||||
Estas declarações sugerem que devido a vários critérios de seleção e tendências na forma como grupos se organizam, haverá um número de pessoas qualificadas nos níveis de trabalho de organizações técnicas, e um número de pessoas em funções gerenciais que não estão cientes das complexidades e desafios do trabalho que estão gerenciando. Isso pode ser devido a fenômenos como (#em-progresso)
|
||||
Estas declarações sugerem que devido a vários critérios de seleção e tendências na forma como grupos se organizam, haverá um número de pessoas qualificadas nos níveis de trabalho de organizações técnicas, e um número de pessoas em funções gerenciais que não estão cientes das complexidades e desafios do trabalho que estão gerenciando. Isso pode ser devido a fenômenos como o [Princípio de Peter](#o-princípio-de-peter) ou o [Princípio Dilbert](#o-princípio-dilbert).
|
||||
|
||||
No entanto, deve-se enfatizar que leis como essa são vastas generalizações e podem ser aplicáveis a alguns tipos de organizações, mas não a outras.
|
||||
|
||||
Veja também:
|
||||
|
||||
@@ -422,7 +422,7 @@ Veja também:
|
||||
|
||||
[A lei da Conservação de Complexidade na wikipedia](https://en.wikipedia.org/wiki/Law_of_conservation_of_complexity)
|
||||
|
||||
Essa lei sugere que em todos sitemas sempre vai existir uma quantidade de complexidade que não pode ser reduzida.
|
||||
Essa lei sugere que em todos os sistemas sempre vai existir uma quantidade de complexidade que não pode ser reduzida.
|
||||
|
||||
Alguma complexidade em um sistema é "inadvertida". É uma consequência da estrutura deficiente, erros ou apenas má modelagem de um problema a ser resolvido. A complexidade inadvertida pode ser reduzida (ou eliminada). No entanto, alguma complexidade é "intrínseca" como consequência da complexidade inerente ao problema a ser resolvido. Essa complexidade pode ser movida, mas não eliminada.
|
||||
|
||||
@@ -436,9 +436,9 @@ Um elemento interessante para essa lei é a sugestão de que, mesmo simplificand
|
||||
|
||||
Essa lei afirma que abstrações, as quais são geralmente utilizadas na computação para simplificar um trabalho com sistemas complexos, em certas situações irão 'vazar' elementos do sistema subjacente, fazendo com que a abstração se comporte de maneira inesperada.
|
||||
|
||||
Um exemplo disso pode ser carregar um arquivo e ler o seu conteúdo. As APIs do sistema de arquivo são abstrações do kernel de nível inferior, que são uma abstração dos processadores físicos relacionados à alteração de dados no disco rígido (ou na memória flash em SSD). Na maioria dos casos, a abstração de tratar um arquivo como um fluxo de dados binários funcionará. Contudo, para um disco rígido, a leitura sequencial dos dados será significamente mais rápida que o acesso aleatório (devido ao aumento da sobrecarga de falhas na página), mas para um disco SSD, essa sobrecarga não estará presente. Os detalhes subjacentes precisarão ser entendidos para lidar com esse caso (por exemplo, os arquivos índices de uma base de dados são estruturados para reduzir a sobrecarga do acesso aleatório), a abstração 'vaza' detalhes de implementação os quais o desenvolvedor precisa estar ciente.
|
||||
Um exemplo disso pode ser carregar um arquivo e ler o seu conteúdo. As APIs do sistema de arquivo são abstrações do kernel de nível inferior, que são uma abstração dos processadores físicos relacionados à alteração de dados no disco rígido (ou na memória flash em SSD). Na maioria dos casos, a abstração de tratar um arquivo como um fluxo de dados binários funcionará. Contudo, para um disco rígido, a leitura sequencial dos dados será significantemente mais rápida que o acesso aleatório (devido ao aumento da sobrecarga de falhas na página), mas para um disco SSD, essa sobrecarga não estará presente. Os detalhes subjacentes precisarão ser entendidos para lidar com esse caso (por exemplo, os arquivos índices de uma base de dados são estruturados para reduzir a sobrecarga do acesso aleatório), a abstração 'vaza' detalhes de implementação os quais o desenvolvedor precisa estar ciente.
|
||||
|
||||
O exemplo acima pode se tormar mais complexo quando _mais_ abstrações são introduzidas. O sistema operacional Linux permite que os arquivos sejam acessados por rede mas representados localmente como arquivos 'normais'. Essa abstração será 'vazada' se houverem falhas de rede. Se um desenvolvedor tratar esses arquivos como 'normais', sem considerar o fato de que eles podem estar sujeitos à latência e falhas na rede, as soluções serão incorretas.
|
||||
O exemplo acima pode se tornar mais complexo quando _mais_ abstrações são introduzidas. O sistema operacional Linux permite que os arquivos sejam acessados por rede mas representados localmente como arquivos 'normais'. Essa abstração será 'vazada' se houverem falhas de rede. Se um desenvolvedor tratar esses arquivos como 'normais', sem considerar o fato de que eles podem estar sujeitos à latência e falhas na rede, as soluções serão incorretas.
|
||||
|
||||
Veja também:
|
||||
|
||||
@@ -446,7 +446,7 @@ Veja também:
|
||||
|
||||
Exemplos do mundo real:
|
||||
|
||||
- [Photoshop Slow Startup](https://forums.adobe.com/thread/376152) - um problema que eu encontrei no passado. O Photoshop demorava para abrir, às vezes levando alguns minutos. Parecia que o problema era que, ao iniciar, o programa lia algumas informações sobre a impressora padrão. No entando, se essa impressora fosse uma impressora de rede, isso demoraria tempo extremamente longo. A _abstração_ de uma impressora de rede ser mostrada ao sistema como uma impressora local causou um problema para usuários em situação de baixa conectividade.
|
||||
- [Photoshop Slow Startup](https://forums.adobe.com/thread/376152) - um problema que eu encontrei no passado. O Photoshop demorava para abrir, às vezes levando alguns minutos. Parecia que o problema era que, ao iniciar, o programa lia algumas informações sobre a impressora padrão. No entanto, se essa impressora fosse uma impressora de rede, isso demoraria tempo extremamente longo. A _abstração_ de uma impressora de rede ser mostrada ao sistema como uma impressora local causou um problema para usuários em situação de baixa conectividade.
|
||||
|
||||
### A Lei da Trivialidade
|
||||
|
||||
@@ -454,7 +454,7 @@ Exemplos do mundo real:
|
||||
|
||||
Essa lei sugere que grupos irão dar maior atenção para problemas triviais ou cosméticos, do que para os problemas sérios e substanciais.
|
||||
|
||||
O exemplo fictício comum utilizado é o de um comitê aprovando planos para uma usina nuclear, que passam maior tempo discutindo a estrutura do bicicletário ao invés do design da própria usina que é muito mais importante. Pode ser difícil fornecer informações valiosas em discussões sobre tópicos muito grandes e complexos sem um alto grau de conhecimento ou preparação no assunto. No entando, as pessoas querem ser vistas contribuindo com informações importantes. Daí uma tendência de concentrar muito tempo em pequenos detalhes, que podem ser facilmente explicados, mas necessariamente não são de importância particular.
|
||||
O exemplo fictício comum utilizado é o de um comitê aprovando planos para uma usina nuclear, que passam maior tempo discutindo a estrutura do bicicletário ao invés do design da própria usina que é muito mais importante. Pode ser difícil fornecer informações valiosas em discussões sobre tópicos muito grandes e complexos sem um alto grau de conhecimento ou preparação no assunto. No entanto, as pessoas querem ser vistas contribuindo com informações importantes. Daí uma tendência de concentrar muito tempo em pequenos detalhes, que podem ser facilmente explicados, mas necessariamente não são de importância particular.
|
||||
|
||||
O exemplo fictício acima levou ao uso do termo _'Bike Shedding'_ como uma expressão por gastar tempo em detalhes triviais.
|
||||
|
||||
@@ -473,7 +473,7 @@ Práticas modernas como a 'Arquitetura de Microsserviços' podem ser pensadas co
|
||||
|
||||
O Modelo Spotify é uma abordagem para a organização de equipes que foi popularizado pelo 'Spotify'. Neste modelo, times são organizados por funcionalidades, não por tecnologias.
|
||||
|
||||
O Modelo Spotify também popularizou o conteido de Tribos, Guildas, Capítulos, que são outros componentes de sua estrutura organizacional.
|
||||
O Modelo Spotify também popularizou o conceito de Tribos, Guildas, Capítulos, que são outros componentes de sua estrutura organizacional.
|
||||
|
||||
### Lei de Wadler
|
||||
|
||||
@@ -488,7 +488,7 @@ O Modelo Spotify também popularizou o conteido de Tribos, Guildas, Capítulos,
|
||||
>
|
||||
> (Em resumo, para cada hora gasta em semântica, 8 horas serão gastas na sintaxe de comentários)
|
||||
|
||||
Semelhante à [Lei da Trivialidade](#a-lei-da-trivialidade), a Lei de Wadler afirma que quando projetamos uma linguagem, o tempo gasto em estruturas é desproporcionalmente maior do que a imporância dessas funcionalidades.
|
||||
Semelhante à [Lei da Trivialidade](#a-lei-da-trivialidade), a Lei de Wadler afirma que quando projetamos uma linguagem, o tempo gasto em estruturas é desproporcionalmente maior do que a importância dessas funcionalidades.
|
||||
|
||||
Veja também:
|
||||
|
||||
@@ -504,7 +504,7 @@ Veja também:
|
||||
>
|
||||
> _Wil Wheaton_
|
||||
|
||||
Cunhada por Wil Wheaton (Star Trek: The Next Generation, The Big Bang Theory), esta lei simples, concisa e poderosa visa aumentar a harmonia e o respeito dentro de uma organização profissional. Ela pode ser aplicada ao conversar com colegas de trabalho, ao efetuar code reviews, contrariar outros ponto de vista, criticar, e, em linhas gerais, na maioria das interações que os humanos mantém entre si.
|
||||
Cunhada por Wil Wheaton (Star Trek: The Next Generation, The Big Bang Theory), esta lei simples, concisa e poderosa visa aumentar a harmonia e o respeito dentro de uma organização profissional. Ela pode ser aplicada ao conversar com colegas de trabalho, ao efetuar code reviews, contrariar outros pontos de vista, criticar, e, em linhas gerais, na maioria das interações que os humanos mantém entre si.
|
||||
|
||||
## Princípios
|
||||
|
||||
@@ -539,7 +539,7 @@ O Princípio de Pareto sugere que em alguns casos, a maioria dos resultados vem
|
||||
- 20% dos bugs causam 80% das quebras
|
||||
- 20% das funcionalidades causam 80% da utilização
|
||||
|
||||
Nos anos 40 o engenheiro americano-romeno Dr. Joseph Juran, reconhecido como pai do controle de qualidade, [começou a aplicar o Princípio de Pareto a questões de qualidade]((https://en.wikipedia.org/wiki/Joseph_M._Juran)).
|
||||
Nos anos 40 o engenheiro americano-romeno Dr. Joseph Juran, reconhecido como pai do controle de qualidade, [começou a aplicar o Princípio de Pareto a questões de qualidade](https://en.wikipedia.org/wiki/Joseph_M._Juran).
|
||||
|
||||
Este princípio é também conhecido como: A Regra do 80/20, A Lei dos Poucos Vitais e O Princípio de Escassez do Fator.
|
||||
|
||||
@@ -594,7 +594,7 @@ Esses são os princípios-chave da [Programação Orientada a Objetos](#todo). O
|
||||
|
||||
O primeiro dos princípios '[SOLID](#solid)'. Esse princípio sugere que módulos ou classes devem fazer apenas uma única coisa. Em termos mais práticos, isso significa que uma mudança simples a uma funcionalidade de um programa deve exigir uma mudança em apenas um componente. Por exemplo, mudar como uma senha é validada por complexidade deve exigir uma mudança em apenas uma parte do programa.
|
||||
|
||||
Teoricamente, isso deve tornar o código mais robusto, e fácil de ser mudado. Sabendo que um componente que está sendo alterado possui apenas uma responsabilidade siginfica que o _teste_ deverá ser mais fácil. Usando o exemplo anterior, trocar a complexidade do componente de senha deve afetar apenas as funcionalidades que são relacionadas com a complexidade de senha. Pode ser muito mais difícil argumentar sobre o impacto de uma alteração em um componente que tem muitas responsabilidades.
|
||||
Teoricamente, isso deve tornar o código mais robusto, e fácil de ser mudado. Sabendo que um componente que está sendo alterado possui apenas uma responsabilidade significa que o _teste_ deverá ser mais fácil. Usando o exemplo anterior, trocar a complexidade do componente de senha deve afetar apenas as funcionalidades que são relacionadas com a complexidade de senha. Pode ser muito mais difícil argumentar sobre o impacto de uma alteração em um componente que tem muitas responsabilidades.
|
||||
|
||||
Veja também:
|
||||
|
||||
@@ -607,11 +607,11 @@ Veja também:
|
||||
|
||||
> Entidades devem estar aberta para extensão e fechadas para modificação
|
||||
|
||||
O segundo princípio do '[SOLID](#solid)'. Esse princípio afirma que entidades (que podem ser classes, módulos, funções e afins) poderão ter seu comportamento _extendido_, mas que o comportamento já existente não poderá ser alterado.
|
||||
O segundo princípio do '[SOLID](#solid)'. Esse princípio afirma que entidades (que podem ser classes, módulos, funções e afins) poderão ter seu comportamento _estendido_, mas que o comportamento já existente não poderá ser alterado.
|
||||
|
||||
Em um exemplo hipotético, imagine um módulo que converte um documento Markdown para HTML. Se o módulo pode ser extendido para aceitar uma nova funcionalidade do markdown, sem modificar a parte interna desse módulo, quer dizer que ele está aberto para extensões. Se o módulo _não_ pode ser modificado por um consumidor, de modo que as funcionalidades existentes do markdown sejam tratadas, então ele estará _fechado_ para modificações.
|
||||
Em um exemplo hipotético, imagine um módulo que converte um documento Markdown para HTML. Se o módulo pode ser estendido para aceitar uma nova funcionalidade do markdown, sem modificar a parte interna desse módulo, quer dizer que ele está aberto para extensões. Se o módulo _não_ pode ser modificado por um consumidor, de modo que as funcionalidades existentes do markdown sejam tratadas, então ele estará _fechado_ para modificações.
|
||||
|
||||
Esse princípio tem uma relevância particular na orientação a objetos, onde nós projetamos objetos para serem facilmente extendidos, mas evitamos projetar objetos onde o comportamento existente pode ser alterado de maneiras inesperadas.
|
||||
Esse princípio tem uma relevância particular na orientação a objetos, onde nós projetamos objetos para serem facilmente estendidos, mas evitamos projetar objetos onde o comportamento existente pode ser alterado de maneiras inesperadas.
|
||||
|
||||
Veja também:
|
||||
|
||||
@@ -628,7 +628,7 @@ O terceiro princípio '[SOLID](#solid)'. O princípio afirma que se um component
|
||||
|
||||
Como um exemplo, imagine que temos um método que lê um documento XML de uma estrutura que representa um arquivo. Se o método utiliza a base de um tipo 'arquivo', então qualquer coisa que seja derivada de 'arquivo' poderá ser utilizada na função. Se 'arquivo' suporta busca recursiva, e o interpretador de XML utiliza essa função, mas o tipo derivado 'arquivo de rede' falha quando tenta uma busca recursiva, então o tipo 'arquivo de rede' estaria violando o princípio.
|
||||
|
||||
Esse princípio tem uma relevância particular na orientação a objetos, onde as hierarquias de tipos precisam ser modeladas com cautela para envitar confusão entre usuaríos do sistema.
|
||||
Esse princípio tem uma relevância particular na orientação a objetos, onde as hierarquias de tipos precisam ser modeladas com cautela para evitar confusão entre usuários do sistema.
|
||||
|
||||
Veja também:
|
||||
|
||||
@@ -643,9 +643,9 @@ Veja também:
|
||||
|
||||
O quarto princípio do '[SOLID](#solid)'. Esse princípio afirma que os consumidores de um componente não devem depender de funções daquele componente, as quais eles atualmente não usem.
|
||||
|
||||
Como um exemplo, imagine que um método lê um documento XML de uma estutura que representa um arquivo. O método apenas precisa ler os bytes, ir para frente ou para trás no arquivo. Se esse método precisar ser atualizado porque um recurso não relacionado da estrutura do arquivo é alterado (como uma atualização no modelo de permissões utilizado para representar a segurança do arquivo), o princípio foi invalidado.
|
||||
Como um exemplo, imagine que um método lê um documento XML de uma estrutura que representa um arquivo. O método apenas precisa ler os bytes, ir para frente ou para trás no arquivo. Se esse método precisar ser atualizado porque um recurso não relacionado da estrutura do arquivo é alterado (como uma atualização no modelo de permissões utilizado para representar a segurança do arquivo), o princípio foi invalidado.
|
||||
|
||||
Esse princípio tem uma relevância particular na orientação a objetos, onde interfaces, hierarquias e tipos abstratos são utilizados para [minimizar o acomplamento](#todo) entre componentes diferentes. [Duck typing]() é uma metodologia que enforça esse princípio, eliminando interfaces explícitas.
|
||||
Esse princípio tem uma relevância particular na orientação a objetos, onde interfaces, hierarquias e tipos abstratos são utilizados para [minimizar o acoplamento](#todo) entre componentes diferentes. [Duck typing]() é uma metodologia que impõe esse princípio, eliminando interfaces explícitas.
|
||||
|
||||
Veja também:
|
||||
|
||||
@@ -679,7 +679,7 @@ Veja também:
|
||||
|
||||
> Cada pedaço de código deve possuir uma representação única, inequívoca e autoritária dentro de um sistema.
|
||||
|
||||
DRY é um acrônimo para _**D**on't **R**epeat **Y**ourself_ (Não repita você mesmo). Esse princípio ajuda os desenvolvedores a reduzir a repetição de código e manter a informação em um único lugar. Foi citado em 1999 por Andrew Hunt e Dave Thomas no livro [The Pragmatic Developer](https://en.wikipedia.org/wiki/The_Pragmatic_Programmer).
|
||||
DRY é um acrônimo para _**D**on't **R**epeat **Y**ourself_ (Não repita você mesmo). Esse princípio ajuda os desenvolvedores a reduzir a repetição de código e manter a informação em um único lugar. Foi citado em 1999 por Andrew Hunt e Dave Thomas no livro [The Pragmatic Programmer](https://en.wikipedia.org/wiki/The_Pragmatic_Programmer).
|
||||
|
||||
> O oposto de DRY seria WET (Write Everything Twice or We Enjoy Typing) - (Escreva tudo duas vezes ou Nós gostamos de digitar).
|
||||
|
||||
@@ -687,7 +687,7 @@ Na prática, se você tem o mesmo pedaço de informação em dois (ou mais) luga
|
||||
|
||||
Veja também:
|
||||
|
||||
- [The Pragmatic Developer](https://en.wikipedia.org/wiki/The_Pragmatic_Programmer)
|
||||
- [The Pragmatic Programmer](https://en.wikipedia.org/wiki/The_Pragmatic_Programmer)
|
||||
|
||||
### O Princípio KISS
|
||||
|
||||
@@ -715,7 +715,7 @@ Veja também:
|
||||
|
||||
Este princípio da _Extreme Programming_ (XP) sugere que os desenvolvedores apenas devem implementar funcionalidades quando elas forem necessárias, e evitar tentativas de prever o futuro e implementar uma funcionalidade que talvez seja necessária.
|
||||
|
||||
Aderir a esse princípio deve reduzir a quantidade de código não utilizado em um projeto, e evitar tempo e esforço sendo disperdiçados em funcionalidades que não agregam valor.
|
||||
Aderir a esse princípio deve reduzir a quantidade de código não utilizado em um projeto, e evitar tempo e esforço sendo desperdiçados em funcionalidades que não agregam valor.
|
||||
|
||||
Veja também:
|
||||
|
||||
@@ -783,7 +783,7 @@ Se você quer atualizar uma tradução, [abra uma pull request](https://github.c
|
||||
|
||||
## Projetos relacionados
|
||||
|
||||
- [Tip of the Day](https://tips.darekkay.com/html/hacker-laws-en.html) - Receba diaramente uma lei ou princípio hacker.
|
||||
- [Tip of the Day](https://tips.darekkay.com/html/hacker-laws-en.html) - Receba diariamente uma lei ou princípio hacker.
|
||||
- [Hacker Laws CLI](https://github.com/umutphp/hacker-laws-cli) - Liste e visualize as leis de maneira aleatória no seu terminal!
|
||||
|
||||
## Contribuindo
|
||||
|
||||