mirror of
https://github.com/dwmkerr/hacker-laws.git
synced 2025-12-17 20:55:02 +01:00
Compare commits
110 Commits
gitlocaliz
...
feat/trans
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a889b7e192 | ||
|
|
b9eeb6d48c | ||
|
|
b721582d48 | ||
|
|
bdfa3f7353 | ||
|
|
7f3bd2d562 | ||
|
|
d45304173f | ||
|
|
27bd930bf6 | ||
|
|
1366809cff | ||
|
|
c7ff9646dc | ||
|
|
1c074f53bd | ||
|
|
1efe234781 | ||
|
|
9c122f1739 | ||
|
|
592474ff8d | ||
|
|
d206f28f57 | ||
|
|
9303e59e7f | ||
|
|
3ec3839d56 | ||
|
|
517055e22b | ||
|
|
2d241be9b6 | ||
|
|
94f6db72e7 | ||
|
|
ba67d4c5ee | ||
|
|
8b10abf287 | ||
|
|
f0b03bfa49 | ||
|
|
fe02c768cf | ||
|
|
7ccf4cfbaf | ||
|
|
66f32c6e52 | ||
|
|
dfb4f7c0d3 | ||
|
|
f15fbd7b35 | ||
|
|
69fe45e96d | ||
|
|
64557558cf | ||
|
|
1c8d0a055f | ||
|
|
fc2a780084 | ||
|
|
4d5ad3c0c0 | ||
|
|
892801c719 | ||
|
|
aaa4e8a643 | ||
|
|
c9b56ed16c | ||
|
|
f423817c47 | ||
|
|
05f21b3bb9 | ||
|
|
3293f3d33c | ||
|
|
78441650bb | ||
|
|
8990899a36 | ||
|
|
5b5bbe7fb1 | ||
|
|
0c431dfd30 | ||
|
|
e652fbdd54 | ||
|
|
8d736c0462 | ||
|
|
428c780b33 | ||
|
|
b0376a4948 | ||
|
|
ea4fd853fa | ||
|
|
e469051421 | ||
|
|
fbcf9b2a92 | ||
|
|
a94adc0f8d | ||
|
|
e032b2f1b9 | ||
|
|
37f05705e6 | ||
|
|
8ba2d2d369 | ||
|
|
ca5bf2b940 | ||
|
|
7c305a061a | ||
|
|
0269774207 | ||
|
|
f30c65383e | ||
|
|
1e9ed955f3 | ||
|
|
84372cecd9 | ||
|
|
d2e5bf762d | ||
|
|
dff177ba17 | ||
|
|
ce46da4d67 | ||
|
|
81a58d7e5d | ||
|
|
99afa4254d | ||
|
|
005b253e9c | ||
|
|
2169292aaf | ||
|
|
b247e97de4 | ||
|
|
732e804d18 | ||
|
|
5fe01451e7 | ||
|
|
3ec65ad19c | ||
|
|
75a1c380c0 | ||
|
|
02e5a87224 | ||
|
|
10245b95fa | ||
|
|
b0b8880946 | ||
|
|
39a1e82371 | ||
|
|
d4a63a4cdc | ||
|
|
ce197c63fa | ||
|
|
fd3d8d3380 | ||
|
|
344d06307e | ||
|
|
0394a5be61 | ||
|
|
cc0592aeae | ||
|
|
5d3081e970 | ||
|
|
29d65cbb0a | ||
|
|
cea8f2ae3e | ||
|
|
ff457799d4 | ||
|
|
b599ef621d | ||
|
|
486f814069 | ||
|
|
3c99adbfa3 | ||
|
|
8d3be57775 | ||
|
|
2359148cde | ||
|
|
9e78cc60a3 | ||
|
|
c0136b45a8 | ||
|
|
cec24ef23a | ||
|
|
f0337374cc | ||
|
|
2af6370166 | ||
|
|
7b385e7964 | ||
|
|
91e898ede0 | ||
|
|
7c8932e75c | ||
|
|
60f23e81e1 | ||
|
|
19e69c4e0c | ||
|
|
88de618fa1 | ||
|
|
ac1ffb6214 | ||
|
|
c3e84fd75b | ||
|
|
52f394e817 | ||
|
|
4dca535f7b | ||
|
|
c7d2f241eb | ||
|
|
a2d9f61e5a | ||
|
|
69bac6beec | ||
|
|
5f0236ab55 | ||
|
|
4fa3ec8087 |
2
.github/FUNDING.yml
vendored
Normal file
2
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
# Support 'GitHub Sponsors' funding.
|
||||
github: dwmkerr
|
||||
2
.github/contributing.md
vendored
2
.github/contributing.md
vendored
@@ -1,6 +1,5 @@
|
||||
# Contributing Guidelines
|
||||
|
||||
|
||||
<!-- vim-markdown-toc GFM -->
|
||||
|
||||
* [Example Law: The Law of Leaky Abstractions](#example-law-the-law-of-leaky-abstractions)
|
||||
@@ -25,6 +24,7 @@ Some other tips:
|
||||
- Be careful not to copy-and-paste content (unless it is explicitly quoted), as it might violate copyright.
|
||||
- Include hyperlinks to referenced material.
|
||||
- Do not advocate for the law, or aim to be opinionated on the correctness or incorrectness of the law, as this repository is simply the descriptions and links.
|
||||
- Avoid 'you' when writing. For example, prefer "This law suggests refactoring should be avoided when..." rather than "you should avoid refactoring when...". This keeps the style slightly more formal and avoids seeming like advocation of a law.
|
||||
|
||||
An example law is shown below, which covers most of the key points:
|
||||
|
||||
|
||||
2
.github/pull_request_template.md
vendored
2
.github/pull_request_template.md
vendored
@@ -2,7 +2,7 @@
|
||||
|
||||
Please double check the items below!
|
||||
|
||||
- [ ] I have read the [Contributor Guidelines](./.github/contributing.md).
|
||||
- [ ] I have read the [Contributor Guidelines](https://github.com/dwmkerr/hacker-laws/blob/master/.github/contributing.md).
|
||||
- [ ] I have not directly copied text from another location (unless explicitly indicated as a quote) or violated copyright.
|
||||
- [ ] I have linked to the original Law.
|
||||
- [ ] I have quote the law (if possible) and the author's name (if possible).
|
||||
|
||||
186
LICENSE
186
LICENSE
@@ -1,21 +1,173 @@
|
||||
MIT License
|
||||
Copyright (c) Dave Kerr 2019
|
||||
|
||||
Copyright (c) 2018 Dave Kerr
|
||||
# Attribution-ShareAlike 4.0 International
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
### Using Creative Commons Public Licenses
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses.
|
||||
|
||||
* __Considerations for licensors:__ Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. [More considerations for licensors](http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensors).
|
||||
|
||||
* __Considerations for the public:__ By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. [More considerations for the public](http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensees).
|
||||
|
||||
## Creative Commons Attribution-ShareAlike 4.0 International Public License
|
||||
|
||||
By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-ShareAlike 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.
|
||||
|
||||
### Section 1 – Definitions.
|
||||
|
||||
a. __Adapted Material__ means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
|
||||
|
||||
b. __Adapter's License__ means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.
|
||||
|
||||
c. __BY-SA Compatible License__ means a license listed at [creativecommons.org/compatiblelicenses](http://creativecommons.org/compatiblelicenses), approved by Creative Commons as essentially the equivalent of this Public License.
|
||||
|
||||
d. __Copyright and Similar Rights__ means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
|
||||
|
||||
e. __Effective Technological Measures__ means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.
|
||||
|
||||
f. __Exceptions and Limitations__ means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.
|
||||
|
||||
g. __License Elements__ means the license attributes listed in the name of a Creative Commons Public License. The License Elements of this Public License are Attribution and ShareAlike.
|
||||
|
||||
h. __Licensed Material__ means the artistic or literary work, database, or other material to which the Licensor applied this Public License.
|
||||
|
||||
i. __Licensed Rights__ means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.
|
||||
|
||||
j. __Licensor__ means the individual(s) or entity(ies) granting rights under this Public License.
|
||||
|
||||
k. __Share__ means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.
|
||||
|
||||
l. __Sui Generis Database Rights__ means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
|
||||
|
||||
m. __You__ means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning.
|
||||
|
||||
### Section 2 – Scope.
|
||||
|
||||
a. ___License grant.___
|
||||
|
||||
1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
|
||||
|
||||
A. reproduce and Share the Licensed Material, in whole or in part; and
|
||||
|
||||
B. produce, reproduce, and Share Adapted Material.
|
||||
|
||||
2. __Exceptions and Limitations.__ For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.
|
||||
|
||||
3. __Term.__ The term of this Public License is specified in Section 6(a).
|
||||
|
||||
4. __Media and formats; technical modifications allowed.__ The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material.
|
||||
|
||||
5. __Downstream recipients.__
|
||||
|
||||
A. __Offer from the Licensor – Licensed Material.__ Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.
|
||||
|
||||
B. __Additional offer from the Licensor – Adapted Material.__ Every recipient of Adapted Material from You automatically receives an offer from the Licensor to exercise the Licensed Rights in the Adapted Material under the conditions of the Adapter’s License You apply.
|
||||
|
||||
C. __No downstream restrictions.__ You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.
|
||||
|
||||
6. __No endorsement.__ Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).
|
||||
|
||||
b. ___Other rights.___
|
||||
|
||||
1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.
|
||||
|
||||
2. Patent and trademark rights are not licensed under this Public License.
|
||||
|
||||
3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties.
|
||||
|
||||
### Section 3 – License Conditions.
|
||||
|
||||
Your exercise of the Licensed Rights is expressly made subject to the following conditions.
|
||||
|
||||
a. ___Attribution.___
|
||||
|
||||
1. If You Share the Licensed Material (including in modified form), You must:
|
||||
|
||||
A. retain the following if it is supplied by the Licensor with the Licensed Material:
|
||||
|
||||
i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);
|
||||
|
||||
ii. a copyright notice;
|
||||
|
||||
iii. a notice that refers to this Public License;
|
||||
|
||||
iv. a notice that refers to the disclaimer of warranties;
|
||||
|
||||
v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
|
||||
|
||||
B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and
|
||||
|
||||
C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License.
|
||||
|
||||
2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
|
||||
|
||||
3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable.
|
||||
|
||||
b. ___ShareAlike.___
|
||||
|
||||
In addition to the conditions in Section 3(a), if You Share Adapted Material You produce, the following conditions also apply.
|
||||
|
||||
1. The Adapter’s License You apply must be a Creative Commons license with the same License Elements, this version or later, or a BY-SA Compatible License.
|
||||
|
||||
2. You must include the text of, or the URI or hyperlink to, the Adapter's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Share Adapted Material.
|
||||
|
||||
3. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, Adapted Material that restrict exercise of the rights granted under the Adapter's License You apply.
|
||||
|
||||
### Section 4 – Sui Generis Database Rights.
|
||||
|
||||
Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:
|
||||
|
||||
a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database;
|
||||
|
||||
b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material, including for purposes of Section 3(b); and
|
||||
|
||||
c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
|
||||
|
||||
For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
|
||||
|
||||
### Section 5 – Disclaimer of Warranties and Limitation of Liability.
|
||||
|
||||
a. __Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.__
|
||||
|
||||
b. __To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.__
|
||||
|
||||
c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
|
||||
|
||||
### Section 6 – Term and Termination.
|
||||
|
||||
a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.
|
||||
|
||||
b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:
|
||||
|
||||
1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
|
||||
|
||||
2. upon express reinstatement by the Licensor.
|
||||
|
||||
For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.
|
||||
|
||||
c. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.
|
||||
|
||||
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
|
||||
|
||||
### Section 7 – Other Terms and Conditions.
|
||||
|
||||
a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
|
||||
|
||||
b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.
|
||||
|
||||
### Section 8 – Interpretation.
|
||||
|
||||
a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.
|
||||
|
||||
b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.
|
||||
|
||||
c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.
|
||||
|
||||
d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.
|
||||
|
||||
> Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” The text of the Creative Commons public licenses is dedicated to the public domain under the [CC0 Public Domain Dedication](https://creativecommons.org/publicdomain/zero/1.0/legalcode). Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at [creativecommons.org/policies](http://creativecommons.org/policies), Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses.
|
||||
>
|
||||
> Creative Commons may be contacted at creativecommons.org.
|
||||
|
||||
217
README.md
217
README.md
@@ -2,11 +2,9 @@
|
||||
|
||||
Laws, Theories, Principles and Patterns that developers will find useful.
|
||||
|
||||
- 🇨🇳 [中文 / Chinese Version](https://github.com/nusr/hacker-laws-zh) - thanks [Steve Xu](https://github.com/nusr)!
|
||||
- 🇮🇹 [Traduzione in Italiano](https://github.com/csparpa/hacker-laws-it) - grazie [Claudio Sparpaglione](https://github.com/csparpa)!
|
||||
- 🇰🇷 [한국어 / Korean Version](https://github.com/codeanddonuts/hacker-laws-kr) - thanks [Doughnut](https://github.com/codeanddonuts)!
|
||||
- 🇷🇺 [Русская версия / Russian Version](https://github.com/solarrust/hacker-laws) - thanks [Alena Batitskaya](https://github.com/solarrust)!
|
||||
- 🇹🇷 [Türkçe / Turkish Version](https://github.com/umutphp/hacker-laws-tr) - thanks [Umut Işık](https://github.com/umutphp)
|
||||
[Translations](#translations): [🇧🇷](./translations/pt-BR.md) [🇨🇳](https://github.com/nusr/hacker-laws-zh) [🇩🇪](./translations/de.md) [🇫🇷](./translationis/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)
|
||||
|
||||
Like this project? Please considering [sponsoring me](https://github.com/sponsors/dwmkerr) and the [translators](#translations).
|
||||
|
||||
---
|
||||
|
||||
@@ -15,27 +13,34 @@ Laws, Theories, Principles and Patterns that developers will find useful.
|
||||
* [Introduction](#introduction)
|
||||
* [Laws](#laws)
|
||||
* [Amdahl's Law](#amdahls-law)
|
||||
* [The Broken Windows Theory](#the-broken-windows-theory)
|
||||
* [Brooks' Law](#brooks-law)
|
||||
* [Conway's Law](#conways-law)
|
||||
* [Cunningham's Law](#cunninghams-law)
|
||||
* [Dunbar's Number](#dunbars-number)
|
||||
* [Gall's Law](#galls-law)
|
||||
* [Goodhart's Law](#goodharts-law)
|
||||
* [Hanlon's Razor](#hanlons-razor)
|
||||
* [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 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 Dilbert Principle](#the-dilbert-principle)
|
||||
* [The Pareto Principle (The 80/20 Rule)](#the-pareto-principle-the-8020-rule)
|
||||
@@ -50,7 +55,11 @@ Laws, Theories, Principles and Patterns that developers will find useful.
|
||||
* [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)
|
||||
|
||||
<!-- vim-markdown-toc -->
|
||||
@@ -75,7 +84,7 @@ Best illustrated with an example. If a program is made up of two parts, part A,
|
||||
|
||||
The diagram below shows some examples of potential improvements in speed:
|
||||
|
||||

|
||||
<img width="480px" alt="Diagram: Amdahl's Law" src="./images/amdahls_law.png" />
|
||||
|
||||
*(Image Reference: By Daniels220 at English Wikipedia, Creative Commons Attribution-Share Alike 3.0 Unported, https://en.wikipedia.org/wiki/File:AmdahlsLaw.svg)*
|
||||
|
||||
@@ -88,6 +97,24 @@ See also:
|
||||
- [Brooks' Law](#brooks-law)
|
||||
- [Moore's Law](#moores-law)
|
||||
|
||||
### The Broken Windows Theory
|
||||
|
||||
[The Broken Windows Theory on Wikipedia](https://en.wikipedia.org/wiki/Broken_windows_theory)
|
||||
|
||||
The Broken Windows Theory suggests that visible signs of crime (or lack of care of an environment) lead to further and more serious crimes (or further deterioration of the environment).
|
||||
|
||||
This theory has been applied to software development, suggesting that poor quality code (or [Technical Debt](#TODO)) can lead to a perception that efforts to improve quality may be ignored or undervalued, thus leading to further poor quality code. This effect cascades leading to a great decrease in quality over time.
|
||||
|
||||
See also:
|
||||
|
||||
- [Technical Debt](#TODO)
|
||||
|
||||
Examples:
|
||||
|
||||
- [The Pragmatic Programming: Software Entropy](https://pragprog.com/the-pragmatic-programmer/extracts/software-entropy)
|
||||
- [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/)
|
||||
|
||||
### Brooks' Law
|
||||
|
||||
[Brooks' Law on Wikipedia](https://en.wikipedia.org/wiki/Brooks%27s_law)
|
||||
@@ -149,12 +176,36 @@ See also:
|
||||
|
||||
Gall's Law implies that attempts to _design_ highly complex systems are likely to fail. Highly complex systems are rarely built in one go, but evolve instead from more simple systems.
|
||||
|
||||
The classic example is the world-wide-web. In it's current state, it is a highly complex system. However, it was defined initially as a simple way to share content between academic institutions. It was very successful in meeting these goals and evolved to become more complex over time.
|
||||
The classic example is the world-wide-web. In its current state, it is a highly complex system. However, it was defined initially as a simple way to share content between academic institutions. It was very successful in meeting these goals and evolved to become more complex over time.
|
||||
|
||||
See also:
|
||||
|
||||
- [KISS (Keep It Simple, Stupid)](#the-kiss-principle)
|
||||
|
||||
### Goodhart's Law
|
||||
|
||||
[The Goodhart's Law on Wikipedia](https://en.wikipedia.org/wiki/Goodhart's_law)
|
||||
|
||||
> Any observed statistical regularity will tend to collapse once pressure is placed upon it for control purposes.
|
||||
>
|
||||
> _Charles Goodhart_
|
||||
|
||||
Also commonly referenced as:
|
||||
|
||||
> When a measure becomes a target, it ceases to be a good measure.
|
||||
>
|
||||
> _Marilyn Strathern_
|
||||
|
||||
The law states that the measure-driven optimizations could lead to devaluation of the measurement outcome itself. Overly selective set of measures ([KPIs](https://en.wikipedia.org/wiki/Performance_indicator)) blindly applied to a process results in distorted effect. People tend to optimize locally by "gaming" the system in order to satisfy particular metrics instead of paying attention to holistic outcome of their actions.
|
||||
|
||||
Real-world examples:
|
||||
- Assert-free tests satisfy the code coverage expectation, despite the fact that the metric intent was to create well-tested software.
|
||||
- Developer performance score indicated by the number of lines committed leads to unjustifiably bloated codebase.
|
||||
|
||||
See also:
|
||||
- [Goodhart’s Law: How Measuring The Wrong Things Drive Immoral Behaviour](https://coffeeandjunk.com/goodharts-campbells-law/)
|
||||
- [Dilbert on bug-free software](https://dilbert.com/strip/1995-11-13)
|
||||
|
||||
### Hanlon's Razor
|
||||
|
||||
[Hanlon's Razor on Wikipedia](https://en.wikipedia.org/wiki/Hanlon%27s_razor)
|
||||
@@ -191,7 +242,7 @@ See also:
|
||||
|
||||
This law suggests that improvements to a system will lead to deterioration in other parts, or it will hide other deterioration, leading overall to a degradation from the current state of the system.
|
||||
|
||||
For example, a decrease in response latency for a particular end-point could cause increased throughput and capacity issues further along in a request flow, effecting an entirely different sub-system.
|
||||
For example, a decrease in response latency for a particular end-point could cause increased throughput and capacity issues further along in a request flow, affecting an entirely different sub-system.
|
||||
|
||||
### The Hype Cycle & Amara's Law
|
||||
|
||||
@@ -227,6 +278,36 @@ See also:
|
||||
- [The Law of Leaky Abstractions](#the-law-of-leaky-abstractions)
|
||||
- [XKCD 1172](https://xkcd.com/1172/)
|
||||
|
||||
### 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.
|
||||
>
|
||||
> (Brian Kernighan)
|
||||
|
||||
Kernighan's Law is named for [Brian Kernighan](https://en.wikipedia.org/wiki/Brian_Kernighan) and derived from a quote from Kernighan and Plauger's book [The Elements of Programming Style](https://en.wikipedia.org/wiki/The_Elements_of_Programming_Style):
|
||||
|
||||
> Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?
|
||||
|
||||
While hyperbolic, Kernighan's Law makes the argument that simple code is to be preferred over complex code, because debugging any issues that arise in complex code may be costly or even infeasible.
|
||||
|
||||
See also:
|
||||
|
||||
- [The KISS Principle](#the-kiss-principle)
|
||||
- [The Unix Philosophy](#the-unix-philosophy)
|
||||
- [Occam's Razor](#occams-razor)
|
||||
|
||||
### Metcalfe's Law
|
||||
|
||||
[Metcalfe's Law on Wikipedia](https://en.wikipedia.org/wiki/Metcalfe's_law)
|
||||
|
||||
> In network theory, the value of a system grows as approximately the square of the number of users of the system.
|
||||
|
||||
This law is based on the number of possible pairwise connections within a system and is closely related to [Reed's Law](#reeds-law). Odlyzko and others have argued that both Reed's Law and Metcalfe's Law overstate the value of the system by not accounting for the limits of human cognition on network effects; see [Dunbar's Number](#dunbars-number).
|
||||
|
||||
See also:
|
||||
- [Reed's Law](#reeds-law)
|
||||
- [Dunbar's Number](#dunbars-number)
|
||||
|
||||
### Moore's Law
|
||||
|
||||
[Moore's Law on Wikipedia](https://en.wikipedia.org/wiki/Moore%27s_law)
|
||||
@@ -254,6 +335,25 @@ See Also:
|
||||
- [Confirmation Bias](#TODO)
|
||||
- [Selection Bias](#TODO)
|
||||
|
||||
### Occam's Razor
|
||||
|
||||
[Occam's Razor on Wikipedia](https://en.wikipedia.org/wiki/Occam's_razor)
|
||||
|
||||
> Entities should not be multiplied without necessity.
|
||||
>
|
||||
> William of Ockham
|
||||
|
||||
Occam's razor says that among several possible solutions, the most likely solution is the one with the least number of concepts and assumptions. This solution is the simplest and solves only the given problem, without introducing accidental complexity and possible negative consequences.
|
||||
|
||||
See also:
|
||||
|
||||
- [YAGNI](#yagni)
|
||||
- [No Silver Bullet: Accidental Complexity and Essential Complexity](https://en.wikipedia.org/wiki/No_Silver_Bullet)
|
||||
|
||||
Example:
|
||||
|
||||
- [Lean Software Development: Eliminate Waste](https://en.wikipedia.org/wiki/Lean_software_development#Eliminate_waste)
|
||||
|
||||
### Parkinson's Law
|
||||
|
||||
[Parkinson's Law on Wikipedia](https://en.wikipedia.org/wiki/Parkinson%27s_law)
|
||||
@@ -300,6 +400,18 @@ See also:
|
||||
- [The Dilbert Principle](#the-dilbert-principle)
|
||||
|
||||
|
||||
### Reed's Law
|
||||
|
||||
[Reed's Law on Wikipedia](https://en.wikipedia.org/wiki/Reed's_law)
|
||||
|
||||
> The utility of large networks, particularly social networks, scales exponentially with the size of the network.
|
||||
|
||||
This law is based on graph theory, where the utility scales as the number of possible sub-groups, which is faster than the number of participants or the number of possible pairwise connections. Odlyzko and others have argued that Reed's Law overstates the utility of the system by not accounting for the limits of human cognition on network effects; see [Dunbar's Number](#dunbars-number).
|
||||
|
||||
See also:
|
||||
- [Metcalfe's Law](#metcalfes-law)
|
||||
- [Dunbar's Number](#dunbars-number)
|
||||
|
||||
### 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)
|
||||
@@ -342,7 +454,7 @@ This law suggests that groups will give far more time and attention to trivial o
|
||||
|
||||
The common fictional example used is that of a committee approving plans for nuclear power plant, who spend the majority of their time discussing the structure of the bike shed, rather than the far more important design for the power plant itself. It can be difficult to give valuable input on discussions about very large, complex topics without a high degree of subject matter expertise or preparation. However, people want to be seen to be contributing valuable input. Hence a tendency to focus too much time on small details, which can be reasoned about easily, but are not necessarily of particular importance.
|
||||
|
||||
The fictional example above led to the usage of the term 'Bike Shedding' as an expression for wasting time on trivial details.
|
||||
The fictional example above led to the usage of the term 'Bike Shedding' as an expression for wasting time on trivial details. A related term is '[Yak Shaving](https://en.wiktionary.org/wiki/yak_shaving),' which connotes a seemingly irrelevant activity that is part of a long chain of prerequisites to the main task.
|
||||
|
||||
### The Unix Philosophy
|
||||
|
||||
@@ -379,6 +491,18 @@ See also:
|
||||
|
||||
- [The Law of Triviality](#the-law-of-triviality)
|
||||
|
||||
### Wheaton's Law
|
||||
|
||||
[The Link](http://www.wheatonslaw.com/)
|
||||
|
||||
[The Official Day](https://dontbeadickday.com/)
|
||||
|
||||
> Don't be a dick.
|
||||
>
|
||||
> _Wil Wheaton_
|
||||
|
||||
Coined by Wil Wheaton (Star Trek: The Next Generation, The Big Bang Theory), this simple, concise, and powerful law aims for an increase in harmony and respect within a professional organization. It can be applied when speaking with coworkers, performing code reviews, countering other points of view, critiquing, and in general, most professional interactions humans have with each other.
|
||||
|
||||
## Principles
|
||||
|
||||
Principles are generally more likely to be guidelines relating to design.
|
||||
@@ -414,7 +538,7 @@ The Pareto Principle suggests that in some cases, the majority of results come f
|
||||
|
||||
In the 1940s American-Romanian engineer Dr. Joseph Juran, who is widely credited with being the father of quality control, [began to apply the Pareto principle to quality issues](https://en.wikipedia.org/wiki/Joseph_M._Juran).
|
||||
|
||||
This principle is also known as: The 80/20 Rule, The Law of the Vital Few and The Principle of Factor Sparsity.
|
||||
This principle is also known as: The 80/20 Rule, The Law of the Vital Few, and The Principle of Factor Sparsity.
|
||||
|
||||
Real-world examples:
|
||||
|
||||
@@ -443,10 +567,17 @@ See Also:
|
||||
|
||||
> Be conservative in what you do, be liberal in what you accept from others.
|
||||
|
||||
Often applied in server application development, this principle states that what you send to others should be as minimal and conformant as possible, but you should be aim to allow non-conformant input if it can be processed.
|
||||
Often applied in server application development, this principle states that what you send to others should be as minimal and conformant as possible, but you should aim to allow non-conformant input if it can be processed.
|
||||
|
||||
The goal of this principle is to build systems which are robust, as they can handle poorly formed input if the intent can still be understood. However, there are potentially security implications of accepting malformed input, particularly if the processing of such input is not well tested.
|
||||
|
||||
Allowing non-conformant input, in time, may undermine the ability of protocols to evolve as implementors will eventually rely on this liberality to build their features.
|
||||
|
||||
See Also:
|
||||
|
||||
- [Hyrum's Law](#hyrums-law-the-law-of-implicit-interfaces)
|
||||
|
||||
|
||||
### SOLID
|
||||
|
||||
This is an acronym, which refers to:
|
||||
@@ -482,7 +613,7 @@ See also:
|
||||
|
||||
The second of the '[SOLID](#solid)' principles. This principle states that entities (which could be classes, modules, functions and so on) should be able to have their behaviour _extended_, but that their _existing_ behaviour should not be able to be modified.
|
||||
|
||||
As a hypothetical example, imagine a module which is able to turn a Markdown document into HTML. If the module could be extended to handle a newly proposed markdown feature, without modifying the module internals, then it would be open for extension. If the module could _not_ be modified by a consumer so that how existing Markdown features are handled, then it would be _closed_ for modification.
|
||||
As a hypothetical example, imagine a module which is able to turn a Markdown document into HTML. If the module could be extended to handle a newly proposed Markdown feature, without modifying the module internals, then it would be open for extension. If the module could _not_ be modified by a consumer so that now existing Markdown features are handled, then it would be _closed_ for modification.
|
||||
|
||||
This principle has particular relevance for object-oriented programming, where we may design objects to be easily extended, but would avoid designing objects which can have their existing behaviour changed in unexpected ways.
|
||||
|
||||
@@ -578,9 +709,9 @@ See also:
|
||||
|
||||
### YAGNI
|
||||
|
||||
[YAGNI on Wikipedia](https://en.wikipedia.org/wiki/You_aren%27t_gonna_need_it)
|
||||
[YAGNI on Wikipedia](https://en.wikipedia.org/wiki/You_ain%27t_gonna_need_it)
|
||||
|
||||
This is an acronym for _**Y**ou **A**ren't **G**onna **N**eed **I**t_.
|
||||
This is an acronym for _**Y**ou **A**in't **G**onna **N**eed **I**t_.
|
||||
|
||||
> Always implement things when you actually need them, never when you just foresee that you need them.
|
||||
>
|
||||
@@ -594,6 +725,32 @@ See also:
|
||||
|
||||
- [Reading List: Extreme Programming Installed](#reading-list)
|
||||
|
||||
### The Fallacies of Distributed Computing
|
||||
|
||||
[The Fallacies of Distributed Computing on Wikipedia](https://en.wikipedia.org/wiki/Fallacies_of_distributed_computing)
|
||||
|
||||
Also known as _Fallacies of Networked Computing_, the Fallacies are a list of conjectures (or beliefs) about distributed computing, which can lead to failures in software development. The assumptions are:
|
||||
|
||||
- The network is reliable
|
||||
- Latency is zero
|
||||
- Bandwidth is infinite
|
||||
- The network is secure
|
||||
- Topology doesn't change
|
||||
- There is one administrator
|
||||
- Transport cost is zero
|
||||
- The network is homogeneous
|
||||
|
||||
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).
|
||||
|
||||
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.
|
||||
|
||||
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)
|
||||
|
||||
## Reading List
|
||||
|
||||
@@ -602,9 +759,39 @@ If you have found these concepts interesting, you may enjoy the following books.
|
||||
- [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.
|
||||
- [The Dilbert Principle - Adam Scott](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-principl).
|
||||
- [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 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).
|
||||
|
||||
## Translations
|
||||
|
||||
Thanks to a number of wonderful contributors, Hacker Laws is available in a number of languages. Please consider sponsoring moderators!
|
||||
|
||||
| Language | Moderator | Status |
|
||||
|----------|-----------|--------|
|
||||
| [🇧🇷 Brasileiro / Brazilian](./translations/pt-BR.md) | [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 |
|
||||
| [🇩🇪 Deutsch / German](./translations/de.md) | [Vikto](https://github.com/viktodergunov) | [](https://gitlocalize.com/repo/2513/de?utm_source=badge) |
|
||||
| [🇫🇷 Français / French](./translationis/fr.md) | [Kevin Bockelandt](https://github.com/KevinBockelandt) | [](https://gitlocalize.com/repo/2513/fr?utm_source=badge) |
|
||||
| [🇬🇷 ελληνικά / Greek](./translations/el.md) | [Panagiotis Gourgaris](https://github.com/0gap) | [](https://gitlocalize.com/repo/2513/el?utm_source=badge) |
|
||||
| [🇮🇹 Italiano / Italian](https://github.com/csparpa/hacker-laws-it) | [Claudio Sparpaglione](https://github.com/csparpa) | Partially complete |
|
||||
| [🇰🇷 한국어 / 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) |
|
||||
| [🇷🇺 Русская версия / 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) |
|
||||
|
||||
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.
|
||||
|
||||
## Related Projects
|
||||
|
||||
- [Tip of the Day](https://tips.darekkay.com/html/hacker-laws-en.html) - Receive a daily hacker law/principle.
|
||||
|
||||
## Contributing
|
||||
|
||||
Please do contribute! [Raise an issue](https://github.com/dwmkerr/hacker-laws/issues/new) if you'd like to suggest an addition or change, or [Open a pull request](https://github.com/dwmkerr/hacker-laws/compare) to propose your own changes.
|
||||
|
||||
Please be sure to read the [Contributing Guidelines](./.github/contributing.md) for requirements on text, style and so on. Please be aware of the [Code of Conduct](./.github/CODE_OF_CONDUCT.md) when engaging in discussions on the project.
|
||||
|
||||
## TODO
|
||||
|
||||
Hi! If you land here, you've clicked on a link to a topic I've not written up yet, sorry about this - this is work in progress!
|
||||
|
||||
645
translations/es-ES.md
Normal file
645
translations/es-ES.md
Normal file
@@ -0,0 +1,645 @@
|
||||
# 💻📖 hacker-laws
|
||||
|
||||
Leyes, Teorías, Principios y Patrones que los desarrolladores encontrarán útiles.
|
||||
|
||||
- 🇨🇳 [中文 / Versión China](https://github.com/nusr/hacker-laws-zh) - thanks [Steve Xu](https://github.com/nusr)!
|
||||
- 🇮🇹 [Traduzione in Italiano](https://github.com/csparpa/hacker-laws-it) - grazie [Claudio Sparpaglione](https://github.com/csparpa)!
|
||||
- 🇰🇷 [한국어 / Versión Koreana](https://github.com/codeanddonuts/hacker-laws-kr) - thanks [Doughnut](https://github.com/codeanddonuts)!
|
||||
- 🇷🇺 [Русская версия / Versión Rusa](https://github.com/solarrust/hacker-laws) - thanks [Alena Batitskaya](https://github.com/solarrust)!
|
||||
- 🇹🇷 [Türkçe / Versión Turca](https://github.com/umutphp/hacker-laws-tr) - thanks [Umut Işık](https://github.com/umutphp)
|
||||
- 🇧🇷 [Brasileiro / Versión Brasileña](./translations/pt-BR.md) - thanks [Leonardo Costa](https://github.com/LeoFC97)
|
||||
- 🇺🇸 [Original English Version - Versión Original en Inglés](https://github.com/dwmkerr/hacker-laws) - grazie [Dave Kerr](https://github.com/dwmkerr)!
|
||||
|
||||
¿Te gusta este proyecto? Por favor, considera [Esponsorizarme](https://github.com/sponsors/dwmkerr)!
|
||||
|
||||
---
|
||||
|
||||
<!-- vim-markdown-toc GFM -->
|
||||
|
||||
* [Introducción](#introduccion)
|
||||
* [Leyes](#leyes)
|
||||
* [Ley de Amdahl](#ley-de-amdahl)
|
||||
* [Ley de Brooks](#ley-de-brooks)
|
||||
* [Ley de Conway](#ley-de-conways)
|
||||
* [Ley de Cunningham](#ley-de-cunningham)
|
||||
* [Número de Dunbar](#numero-de-dunbar)
|
||||
* [Ley de Gall](#ley-de-gall)
|
||||
* [Cuchilla de Hanlon](#cuchilla-de-hanlon)
|
||||
* [Ley de Hofstadter](#ley-de-hofstadter)
|
||||
* [Ley de Hutber](#ley-de-hutber)
|
||||
* [El Ciclo de Sobreexpectación y la Ley de Amara](#el-ciclo-de-sobreexpectacion-y-la-ley-de-amara)
|
||||
* [Ley de Hyrum (La Ley de las Interfaces Implícitas)](#ley-de-hyrum-la-ley-de-las-interfaces-implicitas)
|
||||
* [Ley de Metcalfe](#ley-de-metcalfe)
|
||||
* [Ley de Moore](#ley-de-moore)
|
||||
* [Ley de Murphy / Ley de Sod](#ley-de-murphy--ley-de-sod)
|
||||
* [Ley de Parkinson](#ley-de-parkinson)
|
||||
* [Efecto de Optimización Prematura](#efecto-de-optimizacion-prematura)
|
||||
* [Ley de Putt](#ley-de-putt)
|
||||
* [Ley de Reed](#ley-de-reed)
|
||||
* [Ley de Conservación de Complejidad (Ley de Tesler)](#ley-de-conservacion-de-complejidad-ley-de-tesler)
|
||||
* [Ley de Abstracciones Permeables](#ley-de-abstracciones-permeables)
|
||||
* [Ley de la Trivialidad](#ley-de-la-trivialidad)
|
||||
* [Filosofía Unix](#filosofia-unix)
|
||||
* [El Modelo Spotify](#el-modelo-spotify)
|
||||
* [Ley de Wadler](#ley-de-wadler)
|
||||
* [Principios](#principios)
|
||||
* [El Principio de Dilbert](#el-principio-de-dilbert)
|
||||
* [El Principio de Pareto (La Regla 80/20)](#el-principio-de-pareto-la-regla-8020)
|
||||
* [El Principio de Peter](#el-principio-de-peter)
|
||||
* [El Principio de la Robustez (Ley de Postel)](#el-principio-de-la-robustez-ley-de-postel)
|
||||
* [SOLID](#solid)
|
||||
* [El Principio de Única Responsabilidad](#el-principio-de-unica-responsabilidad)
|
||||
* [El Principio Abierto/Cerrado](#el-principio-abierto-cerrado)
|
||||
* [El Principio de Sustitución de Liskov](#el-principio-de-sustitucion-de-liskov)
|
||||
* [El Principio de Segregación de Interfaz](#el-principio-de-segregacion-de-interfaz)
|
||||
* [El Principio de Inversión de Dependencia](#el-principio-de-inversion-de-dependencia)
|
||||
* [El Principio DRY](#el-principio-dry)
|
||||
* [El Principio KISS](#el-principio-kiss)
|
||||
* [YAGNI](#yagni)
|
||||
* [Lista de Lectura](#lista-de-lectura)
|
||||
* [POR-HACER](#por-hacer)
|
||||
|
||||
<!-- vim-markdown-toc -->
|
||||
|
||||
## Introducción
|
||||
|
||||
Hay montones de leyes que la gente discute cuando habla sobre desarrollo. Este repositorio es una referencia y un resumen de algunos de los más conocidos. Por favor, ¡comparte y sube tus PRs!
|
||||
|
||||
❗: Este repositorio contiene una explicación sobre algunas leyes, principios y patrones, pero no _defendemos_ ninguno de ellos. Si estos pueden ser aplicados o no siempre será materia de debate y muy dependiente de en qué estés trabajando.
|
||||
|
||||
## Leyes
|
||||
|
||||
¡Y aquí vamos!
|
||||
|
||||
### Ley de Amdahl
|
||||
|
||||
[Ley de Amdahl en Wikipedia](https://es.wikipedia.org/wiki/Ley_de_Amdahl)
|
||||
|
||||
> La ley de Amdahl se puede interpretar de manera más técnica, pero en términos simples, significa que es el algoritmo el que decide la mejora de velocidad, no el número de procesadores. Finalmente se llega a un momento que no se puede paralelizar más el algoritmo.
|
||||
|
||||
Mejor lo ilustramos con un ejemplo. Si un programa se compone de dos partes, la parte A debe ser ejecutada en un solo procesador y la parte B puede ser paralelizada, entonces vemos que agregamos múltiples procesadores al sistema en ejecución ese programa puede solo tener un beneficio limitado. Este puede potencialmente mejorar mucho la velocidad de la parte B - pero la velocidad de la parte A se mantendrá sin cambios.
|
||||
|
||||
El diagrama de abajo muestra algunos ejemplos de mejoras potenciales en velocidad:
|
||||
|
||||

|
||||
|
||||
*(Imagen de Referencia: Por Daniels220 en Wikipedia, Creative Commons Attribution-Share Alike 3.0 Unported, https://en.wikipedia.org/wiki/File:AmdahlsLaw.svg)*
|
||||
|
||||
Como podemos ver, incluso un programa el cual es un 50% paralelizable se beneficiará muy poco más allá de 10 unidades de procesamiento, mientras que un programa el cual es 95% paralelizable todavía puede alcanzar mejoras significativas de velocidad con más de mil unidades de procesamiento.
|
||||
|
||||
A medida que la [Ley de Moore](#ley-de-moore) se ralentiza y la aceleración de la velocidad del procesador individual disminuye, la paralelización es la clave para incrementar el rendimiento. la paralelización es clave para mejorar el rendimiento. La programación de gráficos es un excelente ejemplo: con la informática moderna basada en Shader, píxeles individuales o fragmentos pueden ser renderizados en paralelo. Este es el porqué las tarjetas gráficas modernas en ocasiones disponen de miles de núcleos de procesamiento (GPUs o Unidades de Shader).
|
||||
|
||||
Vea también:
|
||||
|
||||
- [Ley de Brooks](#ley-de-brooks)
|
||||
- [Ley de Moore](#ley-de-moore)
|
||||
|
||||
### Ley de Brooks
|
||||
|
||||
[Ley de Brooks en Wikipedia](https://es.wikipedia.org/wiki/Ley_de_Brooks)
|
||||
|
||||
> Cuando se incorpora una persona en un proyecto, éste se ralentiza en lugar de acelerarse. Brooks también afirmó que "Nueve mujeres no pueden tener un bebé en un mes".
|
||||
|
||||
Esta ley sugiere que en muchos casos, intentar acelerar la entrega de un proyecto el cual ya va tarde, agregando más personas, hará que la entrega vaya aún más tarde. Brooks clarifica que esto es una simplificación, sin embargo, el razonamiento general es que el tiempo de aceleración de nuevos recursos y la sobrecarga de comunicación, en el inmediato corto plazo hace que la velocidad caiga. También, muchas tareas pueden no ser divisibles, es decir que pueden no ser fácilmente distribuibles entre más personas, significando que el potencial incremento de velocidad es incluso menor.
|
||||
|
||||
La frase común en entregas "Nueve mujeres no pueden tener un bebé en un mes" está relacionada a la Ley de Brooks, en particular, al hecho de que algunos tipos de trabajos no son divisibles ni paralelizables.
|
||||
|
||||
Este es el tema central del libro '[El Mítico Hombre Mes](#lista-de-lectura)'.
|
||||
|
||||
Vea también:
|
||||
|
||||
- [Marcha de la Muerte](#todo)
|
||||
- [Lista de Lectura: El Mítico Hombre Mes](#reading-list)
|
||||
|
||||
### Ley de Conway
|
||||
|
||||
[La Ley de Conway en Wikipedia](https://es.wikipedia.org/wiki/Ley_de_Conway)
|
||||
|
||||
Esta ley sugiere que los límites técnicos de un sistema reflejan la estructura de la organización. Es comúnmente referido a cuando se observan mejoras de una organización, la Ley de Conway sugiere que si una organización es estructurada en muchas unidades pequeñas y desconectadas, el software que producirá será así. Si una organización es construída más entorno a soluciones 'verticales' las cuales están orientadas alrededor de características o servicios, los sistemas de software también reflejarán esto.
|
||||
|
||||
Vea también:
|
||||
|
||||
- [El Modelo Spotify](#el-modelo-spotify)
|
||||
|
||||
### Ley de Cunningham
|
||||
|
||||
[Ley de Cunningham en Wikipedia](https://meta.wikimedia.org/wiki/Cunningham%27s_Law/es)
|
||||
|
||||
> La mejor forma de obtener la respuesta correcta en Internet no es hacer una pregunta, es enviar la respuesta errónea.
|
||||
|
||||
Acorde a Steven McGeady, Ward Cunningham le aconsejó a principios de los 80: "La mejor forma de obtener la respuesta correcta en Internet no es hacer una pregunta, es enviar una respuesta incorrecta." McGeady lo llamó la Ley de Cunningham, sin embargo Cunningham niega su propiedad diciendo que es una cita errónea. Aunque originalmente se refiere a las interacciones en Usenet, la ley ha sido usada para describir como otras comunidades online funcionan (e.g., Wikipedia, Reddit, Twitter, Facebook).
|
||||
|
||||
Vea también:
|
||||
|
||||
- [XKCD 386: "Duty Calls" (El Deber Llama)](https://xkcd.com/386/)
|
||||
|
||||
### El Número de Dunbar
|
||||
|
||||
[El Número de Dunbar en Wikipedia](https://es.wikipedia.org/wiki/N%C3%BAmero_de_Dunbar)
|
||||
|
||||
"El número de Dunbar es un límite cognitivo sugerido sobre el número de personas con las que puedes mantener relaciones sociables estables- relaciones en las que un individuo sabe quien es la otra persona and cómo cada persona se relaciona con cada una de las otras personas." Hay algún desacuerdo sobre el número exacto. "... [Dunbar] propuso que los humanos pueden mantener cómodamente solo 150 relaciones estables." El puso el número dentro de un contexto más social, "el número de personas con las que no sentirías vergüenza de invitarlas a tomar una copa
|
||||
"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, "la cantidad de personas de las que no te sentirías avergonzado por unirte sin invitación a tomar una copa si te topas con ellas en un bar." Estima que el número puede rondar generalmente entre 100 y 250.
|
||||
|
||||
Al igual que relaciones estables entre individuos, la relación de un desarrollador con su código base toma esfuerzo mantenerla. Cuando afrontas un gran número de proyectos complicados o creas muchos proyectos, nos apoyamos en convenciones, políticas y modelamos procedimientos para escalar. El número de Dunbar no es solo importante para tener en mente como una oficina crece, también cuando configuramos el alcance de los esfuerzos de un equipo o decidimos cuando debemos invertir en herramientas para asistir en el modelado y automatizar el sobregasto logístico. Poniendo el número en el contexto de ingeniería, es el número de proyectos (o complejidad normalizada de un único proyecto) para los cuales podrías sentirte seguro de unirte para las rondas de soporte telefónico.
|
||||
|
||||
Vea también:
|
||||
|
||||
- [Ley de Conway](#ley-de-conway)
|
||||
|
||||
### Ley de Gall
|
||||
|
||||
[Ley de Gall en Wikipedia (inglés)](https://en.wikipedia.org/wiki/John_Gall_(author)#Gall's_law)
|
||||
|
||||
> Un sistema complejo que funciona ha sido evolucionado invariablemente desde un sistema simple que funcionaba. Un sistema complejo diseñado desde cero nunca funcionará y no puede ser arreglado para que funcione. Tienes que comenzar de nuevo con un sistema simple que funcione.
|
||||
>
|
||||
> ([John Gall](https://en.wikipedia.org/wiki/John_Gall_(author)))
|
||||
|
||||
|
||||
La Ley de Gall implica que los intentos de _diseñar_ un sistema altamente complejo tenderán siempre a fallar. Sistemas altamente complejos son raramente construidos de una sola vez, estos suelen ser evoluciones de sistemas mucho más simples.
|
||||
|
||||
El ejemplo clásico es la World Wide Web (WWW). En su estado actual, es un sistema altamente complejo. Sin embargo, esta fue definida inicialmente como una forma simple de compartir contenido entre instituciones académicas. Esta fue un éxito cumpliendo sus objetivos y evolucionó para llegar a ser más compleja con el tiempo.
|
||||
|
||||
Vea también:
|
||||
|
||||
- [KISS (Keep It Simple, Stupid)](#el-principio-kiss)
|
||||
|
||||
### La Navaja de Hanlon
|
||||
|
||||
[La Navaja de Hanlon en Wikipedia](https://es.wikipedia.org/wiki/Principio_de_Hanlon)
|
||||
|
||||
> Nunca atribuyas a la malicia lo que puede ser adecuadamente explicado por la estupidez.
|
||||
>
|
||||
> Robert J. Hanlon
|
||||
|
||||
Este principio sugiere que las acciones resultantes en un resultado negativo no fueron resultado de una mala intención. En su lugar el resultado negativo es mejor atribuído a que esas acciones y/o el impacto no fueron completamente entendidos.
|
||||
|
||||
### Ley de Hofstadter
|
||||
|
||||
[Ley de Hofstadter en Wikipedia](https://es.wikipedia.org/wiki/Ley_de_Hofstadter)
|
||||
|
||||
> Siempre lleva más tiempo de lo que esperas, incluso si tienes en cuenta la Ley de Hofstadter.
|
||||
>
|
||||
> (Douglas Hofstadter)
|
||||
|
||||
Quizás hayas oído esta ley referida a cuando se busca estimar el tiempo que tomará algo. Esto parece una verdad absoluta en el desarrollo de software donde tendemos a no ser muy buenos estimando con precisión cuanto tiempo tomará entregar algo.
|
||||
|
||||
Esto proviene del libro '[Gödel, Escher, Bach: An Eternal Golden Braid](#lista-de-lectura)'.
|
||||
|
||||
Vea también:
|
||||
|
||||
- [Lista de lectura: Gödel, Escher, Bach: An Eternal Golden Braid](#lista-de-lectura)
|
||||
|
||||
### Ley de Hutber
|
||||
|
||||
[Ley de Hutber en Wikipedia (inglés)](https://en.wikipedia.org/wiki/Hutber%27s_law)
|
||||
|
||||
> Mejorar signfica deteriorar.
|
||||
>
|
||||
> ([Patrick Hutber (inglés)](https://en.wikipedia.org/wiki/Patrick_Hutber))
|
||||
|
||||
Esta ley sugiere que las mejoras realizadas en un sistema llevarán a su deterioro en otras partes, u ocultará otros deterioros, llevando a una degradación total del estado actual del sistema.
|
||||
|
||||
Por ejemplo, un decremento en la latencia de respuesta para un end-point particular podría causar problemas de rendimiento y capacidad de procesamiento más adelante en el flujo de peticiones, afectando a un subsistema completamente diferente.
|
||||
|
||||
### El Ciclo de Sobreexpectación y La Ley de Amara
|
||||
|
||||
[El Ciclo de Sobreexpectación](https://es.wikipedia.org/wiki/Ciclo_de_sobreexpectaci%C3%B3n)
|
||||
|
||||
> Tendemos a sobreestimar el efecto de una tecnología a corto plazo y subestimar su efecto a largo plazo.
|
||||
>
|
||||
> (Roy Amara)
|
||||
|
||||
El Ciclo de Sobreexpectación es una representación visual de la excitación y desarrollo de tecnología a lo largo del tiempo, originalmente producido por Gartner. Se explica mejor de forma visual:
|
||||
|
||||

|
||||
|
||||
*(Referencia de Imagen: Por Jeremykemp en Wikipedia, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=10547051)*
|
||||
|
||||
En pocas palabras, el ciclo sugiere que hay una típica burbuja de excitación alrededor de cada nueva tecnología y su impacto potencial. Los equipos a veces saltan rápidamente a emplear estas tecnologías y a veces se encuentran a sí mismos decepcionados con los resultados. Esto puede ser porque la tecnología no es aún lo suficientemente madura, o las aplicaciones del mundo real no están completamente desarrolladas. Después de cierto tiempo, las capacidades de la tecnología se incrementan y las oportunidades de ser empleada de forma práctica aumentan permitiendo a los equipos ser finalmente productivos. La frase de Roy Amara resume este hecho de forma breve - "Tendemos a sobreestimar el efecto de una tecnología a corto plazo y subestimarla a largo plazo".
|
||||
|
||||
### Ley de Hyrum (La Ley de las Interfaces Implícitas)
|
||||
|
||||
[Ley de Hyrum (inglés)](http://www.hyrumslaw.com/)
|
||||
|
||||
> Con un número suficiente de usuarios de una API,
|
||||
> no importa que prometas en el contrato:
|
||||
> alguien dependerá de todos los comportamientos observables
|
||||
> de tu sistema.
|
||||
>
|
||||
> (Hyrum Wright)
|
||||
|
||||
La Ley de Hyrum establece que cuando tienes un _número grande y suficiente de consumidores_ de una API, todos los comportamientos de la API (incluso aquellos no definidos como parte del contrato público) llegarán de forma eventual a ser dependencia de alguien. Un ejemplo trivial pueden ser los elementos no-funcionales como el tiempo de respuesta de una API. Un ejemplo más sutil puede ser qué consumidores están dependiendo en la aplicación de una expresión regular sobre un mensaje de error para determinar el *tipo* de error de una API. Incluso si el contrato público de la API no establece nada acerca del contenido del mensaje de error indicando a los usuarios que deben emplear un código de error, _algunos_ usuarios usarán el mensaje y cambiar el mensaje esencialmente romperá la API para estos usuarios.
|
||||
|
||||
Vea también:
|
||||
|
||||
- [La Ley de las Abstracciones Permeables](#la-ley-de-las-abstracciones-permeables)
|
||||
- [XKCD 1172](https://xkcd.com/1172/)
|
||||
|
||||
|
||||
### Ley de Metcalfe
|
||||
|
||||
[Ley de Metcalfe en Wikipedia (inglés)](https://en.wikipedia.org/wiki/Metcalfe's_law)
|
||||
|
||||
> En teoría de redes, el número en el que un sistema crece es aproximadamente el cuadrado del número de usuarios de ese sistema.
|
||||
|
||||
Esta ley está basada en el número de posibles conexiones por pares dentro de un sistema y está muy relacionado con [La Ley de Reed](#ley-de-reed). Odlyzko y otros han argumentado que ambas leyes (Reed y Metcalfe) exageran el valor de un sistema por no tener en cuenta los límites de la cognición humana en efectos de redes; vea [El Número de Dunbar](#numero-de-dunbar).
|
||||
|
||||
Vea también:
|
||||
- [Ley de Reed](#ley-de-reed)
|
||||
- [Número de Dunbar](#numero-de-dunbar)
|
||||
|
||||
### Ley de Moore
|
||||
|
||||
[Ley de Moore en Wikipedia](https://es.wikipedia.org/wiki/Ley_de_Moore)
|
||||
|
||||
> El número de transistores en un circuito integrado se dobla aproximadamente cada dos años.
|
||||
|
||||
A veces empleado para ilustrar la velocidad pura a la que un semiconductor y la tecnología de chips ha mejorado, la predicción de Moore probó ser altamente precisa desde los 70 hasta finales de la primera década de 2000. En los años recientes, la tendencia ha cambiado ligeramente, parcialmente debido a [las limitaciones físicas en el grado en el que los componentes pueden ser miniaturizados (inglés)](https://en.wikipedia.org/wiki/Quantum_tunnelling). Sin embargo, los avances en la paralelización y potencialmente los cambios revolucionarios en la tecnología de semiconductores y computación cuántica puedan significar que la Ley de Moore continúe siendo cierta en las siguientes décadas.
|
||||
|
||||
### Ley de Murphy / Ley de Sod
|
||||
|
||||
[Ley de Murphy en Wikipedia](https://es.wikipedia.org/wiki/Ley_de_Murphy)
|
||||
|
||||
> Si algo puede ir mal, irá mal.
|
||||
|
||||
Relacionado con [Edward A. Murphy, Jr](https://es.wikipedia.org/wiki/Edward_A._Murphy_Jr.) la _Ley de Murphy_ establece que si algo puede ir mal, irá mal.
|
||||
|
||||
Este dicho es muy común entre desarrolladores. A veces algo inesperado sucede cuando se desarrolla, se hacen pruebas o incluso en producción. Esto puede relacionarse también a la (más común en inglés británico) _Ley de Sod_:
|
||||
|
||||
> Si algo puede ir mal, irá mal, en el peor momento posible.
|
||||
|
||||
Estas leyes son generalmente empleadas en sentido cómico. Sin embargo, tales fenómenos como la [_Sesgo de Confirmación_](#por-hacer) y [_Sesgo de Selección_](#por-hacer) pueden llevar a la gente a sobre-enfatizar estas leyes (la mayoría de las veces cuando las cosas funcionan, estas pasan sin tenerse en cuenta, mientras que los fallos son muy notalbes y entran más en las conversaciones).
|
||||
|
||||
Vea también:
|
||||
|
||||
- [Sesgo de Confirmación](#por-hacer)
|
||||
- [Sesgo de Selección](#por-hacer)
|
||||
|
||||
### Ley de Parkinson
|
||||
|
||||
[Ley de Parkinson en Wikipedia](https://es.wikipedia.org/wiki/Ley_de_Parkinson)
|
||||
|
||||
> El trabajo se expande hasta llenar el tiempo disponible para que se termine.
|
||||
|
||||
En su contexto original, esta Ley se basó en estudios de burocracias. Esta podía ser aplicada de forma pesimista a las iniciativas de desarrollo de software, la teoría sería que los equipos serán ineficientes hasta que la fecha de entrega esté cerca, entonces se apresurarán a completar el trabajo para la entrega, haciendo la fecha de entrega real de algún modo arbitraria.
|
||||
|
||||
Si esta ley se combina con la [Ley de Hofstadter](#ley-de-hofstadter), un punto de vista incluso más pesimista es alcanzado - el trabajo se expandirá hasta rellenar el tiempo disponible para su compleción y *aún tomará más tiempo del esperado*.
|
||||
|
||||
Vea también:
|
||||
|
||||
- [Ley de Hofstadter](#ley-de-hofstadter)
|
||||
|
||||
### Efecto de Optimización Prematura
|
||||
|
||||
[Optimización Prematura en Wikipedia](https://es.wikipedia.org/wiki/Optimizaci%C3%B3n_de_software#Cu%C3%A1ndo_optimizar)
|
||||
|
||||
> Debemos olvidar las pequeñas eficiencias, por ejemplo, el 97% del tiempo: la optimización prematura es la raíz de todos los males.
|
||||
>
|
||||
> [(Donald Knuth, diciembre de 1974)](https://twitter.com/realdonaldknuth)
|
||||
|
||||
En el documento de Donald Knuth titulado [Programación Estructurada con Mandatos Go To (inglés)](http://wiki.c2.com/?StructuredProgrammingWithGoToStatements), escribió: "Los programadores desperdician enormes cantidades de tiempo pensando o preocupándose acerca de la velocidad de partes no-críticas de sus programas, y esos intentos de eficiencia en realidad tienen un impacto negativo cuando consideramos la depuración o el mantenimiento. Debemos olvidar las pequeñas eficiencias, por ejemplo, el 97% del tiempo: **la optimización prematura es la raíz de todos los males**. Aunque no debemos dejar pasar nuestras oportunidades en ese crítico 3%."
|
||||
|
||||
Sin embargo, _Premature Optimization_ puede ser definido (en términos menos cargados) como nosotros sabemos lo que tenemos que hacer.
|
||||
|
||||
### Ley de Putt
|
||||
|
||||
[Ley de Putt (inglés)](https://en.wikipedia.org/wiki/Putt%27s_Law_and_the_Successful_Technocrat)
|
||||
|
||||
> La Tecnología es dominada por dos tipos de personas, aquellos quienes comprenden lo que no controlan y aquellos quienes controllan lo que no entienden.
|
||||
|
||||
La Ley de Putt a veces es seguida por el Corolario de Putt:
|
||||
|
||||
> Cada jerarquía técnica, con el tiempo, desarrolla una inversión de competencia.
|
||||
|
||||
Estos mandatos sugieren que debido a varios criterios de selección y tendencias en cómo los grupos se organizan, habrá un número de personas cualificadas en los niveles de trabajo de una organización técnica y una cantidad de personas en roles directivos que no son conscientes de las complejidades y desafíos del trabajo que están manejando. Esto puede ser debido al fenómenos tales como [El Principio de Peter](#el-principio-de-peter) o [El Principio de Dilbert](#el-principio-de-dilbert).
|
||||
|
||||
Sin embargo, debe enfatizarse que leyes como esta son generalizaciones amplias y pueden aplicarse a _algunos_ tipos de organizaciones y no a otras.
|
||||
|
||||
Vea también:
|
||||
|
||||
- [El Principio de Peter](#el-principio-de-peter)
|
||||
- [El Principio de Dilbert](#el-principio-de-dilbert)
|
||||
|
||||
### La Ley de Reed
|
||||
|
||||
[La Ley de Reed en Wikipedia (inglés)](https://en.wikipedia.org/wiki/Reed's_law)
|
||||
|
||||
> La utilidad de redes grandes, particularmente redes sociales, escala exponencialmente con el tamaño de la red.
|
||||
|
||||
Esta ley está basada en la teoría de grafos, donde la utilidad escala como el número de posibles sub-grupos, el cuál es más rápido que el número de participantes o el número de posibles conexiones p
|
||||
Esta ley se basa en la teoría de grafos, donde la utilidad se escala como el número de subgrupos posibles, que es más rápido que el número de participantes o el número de posibles conexiones por pares. Odlyzko y otros han argumentado que la Ley de Reed exagera la utilidad del sistema al no tener en cuenta los límites de la cognición humana sobre los efectos de la red; ver [El Número de Dunbar](#numero-de-dunbar).
|
||||
|
||||
See also:
|
||||
- [La Ley de Metcalfe's Law](#metcalfes-law)
|
||||
- [Número de Dunbar](#numero-de-dunbar)
|
||||
|
||||
### Ley de Conservación de Complejidad (Ley de Tesler)
|
||||
|
||||
[La Ley de Conservación de Complejidad en Wikipedia (inglés)](https://en.wikipedia.org/wiki/Law_of_conservation_of_complexity)
|
||||
|
||||
Esta ley establece que hay una cierta cantidad de complejidad en un sistema la cuál no puede ser reducida.
|
||||
|
||||
Cierta complejidad en un sistema puede ser 'involuntaria'. Es consecuencia de una estructura deficiente, errores o tan solo un mal modelo de un problema a resolver. La complejidad involuntaria puede ser reducida (o eliminada). Sin embargo, cierta complejidad es 'intrínseca' como consecuencia de la complejidad inherente de un problema que se está resolviendo. Esta complejidad puede ser desplazada, pero no eliminada.
|
||||
|
||||
Un elemento interesate de esta ley es la sugerencia de que incluso simplificando el sistema entero, la complejidad intrínseca no se reduce, esta se _desplaza hacia el usuario_, el cuál debe comportarse de una forma compleja.
|
||||
|
||||
### Ley de las Abstracciones Permeables
|
||||
|
||||
[La Ley de las Abstracciones Permeables en Joel on Software (inglés)](https://www.joelonsoftware.com/2002/11/11/the-law-of-leaky-abstractions/)
|
||||
|
||||
> Toda abstracción no trivial, en algún grado, es permeable.
|
||||
>
|
||||
> ([Joel Spolsky](https://twitter.com/spolsky))
|
||||
|
||||
Esta ley establece que las abstracciones, las cuales son generalmente usadas en computación para simplificar el trabajo con sistemas complicados, en ciertas situaciones 'filtrarán' sus elementos a un sistema subyacente, haciendo que la abstracción se comporte de una forma inesperada.
|
||||
|
||||
Un ejemplo puede ser la carga de un fichero y lectura de sus contenidos. Las APIs del sistema de ficheros son una _abstracción_ del bajo nivel de los sistemas del kernel, los cuales son en sí mismos abstracciones de los procesos físicos relacionados con el cambio de información en un disco magnético (o memoria flash para un SSD). En la mayoría de los casos, funcionará la abstracción de tratar al fichero como un flujo de datos binarios. Sin embargo, para un disco magnético, leer datos secuenciales puede ser *significativamente* más rápido que los accesos aleatorios (debido al aumento de la sobrecarga de fallas), pero no para un disco SSD donde este aumento no estará presente. Los detalles subyacentes necesitarán ser entendidos para tratar cada caso (por ejemplo, índices de base de datos son estructurados para reducir la sobrecarga del acceso aleatorio), la abstracción 'filtra' detalles de la implementación al desarrollador que pueda necesitar tener en cuenta.
|
||||
|
||||
El ejemplo anterior puede llegar a ser aún más complejo cuando _más_ abstracciones sean introducidas. El sistema operativo Linux permite acceder a ficheros en red pero representados de forma local como ficheros 'normales'. Esta abstracción 'filtrará' si hay errores de red. Si un desarrollador trata estos ficheros como 'normales', sin considerar el hecho de que puedan estar sujetos a latencia de red y fallos, las soluciones serán defectuosas.
|
||||
|
||||
El artículo que describe esta ley sugiere que una dependenica excesiva de abstracciones, combinada con un entendimiento deficiente del proceso subyacente, en realidad hace que tratar con el problema sea _más_ complejo en algunos casos.
|
||||
|
||||
Vea también:
|
||||
|
||||
- [Ley de Hyrum](#ley-de-hyrum-la-ley-de-las-interfaces-implicitas)
|
||||
|
||||
Ejemplos del Mundo-Real:
|
||||
|
||||
- [Inicio lento en Photoshop (inglés)](https://forums.adobe.com/thread/376152) - un problema que encontré en el pasado. Photoshop podría tener un inicio lento, algunas veces tomando incluso minutos. Parece que el problema fue debido a que al inicio lee cierta información sobre la impresora por defecto. Sin embargo, si la impresora está en red, esto puede tomar mucho tiempo. La _abstracción_ de una impresora en red siendo presentada al sistema de forma similar a una impresora local causó un problema para usuarios en situaciones de conectividad de red deficiente.
|
||||
|
||||
### Ley de la Trivialidad
|
||||
|
||||
[Ley de la Trivialidad en Wikipedia (inglés)](https://en.wikipedia.org/wiki/Law_of_triviality)
|
||||
|
||||
Esta ley sugiere que los grupos invertirán mucho más tiempo y atención a problemas triviales y cosméticos que a problemas serios y sustanciales.
|
||||
|
||||
El ejemplo común y ficticio usado para ilustrarlo es que un comité aprobando planes para una planta nuclear invertirá la mayor parte del tiempo discutiendo la estructura del aparcamiento de bicicletas que diseños mucho más importantes para la planta nuclear en sí misma. Puede ser difícil hacer aportes valiosos en las discusiones sobre temas muy grandes y complejos sin un alto grado de experiencia y preparación en el tema. Sin embargo, la gente quiere ser vista contribuyendo de forma valiosa. De ahí la tendencia a enfocarse demasiado en detalles pequeños, los cuales pueden ser razonados fácilmente, pero no necesariamente de particular importancia.
|
||||
|
||||
El ejemplo ficticio de arriba nos lleva al uso del término 'Aparcamiento de Bicicletas' (Bike Shedding) como una expresión para el desperdicio del tiempo en detalles triviales.
|
||||
|
||||
### Filosofía Unix
|
||||
|
||||
[La Filosofía Unix en Altenwald](https://altenwald.org/2008/09/22/filosofia-unix/)
|
||||
|
||||
La Filosofía Unix es que los componentes de software debe ser pequeños y enfocados en hacer tan solo una cosa bien. Esto puede hacer más fácil construir sistemas a través de la composición conjunta de pequeñas, simples y bien definidas unidades mejor que usar programas grandes, complejos y multi-propósito.
|
||||
|
||||
Prácticas modernas como 'Arquitectura de Microservicios' pueden ser pensadas como una aplicación de esta ley, donde los servicios son pequeños, enfocados y hacen una cosa específica, permitiendo componer comportamientos más complejos compuestos de bloques de construcción simples.
|
||||
|
||||
### El Modelo Spotify
|
||||
|
||||
[El Modelo Spotify en Spotify Labs (inglés)](https://labs.spotify.com/2014/03/27/spotify-engineering-culture-part-1/)
|
||||
|
||||
El Modelo Spotify es un enfoque a una estructura de organización la cual ha sido popularizada por 'Spotify'. En este modelo, los equipos son organizados alrededor de características en lugar de tecnologías.
|
||||
|
||||
El Modelo Spotify también popularizó los conceptos de Tribus, Gremios y Capítulos, los cuales son otros componentes de su estructura de organización.
|
||||
|
||||
### Ley de Wadler
|
||||
|
||||
[Ley de Wadler en wiki.haskell.org (inglés)](https://wiki.haskell.org/Wadler's_Law)
|
||||
|
||||
> En cualquier diseño de lenguaje, el total de tiempo invertido en discutir una característica en su lista es proporcional a dos elevado a la potencia de su posición:
|
||||
>
|
||||
> 0. Semántica
|
||||
> 1. Sintaxis
|
||||
> 2. Sintaxis Léxica
|
||||
> 3. Sintaxis Léxica de Comentarios
|
||||
>
|
||||
> (En pocas palabras, por cada hora invertida en semántica, 8 horas serán invertidas en la sintaxis de los comentarios).
|
||||
|
||||
Similar a [La Ley de la Trivialidad](#ley-de-la-trivialidad), la Ley de Walder establece que cuando un se diseña un lenguaje, la cantidad de horas invertida en las estructuras del lenguaje es desproporcionadamente alta en comparación a la importancia de estas características.
|
||||
|
||||
Vea también:
|
||||
|
||||
- [La Ley de la Trivialidad](#ley-de-la-trivialidad)
|
||||
|
||||
## Principios
|
||||
|
||||
Los Principios son generalmente más propensos a ser pautas relacionadas al diseño.
|
||||
|
||||
### El Principio de Dilbert
|
||||
|
||||
[El Principio de Dilbert en Wikipedia (inglés)](https://en.wikipedia.org/wiki/Dilbert_principle)
|
||||
|
||||
> Las compañías tienden sistémicamente a promocionar empleados incompetentes a dirección para eliminarlos del flujo de trabajo.
|
||||
>
|
||||
> _Scott Adams_
|
||||
|
||||
Un concepto de administración desarrollado por Scott Adams (creador de la tira cómica de Dilbert), el Principio de Dilbert está inspirado por [El Principio de Peter](#el-principio-de-peter). Bajo el Principio de Dilbert, los empleados que nunca fueron competentes son promocionados a cargos directivos para limitar el daño que pueden hacer. Adams primero explicó el principio en 1995 en un artículo del Wall Street Journal y lo expandió en su libro de negocios publicado en 1996, [The Dilbert Principle (inglés)](#lista-de-lectura).
|
||||
|
||||
Vea también:
|
||||
|
||||
- [El Principio de Peter](#el-principio-de-peter)
|
||||
- [Ley de Putt](#ley-de-putt)
|
||||
|
||||
### El Principio de Pareto (La Regla 80/20)
|
||||
|
||||
[El Principio de Pareto en Wikipedia](https://es.wikipedia.org/wiki/Principio_de_Pareto)
|
||||
|
||||
> La mayoría de cosas en la vida no se distribuyen de forma uniforme.
|
||||
|
||||
El Principio de Pareto sugiere que en algunos casos, la mayoría de los resultados vienen de la minoría de entradas:
|
||||
|
||||
- El 80% de un cierto trozo de software puede ser escrito con el 20% del total de tiempo asignado (a la inversa, el 20% del código más difícil toma el 80% del tiempo).
|
||||
- El 20% del esfuerzo produce el 80% del resultado
|
||||
- El 20% del trabajo crea el 80% de los ingresos
|
||||
- El 20% de los fallos causa el 80% de los problemas
|
||||
- El 20% de las características se emplean 80% más que el resto
|
||||
|
||||
En los años 1940s el ingeniero americano-romaní Dr. Joseph Juran, quien es ampliamente reconocido por atribuírsele ser el padre del control de calidad, [comenzó a aplicar el principio de Pareto a problemas de calidad](https://es.wikipedia.org/wiki/Joseph_Juran).
|
||||
|
||||
Este principio es también conocido como: La Regla 80/20, La Ley de los Pocos Vitales y el Principio del Factor de Escasez.
|
||||
|
||||
Ejemplos del Mundo-Real:
|
||||
|
||||
- En 2002 Microsoft reportó que arreglando el 20% de los errores más reportados, 80% de los errores relacionados y los crashes en Windows y Office habían sido eliminados ([Referencia (en inglés)](https://www.crn.com/news/security/18821726/microsofts-ceo-80-20-rule-applies-to-bugs-not-just-features.htm)).
|
||||
|
||||
### El Principio de Peter
|
||||
|
||||
[El Principio de Peter en Wikipedia](https://es.wikipedia.org/wiki/Principio_de_Peter)
|
||||
|
||||
> La gente en una jerarquía tiende a ascender hasta su "nivel de incompetencia".
|
||||
>
|
||||
> _Laurence J. Peter_
|
||||
|
||||
Un concepto de administración de Laurence J. Peter, el Principio de Peter observa que la gente que es buena en sus trabajos es promocionada hasta llegar a un nivel donde ya no son tan exitosos (su "nivel de incompetencia"). En este punto, como ellos son más _senior_, son menos propensos a ser eliminados de la organización (a menos que su rendimiento sea espectacularmente malo) y continuarán en un rol en el que tienen pocas habilidades intrínsecas. Las habilidades que les hicieron exitosos no son necesariamente las habilidades requeridas para sus nuevos puestos.
|
||||
|
||||
Este es de particular interés para los ingenieros - quienes inicialmente comienzan en roles profundamente técnicos, pero a veces tienen una carrera la cual les guía a _administrar_ a otros ingenieros - los cuales requieren un conjunto fundamentalmente diferente de habilidades.
|
||||
|
||||
Vea también:
|
||||
|
||||
- [El Principio de Dilbert](#el-principio-de-dilbert)
|
||||
- [La Ley de Putt](#ley-de-putt)
|
||||
|
||||
### El Principio de Robustez (Ley de Postel)
|
||||
|
||||
[El Principio de Robustez en Wikipedia (inglés)](https://en.wikipedia.org/wiki/Robustness_principle)
|
||||
|
||||
> Sé conservador en lo que haces y liberal con lo que recibes de otros.
|
||||
|
||||
A veces aplicado en desarrollo de aplicaciones de servidor, este principio establece que lo que tú envias a otros debe ser tan mínimo y consensuado como sea posible, pero lo que deberías tener como objetivo es permitir la entrada no consensuada si es que puede ser procesada.
|
||||
|
||||
El objetivo de este principio es construir sistemas los cuales sean robustos, tanto que puedan manejar entradas algo deficientes si aún pueden ser entendidas. Sin embargo, hay potenciales implicaciones de seguridad acerca de aceptar entradas mal formadas, particularmente si el procesamiento de tales entradas no ha sido bien testeado.
|
||||
|
||||
### SOLID
|
||||
|
||||
Este es un acrónimo el cual se refiere a:
|
||||
|
||||
* S: [El Principio de Responsabilidad Única](#principio-de-responsabilidad-unica) (S por _Single Responsability_ del inglés)
|
||||
* O: [El Principio Abierto/Cerrado](#principio-abierto-cerrado) (O por _Open/Close_)
|
||||
* L: [El Principio de Sustitución de Liskov](#principio-de-sustitucion-de-liskov) (L por _Liskov_)
|
||||
* I: [El Principio de Segregación de Interfaces](#principio-de-segregacion-de-interfaces) (I por _Interfaces Segregation_)
|
||||
* D: [El Principio de Inversión de Dependencia](#principio-de-inversion-de-dependencia)
|
||||
|
||||
Estos son los principios clave en la [Programación Orientada a Objetos](#por-hacer). Los principios de diseño tales como estos deben servir de ayuda a desarrolladores para construir sistemas más mantenibles.
|
||||
|
||||
### Principio de Responsabilidad Única
|
||||
|
||||
[El Principio de Responsabilidad Única en Wikipedia](https://es.wikipedia.org/wiki/Principio_de_responsabilidad_%C3%BAnica)
|
||||
|
||||
> Cada módulo o clase debe tener una tan solo una única responsabilidad.
|
||||
|
||||
El primero de los principios '[SOLID](#solid)'. Este principio sugiere que los módulos o clases deben hacer una única cosa y solo una. En términos más prácticos, esto quire decir que una único, pequeño cambio a una característica de un programa debe requerir un cambio en un solo componente. Por ejemplo, cambiar como una contraseña es validada por complejidad debe requerir un cambio en solo una parte del programa.
|
||||
|
||||
Teóricamente, esto debe hacer el código más robusto (sólido) y fácil de cambiar. Sabiendo que un componente el cual está siendo modificado tiene una única responsabilidad sólo significa que _comprobar_ ese cambio dede ser más fácil. Usando el ejemplo anterior, cambiar el componente de complejidad de la contraseña debe solo afectar a las características relacionadas con la complejidad de la contraseña. Puede ser mucho más difícil tener en cuenta el impacto de un cambio en un componente el cual tiene muchas responsabilidades.
|
||||
|
||||
Vea también:
|
||||
|
||||
- [Programación Orientada a Objetos](#por-hacer)
|
||||
- [SOLID](#solid)
|
||||
|
||||
### Principio de Abierto/Cerrado
|
||||
|
||||
[Principio de Abierto/Cerrado](https://es.wikipedia.org/wiki/Principio_de_abierto/cerrado)
|
||||
|
||||
> Las entidades deben estar abiertas para ser extendidas y cerradas para ser modificadas.
|
||||
|
||||
El segundo de los principios '[SOLID](#solid). Este principio establece que las entidades (las cuales pueden ser clases, módulos, funciones u otras similares) deben tener la capacidad para ser _extendidas_ (ampliadas), pero de la misma forma debe _existir_ en su comportamiento la capacidad de no ser modificadas.
|
||||
|
||||
Como un ejemplo hipotético, imagina un módulo el cual es capaz de convertir un documento Markdown en uno HTML. Si el módulo puede ser ampliado para manejar nuevas características de Markdown, sin modificar el funcionamiento interno del módulo, entonces podemos decir que está abierto para ser ampliado para su extensión. Si el módulo _no_ pudiera ser modificado por un consumidor de manera que se manejen las características existentes de Markdown, entonces se_cierra_ para su modificación.
|
||||
|
||||
Este principio tiene una relevancia particular para la programación orientada a objetos, donde el diseño de objetos puede ser extendido (a través de la herencia), pero evitaríamos diseñar objetos los cuales puedan cambiar su comportamiento existente de formas inesperadas.
|
||||
|
||||
Vea también:
|
||||
|
||||
- [Programación Orientada a Objetos](#por-hacer)
|
||||
- [SOLID](#solid)
|
||||
|
||||
### Principio de Sustitución de Liskov
|
||||
|
||||
[El Principio de Sustitución de Liskov en Wikipedia](https://es.wikipedia.org/wiki/Principio_de_sustituci%C3%B3n_de_Liskov)
|
||||
|
||||
> Debe ser posible reemplazar un tipo con un subtipo, sin romper el sistema.
|
||||
|
||||
El tercero de los principios '[SOLID](#solid)'. Este principio establece que si un componente se basa en un tipo, entonces debe ser capaz de usar subtipos de ese tipo, sin que el sistema falle o tenga constancia de los detalles de que es un subtipo.
|
||||
|
||||
Como un ejemplo, imagina que tenemos un método el cual lee un documento XML desde una estructura la cual representa un fichero. Si el método usa un tipo base 'fichero', entonces cualquiera que derive de 'fichero' debe ser capaz de ser usado en la función. Si 'fichero' soporta la búsqueda inversa, y el parseador de XML usa esa función, y entonces el tipo derivado 'fichero de red' falla cuando intenta una búsqueda inversa, el tipo derivado 'fichero de red' violaría el principio.
|
||||
|
||||
Este principio tiene particular relevancia en programación orientada a objetos, donde la jerarquía de tipos debe ser modelada con cuidado para evitar confundir a los usuarios de un sistema.
|
||||
|
||||
Vea también:
|
||||
|
||||
- [Programación Orientada a Objetos](#por-hacer)
|
||||
- [SOLID](#solid)
|
||||
|
||||
### Principio de Segregación de Interfaces
|
||||
|
||||
[El Principio de la Segregación de Interfaces en Wikipedia](https://es.wikipedia.org/wiki/Principio_de_segregaci%C3%B3n_de_la_interfaz)
|
||||
|
||||
> Ningún cliente debe ser forzado a depender de métodos que no use.
|
||||
|
||||
El cuarto de los principios de '[SOLID](#solid)'. Este principio establece que los consumidores de un componente no deben depender en funciones de ese componente que no estén empleando.
|
||||
|
||||
Como un ejemplo, imagina que tenemos un método el cual lee un documento XML de una estructura la cual representa un fichero. Este solo necesita leer bytes, moverse adelante y atrás en el fichero. Si este método necesita ser actualizado porque una característica no relacionada al fichero cambia (tal como una actualización al modelo de permisos usado para representar la seguridad del fichero), entonces el principio queda invalidado. Sería mejor para el fichero implementar una interfaz 'flujo-con-búsqueda' y emplearla para el lector XML.
|
||||
|
||||
El principio tiene particular relevancia en programación orientada a objetos, donde las interfaces, jerarquías y abstracciones de tipos son usados para [minimizar el acoplamiento](#por-hacer) entre los diferentes componentes. [La tipificación dinámica](#por-hacer) (más conocida como _Duck typing_ en inglés) es una metodología que fuerza este principio eliminando las interfaces explícitas.
|
||||
|
||||
Vea también:
|
||||
|
||||
- [Programación Orientada a Objetos](#por-hacer)
|
||||
- [SOLID](#solid)
|
||||
- [Tipificación dinámica](#por-hacer) (_Duck typing_)
|
||||
- [Desacoplado](#por-hacer)
|
||||
|
||||
### Principio de Inversión de Dependencia
|
||||
|
||||
[El Principio de Inversión de Dependencia en Wikipedia (inglés)](https://en.wikipedia.org/wiki/Dependency_inversion_principle)
|
||||
|
||||
> Módulos de alto-nivel no deben depender en implementaciones de bajo nivel.
|
||||
|
||||
El quinto de los principios '[SOLID](#solid)'. Este principio establece que la orquestación de componentes del más alto nivel deben no tener conocimiento de los detalles de sus dependencias.
|
||||
|
||||
Como un ejemplo, imagina que tenemos un programa que lee metadatos de un sitio web. Asumimos que el componente principal pueda tener que saber acerca de un componente de descarga del contenido de la página web y luego un componente que pueda leer los metadatos. Si tenemos la inversión de dependenicas en mente, el componente principal dependerá solo de un componente abstracto el cual obtendrá los bytes de datos y luego un componente abstracto que será capaz de leer los metadatos del flujo de bytes. El componente principal no sabrá nada acerca de TCP/IP, HTTP, HTML, etc.
|
||||
|
||||
Este principio es complejo, puede ser visto como 'inverso' a las dependencias esperadas de un sistema (de ahí el nombre). En la práctica, esto también significa que se separa la orquestación de un componente y debe asegurarse la implementación correcta de los tipos abstractos que son empleados (e.g. en el ejemplo anterior, _algo_ debe aún proporcionar el componente de lectura de los metadatos un descargador de ficheros HTTP y un lector de etiquetas meta de HTML). Este entonces toca patrones tales como [Inversión de Control](#por-hacer) y [Inyección de Dependencias](#por-hacer).
|
||||
|
||||
Vea también:
|
||||
|
||||
- [Programación Orientada a Objetos](#por-hacer)
|
||||
- [SOLID](#solid)
|
||||
- [Inversión de Control](#por-hacer)
|
||||
- [Inyección de Dependencias](#por-hacer)
|
||||
|
||||
### Principio DRY
|
||||
|
||||
[El Principio DRY en Wikipedia](https://es.wikipedia.org/wiki/No_te_repitas)
|
||||
|
||||
> Cada pieza de conocimiento debe tener una representación única, no ambigua y autoritaria dentro de un sistema.
|
||||
|
||||
DRY es el acrónimo en inglés para _Don't Repeat Yourself_ (No te repitas). Este principio se enfoca en ayudar a los desarrolladores a reducir las repeticiones de código y mantener la información en un único lugar y fue citado en 1999 por Andrew Hunt y Dave Thomas en el libro [The Pragmatic Developer](https://en.wikipedia.org/wiki/The_Pragmatic_Programmer) (El Desarrollador Pragmático).
|
||||
|
||||
> Lo contrario a DRY sería _WET_ (Write Everthing Twice, escribe todo dos veces o We Enjoy Typing, disfrutamos escribiendo)
|
||||
|
||||
En la práctica, si tienes el mismo trozo de información en dos (o más) sitios diferentes, puedes usar DRY para mezclarlo en uno solo y reusarlo en cualquier lugar que lo quieras/necesites.
|
||||
|
||||
Vea también:
|
||||
|
||||
- [The Pragmatic Developer](https://en.wikipedia.org/wiki/The_Pragmatic_Programmer)
|
||||
|
||||
### Principio KISS
|
||||
|
||||
[KISS en Wikipedia](https://es.wikipedia.org/wiki/Principio_KISS)
|
||||
|
||||
> Keep it simple, stupid (Mantenlo simple, estúpido)
|
||||
|
||||
El principio KISS establece que la mayoría de los sistemas funcionan mejor si se mantienen simples en lugar de complejos; por lo tanto, simplicidad debe ser el objetivo clave en el diseño y la complejidad innecesaria debe ser evitada. Originado en las fuerzas armadas de los Estados Unidos (U.S. Navy) en 1960, la frase ha sido asociada con la ingeniera aérea Kelly Johnson.
|
||||
|
||||
El principio es mejor ejemplificado por la historia de Johnson manejando un equipo de ingenieros de diseño de herramientas, con el desafío del jet aircraft ellos debían diseñar sobretodo que fuese reparable por un mecánico medio en el campo y en condiciones de combate con solo esas herramientas. De aquí el "estúpido" refiriéndose a la relación entre la forma en que las cosas se rompen y la sofisticación de las herramientas disponibles para repararlas, no las capacidades de los ingenieros en sí mismos.
|
||||
|
||||
Vea también:
|
||||
|
||||
- [Ley de Gall](#ley-de-gall)
|
||||
|
||||
### YAGNI
|
||||
|
||||
[YAGNI en Wikipedia](https://es.wikipedia.org/wiki/YAGNI)
|
||||
|
||||
Este es un acrónimo para (en inglés) _**Y**ou **A**ren't **G**onna **N**eed **I**t_ o _No vas a necesitarlo_.
|
||||
|
||||
> Siempre implementar cosas cuando vayas a necesitarlas realmente, nunca cuando preveas que las necesitarás.
|
||||
>
|
||||
> ([Ron Jeffries](https://twitter.com/RonJeffries)) (XP co-fundador y autor del libro "Extreme Programming Installed")
|
||||
|
||||
Este principio de _Extreme Programming_ (XP) sugiere a los desarrolladores que deben solo implementar funcionalidad que es necesaria para los requisitos inmediatos y evitar los intentos de predecir el futuro implementando funcionalidades que podrían necesitarse luego.
|
||||
|
||||
Adherirse a este principio debe reducir la cantidad de código sin usar en la base de código y evitar tiempo y esfuerzo de ser malgastado en funcionalidades que no aportan valor.
|
||||
|
||||
Vea también:
|
||||
|
||||
- [Lista de lectura: Extreme Programming Installed](#lista-de-lectura)
|
||||
|
||||
|
||||
## Lista de Lectura
|
||||
|
||||
Si has encontrado estos conceptos interesantes, puede que disfrutes estos libros:
|
||||
|
||||
- [Extreme Programming Installed - Ron Jeffries, Ann Anderson, Chet Hendrikson](https://www.goodreads.com/en/book/show/67834) - Covers the core principles of Extreme Programming.
|
||||
- [El Mítico Hombre Mes](https://es.wikipedia.org/wiki/El_M%C3%ADtico_Hombre-Mes) - [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.
|
||||
- [The Dilbert Principle - Adam Scott](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-principl).
|
||||
- [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).
|
||||
|
||||
## Por Hacer
|
||||
|
||||
¡Hola! Si llegaste aquí es porque hiciste clic en un enlace a un tema que aún no ha sido escrito, perdón por eso, ¡este es aún un trabajo en proceso!
|
||||
|
||||
Sé libre de [Abrir un _Issue_](https://github.com/manuel-rubio/hacker-laws/issues) para solicitar más detalles, o [abre una petición de cambio (_pull request_)](https://github.com/manuel-rubio/hacker-laws/pulls) para enviar tus definiciones propuestas acerca del asunto.
|
||||
783
translations/lv.md
Normal file
783
translations/lv.md
Normal file
@@ -0,0 +1,783 @@
|
||||
# 💻 📖 hacker-laws
|
||||
|
||||
[](https://gitlocalize.com/repo/2513/whole_project?utm_source=badge)
|
||||
|
||||
Likumi, teorijas, principi un apraksti, kas izstrādātājiem šķitīs noderīgi.
|
||||
|
||||
- 🇨🇳 [中文/Chinese Version](https://github.com/nusr/hacker-laws-zh) - paldies [Steve Xu](https://github.com/nusr)!
|
||||
- 🇮🇹 [traduzione Italiano](https://github.com/dwmkerr/hacker-laws/blob/master/translations/it-IT.md) - paldies [Claudio Sparpaglione](https://github.com/csparpa)!
|
||||
- 🇰🇷 [한국어/korejiešu versija](https://github.com/codeanddonuts/hacker-law-kr) - paldies [Doughnut](https://github.com/codeanddonuts)!
|
||||
- 🇷🇺 [Русская версия/Krievijas versija](https://github.com/solarrust/hacker-laws) - paldies [Alena Batitskaya](https://github.com/solarrust)!
|
||||
- 🇹🇷 [türkçe/Turkish Version](https://github.com/umutphp/hacker-laws-tr) - paldies [Umut Işık](https://github.com/umutphp)
|
||||
- 🇧🇷 [Brasileiro/Brazīlijas versija](./translations/pt-BR.md) - paldies [Leonardo Costa](https://github.com/LeoFC97)
|
||||
- 🇪🇸 [Castellano/Spānijas versija](./translations/es-ES.md) - paldies [Manuel Rubio](https://github.com/manuel-rubio)
|
||||
- 🇱🇻 [Latvian/Latvijas versija](./translations/lv.md) - paldies [Artūrs Jansons](https://github.com/iegik)
|
||||
- 🇺🇸 [Original English Version - Oriģinālā angļu versija](https://github.com/dwmkerr/hacker-laws) - paldies [Dave Kerr](https://github.com/dwmkerr)!
|
||||
|
||||
Kā šis projekts? Lūdzu, apsveriet iespēju [Sponsoring Me](https://github.com/sponsors/dwmkerr)!
|
||||
|
||||
---
|
||||
|
||||
<!-- VIM-markdown-toc GFM -->
|
||||
|
||||
* [Ievads](#ievads)
|
||||
* [Likumi](#likumi)
|
||||
* [Amdahla likums](#amdahla-likums)
|
||||
* [Izsisto logu teorija](#izsisto-logu-teorija)
|
||||
* [Brūku likums](#bruku-likums)
|
||||
* [Konveja likums](#conways-likums)
|
||||
* [Kaningemas likums](#cunninghams-likums)
|
||||
* [Danbara numurs](#dunbars-numurs)
|
||||
* [Galla likums](#galls-likums)
|
||||
* [Goodharta likums](#goodharts-likums)
|
||||
* [Hanona Razora](#hanlons-razor)
|
||||
* [Hofstadtera likums](#hofstadtera-likums)
|
||||
* [Hutbera likums](#hutbera-likums)
|
||||
* [Hype Cycle & Amaras likums](#hype-cycle-amaras-likums)
|
||||
* [Hyruma likums (Perifērisko saskarņu likums)](#hyruma-likums-perifērisko-saskarņu-likums)
|
||||
* [Kernigana likums](#kernigana-likums)
|
||||
* [Metkalfa likums](#metkalfa-likums)
|
||||
* [Mora likums](#mora-likums)
|
||||
* [Mērfija likums/Soda likums](#murphys-sods-likums)
|
||||
* [Occam's Razor](#occams-razor)
|
||||
* [Parkinsona likums](#parkinsons-Law)
|
||||
* [Priekšlaicīgas optimizēšanas efekts](#premature-optimizēšanas-efekts)
|
||||
* [Putta likums](#putta-likums)
|
||||
* [Reeda likums](#reeda-likums)
|
||||
* [Taisnīguma saglabāšanas likums (Teslera likums)](#taisnīguma-saglabāšanas-likums-teslera-likums)
|
||||
* [Leaky Abstractions likums](#leaky-Abstractions-likums)
|
||||
* [Trivialitātes likums](#trivialitātes-likums)
|
||||
* [Unix filozofija](#unix-filozofija)
|
||||
* [Spotify modelis](#spotify-modelis)
|
||||
* [Wadlera likums](#wadlera-likums)
|
||||
* [Wheatona likums](#wheatons-likums)
|
||||
* [Principi](#principi)
|
||||
* [Dilberta princips](#dilberta-princips)
|
||||
* [Pareto princips (kārtula 80/20)](#pareto-princips-kārtula-8020)
|
||||
* [Petera princips](#petera-princips)
|
||||
* [Uzturības princips (Postela likums)](#uzturības-princips-postela-likums)
|
||||
* [SOLID](#solid)
|
||||
* [Vienotās atbildības princips](#vienotās-atbildības-princips)
|
||||
* [Atklātais/slēgtais princips](#atklātaisslēgtais-princips)
|
||||
* [Liskova aizstāšanas princips](#liskova-aizstāšanas-princips)
|
||||
* [Interfeisa segmenta noteikšanas princips](#interfeisa-segmenta-noteikšanas-princips)
|
||||
* [Atkarībās inversijas princips](#atkarības-inversijas-princips)
|
||||
* [DRY princips](#dry-princips)
|
||||
* [KISS princips](#kiss-princips)
|
||||
* [YAGNI](#yagni)
|
||||
* [Dalītās datošanas maldības](#dalītās-datošanas-maldības)
|
||||
* [Lasīšanas saraksts](#lasīšanas-saraksts)
|
||||
* [Ieguldījums](#ieguldījums)
|
||||
* [Uzdevums](#TODO)
|
||||
|
||||
<!-- VIM-markdown-toc -->
|
||||
|
||||
## Ievads
|
||||
|
||||
Ir daudz likumu, kurus cilvēki apspriež, runājot par attīstību. Šis repozitorijs ir atsauce un pārskats par dažiem visbiežāk sastopamajiem. Lūdzu, kopīgojiet un iesniedziet PRs!
|
||||
|
||||
❗: šis repo satur dažu likumu, principu un modeļu skaidrojumu, bet ne _aizstāv_ nevienam no tiem. Tas, vai tās jāpiemēro, vienmēr būs debašu jautājums un lielā mērā atkarīgs no tā, ar ko jūs strādājat.
|
||||
|
||||
## Tiesību akti
|
||||
|
||||
Un te nu mēs ejam!
|
||||
|
||||
### Amdahl likums
|
||||
|
||||
[Amdahl likums Vikipēdijā](https://en.wikipedia.org/wiki/Amdahl%27s_law)
|
||||
|
||||
> Amdahl likums ir formula, kas parāda skaitļošanas uzdevuma _increedup_, ko var sasniegt, palielinot sistēmas resursus. Parasti izmanto paralēlā skaitļošanā, tā var paredzēt faktisko labumu no procesoru skaita palielināšanas, ko ierobežo programmas paralēliskās iespējas.
|
||||
|
||||
Vislabāk ilustrēts ar piemēru. Ja programma sastāv no divām daļām, daļas A, kas jāizpilda vienam procesoram, un daļas B, ko var līdzināt, mēs redzam, ka vairāku procesoru pievienošana sistēmai, kas izpilda programmu, var sniegt tikai ierobežotu labumu. Tas var ievērojami uzlabot B daļas ātrumu, bet daļas a ĀTRUMS paliks nemainīgs.
|
||||
|
||||
Turpmāk redzamajā diagrammā ir parādīti daži iespējamo ātruma uzlabojumu piemēri.
|
||||
|
||||
<img alt="Diagram: Amdahla likums" src="../images/amdahls_law.png" width="480px"/>
|
||||
|
||||
*(Atsauce uz attēlu: Daniels220 angļu valodā Wikipedia, Creative Commons Attribution-Share Alike 3.0 Unported, https://en.wikipedia.org/wiki/File:AmdahlsLaw.svg)*
|
||||
|
||||
Kā redzams, pat programma, kas ir 50% parallelisable, gūs ļoti maz vairāk nekā 10 procesoru vienību, bet programma, kas ir 95% parallelisable, joprojām var sasniegt ievērojamus ātruma uzlabojumus ar vairāk nekā tūkstoš procesoriem.
|
||||
|
||||
Tā kā [Mora likums](#mora-likums) palēninās un individuālā procesora ātruma paātrināšanās palēninās, paralelizācija ir būtiska, lai uzlabotu veiktspēju. Grafikas programmēšana ir lielisks piemērs - ar mūsdienu Shader bāzes skaitļošanu, atsevišķiem pikseļiem vai fragmentiem var renderēt paralēli - tāpēc mūsdienu grafikas kartēs bieži vien ir daudz tūkstošu apstrādes kodolu (GPUs vai Shader Units).
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [Brūku likums](#brooks-likums)
|
||||
- [Mora likums](#mora-likums)
|
||||
|
||||
### Izsisto logu teorija
|
||||
|
||||
[Izsisto logu teorija Vikipēdijā](https://en.wikipedia.org/wiki/Broken_windows_theory)
|
||||
|
||||
Izsisto logu teorija liecina, ka redzamas nozieguma pazīmes (vai kādas vides rūpju trūkums) noved pie tālākiem un smagākiem noziegumiem (vai tālākas vides pasliktināšanās).
|
||||
|
||||
Šī teorija ir izmantota programmatūras izstrādei, kas liek domāt, ka sliktas kvalitātes kods (vai [Technical Debt](#TODO)) var radīt priekšstatu, ka kvalitātes uzlabošanas centieni var tikt ignorēti vai nepietiekami novērtēti, tādējādi radot vēl vairāk sliktas kvalitātes kodu. Šī efekta kaskādes izraisa ievērojamu kvalitātes samazināšanos laika gaitā.
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [Tehniskais parāds](#TODO)
|
||||
|
||||
Piemēri:
|
||||
- [Pracistic Programming: Software Entropy](https://pragprog.com/the-pragmatic-programmer/extracts/software-entropy)
|
||||
- [Coding Horror: The Broken Window Theory](https://blog.codinghorror.com/the-break-window-theory/)
|
||||
- [OpenSource: Joy of Programming - The Broken Window Theory](https://opensourceforu.com/2011/05/joy-of-programming-broken-window-theory/)
|
||||
|
||||
### Brūku likums
|
||||
|
||||
[Brūku likums Vikipēdijā](https://en.wikipedia.org/wiki/Brooks%27s_law)
|
||||
|
||||
> Personāla resursu pievienošana vēlākam programmatūras izstrādes projektam to dara vēlāk.
|
||||
|
||||
Šis likums liek domāt, ka daudzos gadījumos mēģinājums paātrināt tāda projekta īstenošanu, kas jau ir novēlots, pieskaitot vairāk cilvēku, padarīs piegādi vēl vēlāku. Bruks ir skaidrs, ka tā ir pārmērīga vienkāršošana, tomēr vispārīgie apsvērumi ir tādi, ka, ņemot vērā jaunu resursu ieviešanas laiku un sakaru pieskaitāmās izmaksas, tuvākajā laikā ātrums samazinās. Turklāt daudzi uzdevumi var nebūt dalāmi, t. i., viegli sadalāmi starp lielākiem resursiem, kas nozīmē, ka arī potenciālais ātruma pieaugums ir mazāks.
|
||||
|
||||
Izplatītā frāze “Deviņi sievietes nevar dzemdēt bērnu vienā mēnesī” attiecas uz Brūku likumu, jo īpaši uz faktu, ka daži darba veidi nav dalāmi vai parallelisable.
|
||||
|
||||
Šī ir grāmatas “[The Mythical Man Monthly](#lasīšanas-saraksts)” galvenā tēma.
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [Nāves marts](#TODO)
|
||||
- [reading List: The Mythical Man Month](#reading saraksts)
|
||||
|
||||
### Konveja likums
|
||||
|
||||
[Conwaya likums Vikipēdijā](https://en.wikipedia.org/wiki/Conway%27s_law)
|
||||
|
||||
Šis likums paredz, ka sistēmas tehniskās robežas atspoguļos organizācijas struktūru. Parasti tas tiek pieminēts, aplūkojot organizācijas uzlabojumus, Konveja likums liecina, ka, ja organizācija ir strukturēta uz daudzām mazām, atvienotām vienībām, tad tā ražotā programmatūra būs. Ja organizācija ir vairāk izveidota, izmantojot "vertikāles”, kas ir orientētas uz līdzekļiem vai pakalpojumiem, arī programmatūras sistēmas to atspoguļo.
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [Spotify modelis](#spotify-modelis)
|
||||
|
||||
### Kaningemas likums
|
||||
|
||||
[Kaningemas likums Vikipēdijā](https://en.wikipedia.org/wiki/Ward_Cunningham#Cunningham_likums)
|
||||
|
||||
> Labākais veids, kā iegūt pareizo atbildi internetā, ir neuzdot jautājumu, tas ir, izlikt nepareizu atbildi.
|
||||
|
||||
Pēc Stīvena McGeady teiktā, Vords Kaningems astoņdesmito gadu sākumā viņam ieteicis: “Labākais veids, kā iegūt pareizo atbildi internetā, ir neuzdot jautājumu, tas ir, izlikt nepareizu atbildi.” Mcgeady šo Kaningemas likumu nodēvēja par “nepatiesu”, lai gan Kaningems to noliedz. Lai gan sākotnēji tas attiecās uz mijiedarbību ar Usenet, likums ir izmantots, lai aprakstītu, kā darbojas citas tiešsaistes kopienas (piemēram, Wikipedia, Reddit, Twitter, Facebook).
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [XKCD 386: “Duty Calls”](https://xkcd.com/386/)
|
||||
|
||||
### Danbara numurs
|
||||
|
||||
[Danbara numurs Vikipēdijā](https://en.wikipedia.org/wiki/Dunbar%27s_number)
|
||||
|
||||
“Danbara skaitlis ir ieteicams izziņas ierobežojums to cilvēku skaitam, ar kuriem var uzturēt stabilas sociālās attiecības — attiecības, kurās indivīds zina, kas ir katrs cilvēks un kā katrs cilvēks ir saistīts ar katru citu cilvēku.” Ir kādas domstarpības ar precīzu skaitli. “..” “Dunbar” ierosināja, ka cilvēki var mierīgi uzturēt tikai 150 stabilas attiecības.” Viņš ievietoja numuru vairāk sabiedriskā kontekstā, “tik daudz cilvēku, cik jūs nejustos apmulsuši, ka pievienojaties nelūgtam dzērienam, ja jums gadītos ar viņiem ieskrieties bārā.” Aptuvenie skaitļi parasti ir no 100 līdz 250.
|
||||
|
||||
Tāpat kā stabilas attiecības starp indivīdiem, arī izstrādātāja attiecības ar kodebīlu prasa pūles uzturēt. Saskaroties ar lieliem sarežģītiem projektiem vai daudzu projektu īpašumtiesībām, mēs paļaujamies uz konvencionālo, politiku un modelēto procedūru mērogu. Danbara numurs ir svarīgs ne tikai biroja izaugsmei, bet arī, nosakot darba grupas darba apjomu vai lemjot par to, kad sistēmai jāiegulda līdzekļi, lai palīdzētu modelēt un automatizēt loģistikas pieskaitāmās izmaksas. Skaitlis tiek iekļauts tehniskā kontekstā, tas ir tādu projektu skaits (vai atsevišķa projekta normalizēta sarežģītība), kuriem jūs justos droši, pievienojoties zvanu rotācijai, lai atbalstītu.
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [Conwaya likums](#conways-likums)
|
||||
|
||||
### Galla likums
|
||||
|
||||
[Galla likums Vikipēdijā](https://en.wikipedia.org/wiki/John_Gall_(autors)#Gall's_law)
|
||||
|
||||
> Salikta sistēmā, kas darbojas, pastāvīgi tiek atrasta, ka tā ir attīstījusies no vienkāršas sistēmas, kas darbojās. Sarežģīta sistēma, kas veidota no nulles, nekad nedarbojas, un to nevar patukšot, lai tā darbotos. Jāsāk ar vienkāršu darba sistēmu.
|
||||
>
|
||||
> ([John Gall](https://en.wikipedia.org/wiki/John_Gall_(autors)))
|
||||
|
||||
Gall likums nozīmē, ka mēģinājumi _izstrādāt_ ļoti sarežģītas sistēmas var neizdoties. Ļoti sarežģītas sistēmas reti tiek veidotas vienā paņēmienā, bet attīstās no vienkāršākām sistēmām.
|
||||
|
||||
Klasiskais piemērs ir vispasaules tīmeklis. Pašreizējā stāvoklī tā ir ļoti sarežģīta sistēma. Tomēr sākotnēji tas tika definēts kā vienkāršs veids satura koplietošanai starp akadēmiskajām institūcijām. Tas bija ļoti veiksmīgs šo mērķu sasniegšanā un attīstījās, lai laika gaitā kļūtu sarežģītāks.
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [KISS (keep It Simple, Stupid)](#kiss-princips)
|
||||
|
||||
### Goodharta likums
|
||||
|
||||
[Goodharta likums Vikipēdijā](https://en.wikipedia.org/wiki/Goodhart's_law)
|
||||
|
||||
> jebkura novērotā statistiskā regularitāte var sabrukt, kad uz to tiek izdarīts spiediens kontroles nolūkā.
|
||||
>
|
||||
> _Charles Goodhart_
|
||||
|
||||
Bieži minēts arī kā:
|
||||
|
||||
> kad pasākums kļūst par mērķi, tas vairs nav labs pasākums.
|
||||
>
|
||||
> _Merilinas Strathern_
|
||||
|
||||
Likums nosaka, ka pasākuma virzītā optimizācija var izraisīt paša mērījumu rezultāta devalvāciju. Pārāk selektīvs pasākumu kopums ([KPI](https://en.wikipedia.org/wiki/Performance_indicator)), ko akli piemēro procesam, rada izkropļotu ietekmi. Cilvēki mēdz optimizēt vietējā līmenī, “spēlējot” sistēmu, lai tā atbilstu īpašiem rādītājiem, nevis pievērstu uzmanību viņu darbību visaptverošajiem rezultātiem.
|
||||
|
||||
Reālpasaules piemēri:
|
||||
|
||||
- izmēģinājumi bez pārbaudes atbilst koda pārklājuma prognozēm, neskatoties uz to, ka metrikas nolūks bija izveidot labi pārbaudītu programmatūru.
|
||||
- izstrādātāja snieguma rezultāts, ko norāda veikto rindu skaits, noved pie nepamatoti uzpūstas kodebāzes.
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [Goodharta likums: How Measuring The Wrong Things Drive Immoral Bemoral haviour](https://coffeeandjunk.com/goodharts-campbells-law/)
|
||||
- [Dilbert on bug-free software](https://dilbert.com/strip/1995-11-13)
|
||||
|
||||
### Hanlons Razors
|
||||
|
||||
[Hanlon's Razor Vikipēdijā](https://en.wikipedia.org/wiki/Hanlon%27s_razor)
|
||||
|
||||
> nekad nepiedēvē ļaunprātību, kas ir pietiekami izskaidrota ar muļķību.
|
||||
>
|
||||
> Roberts J. Hanlons
|
||||
|
||||
Šis princips liek domāt, ka darbības, kas rada negatīvu rezultātu, nav sliktas gribas rezultāts. Tā vietā negatīvais iznākums drīzāk tiek attiecināts uz šīm darbībām un/vai ietekme netiek pilnībā izprasta.
|
||||
|
||||
### Hofstadtera likums
|
||||
|
||||
[Hefstadtera likums Vikipēdijā](https://en.wikipedia.org/wiki/Hofstadter%27s_law)
|
||||
|
||||
> Tas vienmēr aizņem vairāk laika, nekā jūs domājat, pat ņemot vērā Hofštera likumu.
|
||||
>
|
||||
> (Duglass Hofstadters)
|
||||
|
||||
Jūs varētu dzirdēt, kā šis likums tiek pieminēts, skatoties uz aprēķiniem, cik ilgi kaut kas notiks. Šķiet, ka programmatūras izstrādes triks ir tāds, ka mēs nemēdzam precīzi novērtēt, cik ilgs laiks būs vajadzīgs, lai to paveiktu.
|
||||
|
||||
Tas ir no grāmatas “[Gödel, Escher, Bahs: An Mūžīgais Zelta Breidijs](#lasīšanas-saraksts)”.
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [Lasīšanas saraksts: Gödel, Escher, Baach: An Mūžīgais zelta Breids](#lasīšanas-saraksts)
|
||||
|
||||
### Hutbera likums
|
||||
|
||||
[Hutbera likums Vikipēdijā](https://en.wikipedia.org/wiki/Hutber%27s_law)
|
||||
|
||||
> Uzlabošanās nozīmē nolietošanos.
|
||||
>
|
||||
> ([Patrick Hutber](https://en.wikipedia.org/wiki/Patrick_Hutber))
|
||||
|
||||
Šis likums liek domāt, ka sistēmas uzlabojumi novedīs pie citu daļu pasliktināšanās vai arī apslēps citu pasliktināšanos, kas kopumā novedīs pie degradācijas no sistēmas pašreizējā stāvokļa.
|
||||
|
||||
Piemēram, atbildes latentuma samazināšanās konkrētā galapunktā varētu radīt papildu caurlaidspējas un jaudas problēmas pieprasījuma plūsmā, ietekmējot pilnīgi citu apakšsistēmu.
|
||||
|
||||
### Hype Cycle & Amara likums
|
||||
|
||||
[Hype Cycle Vikipēdijā](https://en.wikipedia.org/wiki/Hype_cycle)
|
||||
|
||||
> Mēs pārāk augstu vērtējam tehnoloģijas ietekmi īstermiņā un nepietiekami novērtējam tās ietekmi ilgtermiņā.
|
||||
>
|
||||
> (Rojs Amara)
|
||||
|
||||
Hype Cycle ir Gārtnera sākotnēji ražotās tehnoloģijas saviļņojuma un attīstības vizuāls attēlojums laika gaitā. Vislabāk to rāda vizuāli:
|
||||
|
||||

|
||||
|
||||
*(Atsauce uz attēlu: angļu valodā Wikipedia, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=10547051)*
|
||||
|
||||
Īsāk sakot, šis cikls liecina, ka parasti rodas satraukums par jaunām tehnoloģijām un to iespējamo ietekmi. Komandas bieži vien ātri iesoļo šajās tehnoloģijās un reizēm jūtas vīlušās ar rezultātiem. Tas varētu būt tāpēc, ka tehnoloģija vēl nav pietiekami izstrādāta vai arī reālie lietojumi vēl nav pilnībā īstenoti. Pēc zināma laika tehnoloģijas iespējas palielinās un praktiskās iespējas to izmantot palielinās, un komandas beidzot var kļūt ražīgas. Rojs Amars (Roy Amara) citēja šo jautājumu visskaļāk: “Mums ir tendence pārvērtēt tehnoloģijas ietekmi īstermiņā un novērtēt to par zemu ilgtermiņā.”
|
||||
|
||||
### Hiruma likums (Perifērisko saskarņu likums)
|
||||
|
||||
[Hiruma likums Online](http://www.hyrumslaw.com/)
|
||||
|
||||
> Ar pietiekamu API lietotāju skaitu,
|
||||
> nav svarīgi, ko jūs solāt līgumā:
|
||||
> visas novērojamās sistēmas darbības
|
||||
> būs atkarīgs no kāda.
|
||||
>
|
||||
> (Hyrum Wright)
|
||||
|
||||
Hirum likums nosaka, ka tad, ja jums ir _pietiekami liels API patērētāju skaits_, visas API darbības (pat tās, kas nav definētas kā publiskā līguma daļa) galu galā būs atkarīgas no kāda. Triviāls piemērs var būt nefunkcionāli elementi, piemēram, API atbildes laiks. Smalkāks piemērs varētu būt patērētāji, kas paļaujas uz regex piemērošanu kļūdas ziņojumam, lai noteiktu API kļūdas *tipu*. Pat tad, ja API publiskajā līgumā nav norādīts ziņojuma saturs, norādot, ka lietotājiem jālieto saistītais kļūdas kods, _daži_ lietotāji var izmantot ziņojumu un, mainot ziņojumu, būtībā tiek pārtraukta API šiem lietotājiem.
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [Leaky Abstractions likums](#the-law-of-dioxide-freshctions)
|
||||
- [XKCD 1172](https://xkcd.com/1172/)
|
||||
|
||||
### Kernigana likums
|
||||
|
||||
> Atkļūdošana ir divreiz smagāka nekā koda rakstīšana pirmajā vietā. Tāpēc, ja jūs uzrakstāt kodu pēc iespējas gudrāk, jūs pēc definīcijas neesat pietiekami gudrs, lai to atkļūdotu.
|
||||
>
|
||||
> (Brian Kernighan)
|
||||
|
||||
Kernigana likums ir nosaukts [Brian Kernighan](https://en.wikipedia.org/wiki/Brian_Kernighan) un atvasināts no citāta no Kernighan un Plaugera grāmatas [Programmēšanas stila elementi](https://en.wikipedia.org/wiki/The_Elements_of_Programming_Style):
|
||||
|
||||
> Visi zina, ka atkļūdošana ir divreiz smagāka nekā programmas rakstīšana. Tātad, ja tu esi tik gudrs, cik vari būt, kad tu to raksti, kā tu jebkad to atkļūsi?
|
||||
|
||||
Lai gan Kernigana likums ir hiperbolisks, tas ir arguments, ka vienkāršam kodam ir jādod priekšroka attiecībā pret sarežģītu kodu, jo jebkuru sarežģītā koda jautājumu atkļūdošana var būt dārga vai pat neiespējama.
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [KISS princips](#kiss-princips)
|
||||
- [Unix filozofija](#unix-filozofija)
|
||||
- [Occam's Razor](#occams-razor)
|
||||
|
||||
### Metkalfa likums
|
||||
|
||||
[Metkalfea likums Vikipēdijā](https://en.wikipedia.org/wiki/Metcalfe's_law)
|
||||
|
||||
> Tīkla teorijā sistēmas vērtība pieaug aptuveni pēc sistēmas lietotāju skaita kvadrāta.
|
||||
|
||||
Šis likums ir balstīts uz iespējamo pārtikušo savienojumu skaitu sistēmā un ir cieši saistīts ar [Reeda likums](#reeda-likums). Odlyzko un citi apgalvoja, ka gan Rīda likums, gan Metkalfa likums nosaka pārāk augstu sistēmas vērtību, neņemot vērā cilvēku izziņas robežas attiecībā uz tīkla ietekmi; skatīt [Danbara numurs](#dunbars-number).
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [Reeda likums](#reeda-likums)
|
||||
- [Danbara numurs](#Danbara-numurs)
|
||||
|
||||
### Mora likums
|
||||
|
||||
[Mora likums Vikipēdijā](https://en.wikipedia.org/wiki/Moore%27s_law)
|
||||
|
||||
> Tranzistoru skaits integrālajā shēmā divkāršojas aptuveni reizi divos gados.
|
||||
|
||||
Mora prognozes ir ļoti precīzas no 1970. gadiem līdz pat 2000. gadu beigām. Pēdējos gados tendence ir nedaudz mainījusies, daļēji pateicoties [fiziskās robežas pakāpei, kādā komponentus var miniaturizēt](https://en.wikipedia.org/wiki/Quantum_tunnelling). Tomēr progress paralēlizācijā un, iespējams, revolucionāras izmaiņas pusvadītāju tehnoloģijā un kvantu skaitļošanā var nozīmēt, ka Mora likums varētu būt spēkā arī turpmākajos gadu desmitos.
|
||||
|
||||
### Mērfija likums/Soda likums
|
||||
|
||||
[Mērfija likums Vikipēdijā](https://en.wikipedia.org/wiki/Murphy%27s_law)
|
||||
|
||||
> Jebkas, kas var noiet greizi, noies greizi.
|
||||
|
||||
Saistībā ar [Edvards A. Mērfijs, Jr](https://en.wikipedia.org/wiki/Edward_A._Murphy_Jr.) _Mērfija likums_ teikts: ja kaut kas var noiet greizi, tas noies greizi.
|
||||
|
||||
Tā ir vispārpieņemta izvēle izstrādātāju vidū. Dažreiz tas negaidītais notiek, attīstoties, testējot vai pat ražojot. Tas var būt saistīts arī ar (biežāk angļu valodā) _Sod's Law_:
|
||||
|
||||
> Ja kaut kas var noiet greizi, tas notiks vissliktākajā laikā.
|
||||
|
||||
Šos “likumus” parasti izmanto komiskā nozīmē. Tomēr tādas parādības kā [_Confirmation Bias_](#TODO) un [_Selection Bias_](#TODO) var likt cilvēkiem, iespējams, pārmērīgi uzsvērt šos likumus (lielākā daļa gadījumu, kad lietas darbojas, tās paliek nepamanītas, tomēr kļūmes ir pamanāmākas un rosina vairāk diskusiju).
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [Bias apstiprinājums](#TODO)
|
||||
- [Bias atlases](#TODO)
|
||||
|
||||
### Okuta Razors
|
||||
|
||||
[Occam's Razor Vikipēdijā](https://en.wikipedia.org/wiki/Occam's_razor)
|
||||
|
||||
> Entītijas nedrīkst reizināt bez nepieciešamības.
|
||||
>
|
||||
> Oklema Viljams
|
||||
|
||||
Ouema skuveklis stāsta, ka starp vairākiem iespējamiem risinājumiem ticamākais risinājums ir tas, kuram ir vismazākais jēdzienu un pieņēmumu skaits. Šis risinājums ir vienkāršākais un atrisinās tikai dotā problēma, neieviešot nejaušu sarežģītību un iespējamās negatīvās sekas.
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [YAGNI](#yagni)
|
||||
- [Bez sudraba aizzīme: hoc Compluncity and Essential Complexity](https://en.wikipedia.org/wiki/No_Silver_Bullet)
|
||||
|
||||
Piemērs:
|
||||
- [prospect Software Development: Eliminate Waste laundering](https://en.wikipedia.org/wiki/Lean_software_development#Eliminate_waste)
|
||||
|
||||
### Parkinsona likums
|
||||
|
||||
[Parkinsona likums Vikipēdijā](https://en.wikipedia.org/wiki/Parkinson%27s_law)
|
||||
|
||||
> Darbs tiek izvērsts, lai aizpildītu laiku, kas ir pieejams tā pabeigšanai.
|
||||
|
||||
Tā sākotnējā kontekstā šis likums balstījās uz birokrātijas pētījumiem. Tas var tikt pesimistiski piemērots programmatūras izstrādes iniciatīvām, jo teorija ir tāda, ka darba grupas būs neefektīvas līdz termiņa beigām, bet pēc tam steidzas pabeigt darbu līdz noteiktajam termiņam, tādējādi padarot faktisko termiņu nedaudz patvaļīgu.
|
||||
|
||||
Ja šis likums tiktu apvienots ar [Hofštera likumu](#hofstadtera-likums), tad tiek panākts vēl pesimistiskāks viedoklis - darbs paplašināsies, lai aizpildītu tā pabeigšanai pieejamo laiku, un *joprojām paies ilgāk, nekā paredzēts*.
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [Hofstadtera likums](#hofstadtera-likums)
|
||||
|
||||
### Priekšlaicīgas optimizācijas efekts
|
||||
|
||||
[Priekšlaicīga optimizācija WikiWikiWeb](http://wiki.c2.com/?PrematureOptimization)
|
||||
|
||||
> Priekšlaicīga optimizācija ir visa ļaunuma sakne.
|
||||
>
|
||||
> [(Donald Knuth)](https://twitter.com/realdonaldknuth?lang=en)
|
||||
|
||||
Donalda Knuta (Donald Knuth) rakstā [Structured Programming With Go To Deements](http://wiki.c2.com/?StructuredProgrammingWithGoToStatements) viņš rakstīja: „Programmeri tērē milzīgus laika apjomus, domājot par savu programmu nekritisko daļu ātrumu vai raizējoties par to, un šiem efektivitātes mēģinājumiem patiesībā ir liela negatīva ietekme, ja tiek apsvērta atkļūdošana un uzturēšana. Mums vajadzētu aizmirst par nelielu efektivitāti, teiksim par 97% no laika: **priekšlaicīga optimizācija ir visa ļaunuma sakne**. Tomēr mums nevajadzētu izmantot savas iespējas šajā būtiskajā 3%.”
|
||||
|
||||
Tomēr _Premature Optimization_ var definēt (mazāk noslogotā izteiksmē) kā optimizāciju, pirms mēs zinām, ka tas ir nepieciešams.
|
||||
|
||||
### Putta likums
|
||||
|
||||
[Putta likums Vikipēdijā](https://en.wikipedia.org/wiki/Putt%27s_Law_and_the_Successful_Technocrat)
|
||||
|
||||
> Tehnoloģijā dominē divu veidu cilvēki, tie, kas saprot, ko nepārvalda, un tie, kas pārvalda to, ko nesaprot.
|
||||
|
||||
Flowera likums bieži seko līdzi Putt Corollary:
|
||||
|
||||
> katra tehniskā hierarhija laika gaitā attīsta kompetences neversiju.
|
||||
|
||||
Šie paziņojumi liecina, ka, ņemot vērā dažādus atlases kritērijus un tendences attiecībā uz grupu organizāciju, būs daudz kvalificētu cilvēku tehniskās organizācijas darba līmenī un vairāki cilvēki vadošos amatos, kuri neapzinās viņu vadītā darba sarežģītību un problēmas. To var izraisīt tādas parādības kā [The Peter Principle](#the-peter-principle) vai [The Dilbert Principle](#the-dilbert-principle).
|
||||
|
||||
Tomēr jāuzsver, ka šādi tiesību akti ir plaši vispārinājumi un var attiekties uz _dažiem_ organizāciju veidiem, nevis uz citiem.
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [Peter Principle](#petera-princips)
|
||||
- [Dilberta princips](#dilberta-princips)
|
||||
|
||||
### Reeda likums
|
||||
|
||||
[Reeda likums Vikipēdijā](https://en.wikipedia.org/wiki/Reed's_law)
|
||||
|
||||
> Lielo tīklu, it īpaši sociālo tīklu, lietderība ir atkarīga no tīkla lieluma.
|
||||
|
||||
Šis likums balstās uz grafiku teoriju, kur lietderības mērogs ir kā iespējamo apakšgrupu skaits, kas ir ātrāks par dalībnieku skaitu vai iespējamo pārotāju savienojumu skaitu. Odlyzko un citi apgalvoja, ka Rīda likums nosaka sistēmas lietderību, nerēķinoties ar cilvēku izziņas ierobežojumiem attiecībā uz tīkla ietekmi; sk. [Danbara numurs](#Danbara-numurs).
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [Metkalfa likums](#metkalfa-likums)
|
||||
- [Danbara numurs](#Danbara-numurs)
|
||||
|
||||
### Taisnīguma saglabāšanas likums (Teslera likums)
|
||||
|
||||
[Likums par stabilitātes saglabāšanu attiecībā uz Wikipedia](https://en.wikipedia.org/wiki/Law_of_conservation_of_complexity)
|
||||
|
||||
Šis likums nosaka, ka sistēmā, kuru nevar samazināt, pastāv zināma sarežģītības pakāpe.
|
||||
|
||||
Sistēmas sarežģītība ir “netīša”. Tās ir vājās struktūras, kļūdu vai tikai sliktas problēmas modelēšanas sekas. Nejaušu sarežģītību var samazināt (vai novērst). Tomēr, ņemot vērā problēmas sarežģītību, pastāv zināma sarežģītība. Šo sarežģītību var pārvietot, bet ne likvidēt.
|
||||
|
||||
Viens no šā likuma interesantākajiem elementiem ir ieteikums, ka pat vienkāršojot visu sistēmu, netiek samazināta iekšējā sarežģītība, tas ir _jāpārvieto uz lietotāju_, kam jāuzvedas sarežģītāk.
|
||||
|
||||
### “Leaky Abstractions” likums
|
||||
|
||||
[The Law of Leaky Abstractions on Joel on Software](https://www.joelonsoftware.com/2002/11/11/the-law-of-dioxide-freshctions/)
|
||||
|
||||
> Visas netriviālās abstrakcijas zināmā mērā ir sūces.
|
||||
>
|
||||
> ([Joel Spolsky](https://twitter.com/spolsky))
|
||||
|
||||
Šis likums nosaka, ka abstrakcijas, ko parasti izmanto skaitļošanā, lai vienkāršotu darbu ar sarežģītām sistēmām, noteiktās situācijās “noplūdīs” pamatsistēmas elementi, tādējādi padarot abstrakciju neparedzētu.
|
||||
|
||||
Kā piemēru var minēt faila ielādi un tā satura lasīšanu. Failu sistēmas API ir zemāka līmeņa kodola sistēmu _abstrakcija_, kas pati par sevi ir abstrakcija pār fiziskajiem procesiem, kas saistīti ar datu maiņu magnētiskajā platē (vai zibatmiņu SSD). Vairumā gadījumu faila apstrāde kā bināro datu straume būs efektīva. Taču magnētiskajam diskam nolasāmie dati secīgi būs *ievērojami* ātrāki nekā brīvpiekļuves (jo palielinās lapu defektu pārsniegums), bet SSD diskdzinim šī pieskaitāmība nebūs. Lai risinātu šo gadījumu, būs jāizprot pamatinformācija (piemēram, datu bāzes indeksa faili ir strukturēti tā, lai samazinātu brīvpiekļuves pieskaitāmo daļu), bet izstrādātājam, iespējams, ir jāzina abstrakcijas “noplūžu” ieviešanas detaļas.
|
||||
|
||||
Iepriekš minētais piemērs var kļūt sarežģītāks, ieviešot _vairāk_ abstrakciju. Operētājsistēma Linux ļauj piekļūt failiem, izmantojot tīklu, bet tā ir lokāli attēlota kā “parastie” faili. Šī abstrakcija “noplūdīs”, ja radīsies tīkla kļūmes. Ja izstrādātājs uzskata šos failus par “parastiem” failiem, neņemot vērā to, ka tie var būt pakļauti tīkla latentumam un kļūmēm, risinājumi būs neefektīvi.
|
||||
|
||||
Tiesību aktu aprakstošais pants liecina, ka pārmērīga paļaušanās uz abstrakcijām apvienojumā ar vāju izpratni par pamatā esošajiem procesiem, atsevišķos gadījumos liek risināt šo problēmu _vairāk_ sarežģīti.
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [Hyruma likums](#hyruma-likums-perifērisko-saskarņu-likums)
|
||||
|
||||
Reālpasaules piemēri:
|
||||
|
||||
- [Photoshop Slow Startup](https://forums.adobe.com/thread/376152) - problēma, ar kuru saskāros agrāk. Photoshop startēšana bija lēna, dažreiz tas prasīja dažas minūtes. Šķiet, problēma bija tā, ka startējot tas nolasa daļu informācijas par pašreizējo noklusējuma printeri. Tomēr, ja šis printeris faktiski ir tīkla printeris, tas var aizņemt ļoti ilgu laiku. Tīkla printera _abstrakcija_, kas tiek prezentēta sistēmai līdzīgi lokālajam printerim, radīja problēmas lietotājiem sliktā savienojamības situācijā.
|
||||
|
||||
### Trivialitātes likums
|
||||
|
||||
[Trivialitātes likums Vikipēdijā](https://en.wikipedia.org/wiki/Law_of_triviality)
|
||||
|
||||
Šis likums liek domāt, ka grupas daudz vairāk laika un uzmanības veltīs triviāliem vai kosmētiskiem jautājumiem, nevis nopietniem un būtiskiem.
|
||||
|
||||
Kopējais izdomātais piemērs ir komiteja, kas apstiprina plānus atomelektrostacijai, kura lielāko daļu laika pavada, apspriežot velosipēdistu nojumes struktūru, nevis pašu nozīmīgāko spēkstacijas projektu. Var būt grūti sniegt vērtīgu ieguldījumu diskusijās par ļoti lielām, komplicētām tēmām bez augstas kompetences vai sagatavotības. Tomēr cilvēki vēlas saņemt vērtīgu ieguldījumu. Tādēļ tendence pārāk daudz laika veltīt sīkumiem, par kuriem var viegli spriest, bet kuri ne vienmēr ir īpaši svarīgi.
|
||||
|
||||
Iepriekš aprakstītais piemērs lika lietot terminu “Bike Shedding” kā izteicienu, lai izšķiestu laiku triviāliem sīkumiem. Saistītais termins ir “[Yak Shaving](https://en.wiktionary.org/wiki/yak_shaving)”, kas saista šķietami nebūtisku darbību, kas ir daļa no gara priekšnosacījumu ķēdes galvenajam uzdevumam.
|
||||
|
||||
### Unix filozofija
|
||||
|
||||
[Unix filozofija Vikipēdijā](https://en.wikipedia.org/wiki/Unix_philosophy)
|
||||
|
||||
Unix filozofija ir tāda, ka programmatūras komponentiem jābūt maziem un jābūt vērstiem uz to, lai labi paveiktu vienu konkrētu lietu. Tas var atvieglot sistēmu izveidi, izveidojot kopā mazas, vienkāršas, labi definētas vienības, nevis izmantojot lielas, sarežģītas, daudzfunkcionālas programmas.
|
||||
|
||||
Mūsdienu praksi, piemēram, "Microservice arhitektūru”, var uzskatīt par šī likuma piemērošanu, kur pakalpojumi ir mazi, koncentrēti un dara vienu konkrētu lietu, ļaujot kompleksai rīcībai veidot vienkāršus veidošanas blokus.
|
||||
|
||||
### Spotify modelis
|
||||
|
||||
[Spotify Model on Spotify Labs](https://labs.spotify.com/2014/03/27/spotify-engineering-culture-part-1/)
|
||||
|
||||
“Spotify” modelis ir pieeja komandas un organizācijas struktūrai, ko popularizē “Spotify”. Šajā modelī komandas tiek organizētas ap funkcijām, nevis tehnoloģijām.
|
||||
|
||||
Spotify modelis popularizē arī Tribes, Guilds, Chapters jēdzienus, kas ir citi to organizācijas struktūras elementi.
|
||||
|
||||
### Wadlera likums
|
||||
|
||||
[Lunga likums on wiki.haskell.org](https://wiki.haskell.org/Wadler's_Law)
|
||||
|
||||
> jebkurā valodas dizainā kopējais laiks, kas pavadīts, apspriežot kādu līdzekli šajā sarakstā, ir proporcionāls diviem, kas izvirzīti tā atrašanās vietai.
|
||||
>
|
||||
> 0. Semantika
|
||||
> 1. Sintakse
|
||||
> 2. Leksiskā sintakse
|
||||
> 3. Komentāru leksiskā sintakse
|
||||
>
|
||||
> (īsāk sakot, par katru semantiku pavadīto stundu komentāru sintaksē tiks pavadītas 8 stundas).
|
||||
|
||||
Līdzīgi kā [Trivialitātes likums](#trivialitātes-likums), Wadlera likums nosaka, ka, projektējot valodu, laika apjoms, kas tiek tērēts valodas konstrukcijām, ir nesamērīgi augsts salīdzinājumā ar šo iezīmju nozīmi.
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [Trivialitātes likums](#trivialitātes-likums)
|
||||
|
||||
### Wheaton likums
|
||||
|
||||
[Saite](http://www.wheatonslaw.com/)[Oficiālā diena](https://dontbeadickday.com/)
|
||||
|
||||
> Neesi stulbenis.
|
||||
>
|
||||
> _Wil Wheaton_
|
||||
|
||||
Šī vienkāršā, lakoniskā un spēcīgā likuma mērķis ir palielināt harmoniju un cieņu profesionālajā organizācijā. To var izmantot, runājot ar kolēģiem, veicot koda pārskatīšanu, cīnoties pret citiem skatījumiem, kritizēšanu un kopumā lielāko daļu profesionālo mijiedarbību ar cilvēkiem.
|
||||
|
||||
## Principi
|
||||
|
||||
Parasti ir lielāka iespēja, ka principi ir pamatnostādnes, kas attiecas uz dizainu.
|
||||
|
||||
### Dilberta princips
|
||||
|
||||
[Dilberta princips Vikipēdijā](https://en.wikipedia.org/wiki/Dilbert_principle)
|
||||
|
||||
> uzņēmumos tiek sistemātiski reklamēti nekompetenti darbinieki vadībai, lai tos izdabūtu no darbplūsmas.
|
||||
>
|
||||
> _Scott Adams_
|
||||
|
||||
Vadības konceptu, ko izstrādājis Skots Adamss (Dilbert komiksu striptīza radītājs), Dilbert Princips iedvesmo [The Peter Principle](#the-peter-principle). Saskaņā ar Dilbert principu darbinieki, kas nekad nav bijuši kompetenti, tiek paaugstināti vadībā, lai ierobežotu kaitējumu, ko viņi var nodarīt. Adams vispirms izskaidroja šo principu 1995. gada “Wall Street Journal” rakstā un izvērsa to savā 1996. gada uzņēmējdarbības grāmatā [The Dilbert Principle](#lasīšanas-saraksts).
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [Petera princips](#petera-princips)
|
||||
- [Putta likums](#putta-likums)
|
||||
|
||||
### Pareto princips (kārtula 80/20)
|
||||
|
||||
[Pareto Principle Vikipēdijā](https://en.wikipedia.org/wiki/Pareto_principle)
|
||||
|
||||
> Vairums lietu dzīvē netiek sadalītas vienmērīgi.
|
||||
|
||||
Pareto princips liecina, ka dažos gadījumos lielākā daļa rezultātu nāk no nelieliem ieguldījumiem:
|
||||
- 80% no noteiktas programmatūras var rakstīt 20% no kopējā piešķirtā laika (pretēji tam, visgrūtākie 20% no koda aizņem 80% laika).
|
||||
- 20% no piepūles veido 80% no rezultāta,
|
||||
- 20% no darba rada 80% no ieņēmumiem,
|
||||
- 20% atkritumu izraisa 80% avāriju
|
||||
- 20% līdzekļu izraisa 80% lietošanas
|
||||
|
||||
1940. gadā amerikāņu un rumāņu inženieris doktors Džozefs Jurans (Joseph Juran), kurš plaši tiek ieskaitīts kā kvalitātes kontroles tēvs, sāka piemērot Pareto principu attiecībā uz kvalitātes jautājumiem (https://en.wikipedia.org/wiki/Joseph_M._Juran).
|
||||
|
||||
Šis princips ir pazīstams arī kā 80/20 likums, Vital Few likums un The Principle of Factor Sparsity.
|
||||
|
||||
Reālpasaules piemēri:
|
||||
|
||||
- 2002. gadā korporācija Microsoft ziņoja, ka, fiksējot 20% lielāko visvairāk ziņoto kļūdu, tiks novērstas 80% saistīto kļūdu un avāriju logos un birojos ([Atsauce](https://www.crn.com/news/security/18821726/microsofts-ceo-80-20-rule-applies-to-bugs-'t-just-features.htm)).
|
||||
|
||||
### Pētera princips
|
||||
|
||||
[Peter Principle Vikipēdijā](https://en.wikipedia.org/wiki/Peter_principle)
|
||||
|
||||
> Cilvēki hierarhijā tiecas sasniegt savu “nekompetences līmeni”.
|
||||
>
|
||||
> _Laurence J. Peter_
|
||||
|
||||
Laurences J. Peteras (Peter Principle) izstrādātajā vadības koncepcijā norādīts, ka tiek reklamēti cilvēki, kas labi strādā savā darbavietā, līdz sasniedz līmeni, kurā viņi vairs nav veiksmīgi (viņu “nekompetences līmenis”. Šobrīd, tā kā viņi ir vecākie, ir mazāk ticams, ka viņi tiks izņemti no organizācijas (ja vien viņi nedarbosies īpaši slikti), un viņi turpinās strādāt tādā lomā, kurā viņiem ir maz iedzimtas prasmes, jo viņu sākotnējās prasmes, kas viņus padarījušas veiksmīgus, ne vienmēr ir vajadzīgas viņu jaunajiem darbiem.
|
||||
|
||||
Tas jo īpaši interesē inženierus, kuri sākotnēji sāk pildīt ļoti tehniskas funkcijas, bet kuriem bieži vien ir karjeras ceļš, kas liek _vadīt_ citus inženierus, - kam ir nepieciešams būtiski atšķirīgs prasmju kopums.
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [Dilberta princips](#dilberta-princips)
|
||||
- [Putta likums](#putta-likums)
|
||||
|
||||
### Uzturības princips (Postel's Law)
|
||||
|
||||
[Stabilitātes princips Vikipēdijā](https://en.wikipedia.org/wiki/Robustness_principle)
|
||||
|
||||
> Esiet konservatīvi pret to, ko darāt, esiet liberāli tajā, ko pieņemat no citiem.
|
||||
|
||||
Bieži lietots serveru lietojumprogrammu izstrādē, šis princips nosaka, ka tam, ko sūtāt citiem, ir jābūt pēc iespējas mazākam un atbilstošam, bet, ja to var apstrādāt, ir jācenšas atļaut nestandarta ievadi.
|
||||
|
||||
Šā principa mērķis ir izveidot stabilas sistēmas, jo tās var izmantot vāju ieguldījumu, ja to vēl var saprast. Tomēr ir iespējamas sekas saistībā ar drošību, pieņemot nepareizi ievadītus datus, jo īpaši, ja šādu resursu apstrāde nav labi pārbaudīta.
|
||||
|
||||
Ja laikus tiks pieļauta neatbilstība, protokola spēja attīstīties var mazināties, jo, lai veidotu savas iezīmes, īstenotāji, iespējams, paļausies uz šo liberalitāti.
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [Hyruma likums](#hyruma-likums-perifērisko-saskarņu-likums)
|
||||
|
||||
### SOLID
|
||||
|
||||
Tas ir akronīms, kas attiecas uz:
|
||||
|
||||
* S: [Vienotās atbildības princips](#vienotās-atbildības-princips)
|
||||
* O: [Atklātais/slēgtais princips](#atklātaisslēgtais-princips)
|
||||
* L: [Liskova aizstāšanas princips](#liskova-aizstāšanas-princips)
|
||||
* I: [Interfeisa segmenta noteikšanas princips](#interfeisa-segmenta-noteikšanas-princips)
|
||||
* D: [Atkarības inversijas princips](#atkarības-inversijas-princips)
|
||||
|
||||
Šie ir galvenie principi programmā [Object-oriented Programming](#TODO). Projektēšanas principiem ir jābūt tādiem, kas var palīdzēt izstrādātājiem veidot labāk funkcionējošas sistēmas.
|
||||
|
||||
### Vienotās atbildības princips
|
||||
|
||||
[Vienotās atbildības princips Vikipēdiā](https://en.wikipedia.org/wiki/Single_responsibility_principle)
|
||||
|
||||
> katram modulim vai klasei ir jābūt tikai vienai atbildībai.
|
||||
|
||||
Pirmais no “[SOLID](#solid)” principiem. Šis princips liek domāt, ka moduļiem vai klasēm būtu jādara tikai viens un tikai viens. Praktiskāk tas nozīmē, ka, veicot vienu nelielu programmas līdzekļa maiņu, ir jāmaina tikai viens komponents. Piemēram, paroles validācijas sarežģītības dēļ ir jāmaina tikai viena programmas daļa.
|
||||
|
||||
Teorētiski tam vajadzētu padarīt kodu spēcīgāku un vieglāk maināmu. Zinot, ka pārveidojamam komponentam ir tikai viena atbildība, tas nozīmē, ka _testēt_ šīs izmaiņas ir vieglāk. Izmantojot iepriekšējo piemēru, paroles sarežģītības komponenta maiņa var ietekmēt tikai ar paroles sarežģītību saistītos līdzekļus. Daudz grūtāk var būt pamatot pārmaiņu ietekmi uz komponentu, kam ir daudz pienākumu.
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [Uz objektu vērsta programmēšana](#TODO)
|
||||
- [SOLID](#solid)
|
||||
|
||||
### Open/Slēgts princips
|
||||
|
||||
[Atklātais/slēgtais princips Vikipēdijā](https://en.wikipedia.org/wiki/Open%E2%80%93closed_principle)
|
||||
|
||||
> entītijām jābūt atvērtām paplašinājumam un slēgtām modificēšanai.
|
||||
|
||||
Otro no “[SOLID](#solid)” principiem. Šis princips nosaka, ka subjektiem (kas varētu būt klases, moduļi, funkcijas utt.) jābūt iespējai īstenot savu darbību _prolongēt_, bet to _esošo_ uzvedību nedrīkst mainīt.
|
||||
|
||||
Kā hipotētisku piemēru iedomājieties moduli, kas var pārvērst Piezīmes dokumentu HTML formātā. Ja moduli varētu paplašināt, lai to varētu izmantot nesen ierosinātajai vērtības samazināšanas funkcijai, nemainot moduli, tas būtu atvērts paplašinājumam. Ja lietotājs varētu modificēt moduli _not_, lai ar to varētu rīkoties tagad, kad tiek apstrādāti esošie salīdzināšanas līdzekļi, tad tas būtu _slēgts_ modificēšanai.
|
||||
|
||||
Šim principam ir īpaša nozīme attiecībā uz uz objektu vērstu programmēšanu, kur mēs varam projektēt objektus, lai tos varētu viegli paplašināt, bet mēs izvairītos no tādu objektu projektēšanas, kuru pašreizējā uzvedība var negaidīti mainīties.
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [Uz objektu vērsta programmēšana](#TODO)
|
||||
- [SOLID](#solid)
|
||||
|
||||
### Liskova aizstāšanas princips
|
||||
|
||||
[Liskova aizstāšanas princips Vikipēdijā](https://en.wikipedia.org/wiki/Liskov_substitution_principle)
|
||||
|
||||
> ir jābūt iespējai aizstāt tipu ar apakštipu, nelaužot sistēmu.
|
||||
|
||||
Trešais no “[SOLID](#solid)” principiem. Šis princips nosaka, ka, ja kāds komponents balstās uz kādu tipu, tad tam vajadzētu būt iespējai izmantot šāda tipa apakštipus, bez sistēmas kļūmes vai informācijas par to, kas ir šis apakštips.
|
||||
|
||||
Piemēram, iedomājieties, ka mums ir metode, kas nolasa XML dokumentu no struktūras, kas apzīmē failu. Ja metodē ir izmantots bāzes tips “fails”, funkcijā var izmantot jebko, kas izriet no “fails”. Ja 'fails' atbalsta meklēšanu atpakaļgaitā un XML parsētājs izmanto šo funkciju, bet atvasinātais tips 'tīkla fails' neizdodas, mēģinot veikt reverso meklēšanu, tad 'tīkla fails' pārkāptu principu.
|
||||
|
||||
Šim principam ir īpaša nozīme uz objektu orientētā programmēšanā, kur tipa hierarhijas ir rūpīgi jāmodelē, lai izvairītos no sistēmas lietotāju apjukuma.
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [Uz objektu vērsta programmēšana](#TODO)
|
||||
- [SOLID](#solid)
|
||||
|
||||
### Interfeisa segmenta noteikšanas princips
|
||||
|
||||
[Interfeisa segmenta noteikšanas princips Vikipēdijā](https://en.wikipedia.org/wiki/Interface_segregation_principle)
|
||||
|
||||
> Neviens klients nedrīkst būt atkarīgs no metodēm, ko tas neizmanto.
|
||||
|
||||
Ceturtā daļa no “[SOLID](#solid)” principiem. Šis princips nosaka, ka kāda komponenta patērētājiem nevajadzētu būt atkarīgiem no tā komponenta funkcijām, kuru tie faktiski neizmanto.
|
||||
|
||||
Piemēram, iedomājieties, ka mums ir metode, kas nolasa XML dokumentu no struktūras, kas apzīmē failu. Tai tikai jālasa baiti, jāpārvietojas uz priekšu vai jāpārvietojas atpakaļ failā. Ja šī metode ir jāatjaunina, jo mainās ar failu struktūru nesaistīts faila struktūras līdzeklis (piemēram, faila drošības apzīmēšanai izmantotā atļauju modeļa atjauninājums), princips ir anulēts. Labāk būtu, ja fails ieviestu 'tries-stream' interfeisu un XML lasītājs to izmantotu.
|
||||
|
||||
Šim principam ir īpaša nozīme uz objektu orientētajā programmēšanā, kur tiek izmantotas saskarnes, hierarhijas un abstrakti tipi, lai [minimizētu savienošanu](#TODO) starp dažādiem komponentiem. [pīļu tipizēšana](#TODO) ir metodika, kas ievieš šo principu, novēršot nepārprotamas saskarnes.
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [Uz objektu vērsta programmēšana](#TODO)
|
||||
- [SOLID](#solid)
|
||||
- [pīļu tipēšana](#TODO)
|
||||
- [atsaiste](#TODO)
|
||||
|
||||
### Atkarības inversijas princips
|
||||
|
||||
[Atkarības inversijas princips](https://en.wikipedia.org/wiki/Dependency_inversion_principle)
|
||||
|
||||
> Augsta līmeņa moduļi nedrīkst būt atkarīgi no zema līmeņa ieviešanas.
|
||||
|
||||
Piektā daļa no “[SOLID](#solid)” principiem. Šis princips nosaka, ka lielāka līmeņa orķestrācijas komponentiem nav jāzina to atkarības detaļas.
|
||||
|
||||
Piemēram, iedomājieties, ka mums ir programma, kas lasa metadatus no vietnes. Mēs pieņemam, ka galvenais komponents būtu jāzina par komponentu, lai lejupielādētu tīmekļa lapas saturu, pēc tam komponentu, kas var lasīt metadatus. Ja mēs ņemtu vērā atkarības inversiju, galvenais komponents būtu atkarīgs tikai no abstrakta komponenta, kas var iegūt baitu datus, un pēc tam no abstrakta komponenta, kas spētu nolasīt metadatus no baitu straumes. Galvenais komponents nezinātu par TCP/IP, HTTP, HTML utt.
|
||||
|
||||
Šis princips ir sarežģīts, jo var šķist, ka tas "apgriež” sagaidāmās sistēmas (tātad nosaukuma) atkarības. Praksē tas nozīmē arī to, ka atsevišķam orķestrācijas komponentam ir jānodrošina abstrakto tipu pareiza ieviešana (piemēram, iepriekšējā piemērā _kaut kam_ joprojām ir jānodrošina metadatu lasītāja komponents HTTP faila lejupielādētājs un HTML metatagu lasītājs). Tas pieskaras tādiem modeļiem kā [Inversion of Control](#TODO) un [Atkarības injekcija](#TODO).
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [Uz objektu vērsta programmēšana](#TODO)
|
||||
- [SOLID](#solid)
|
||||
- [Control inversija](#TODO)
|
||||
- [Atkarības injekcija](#TODO)
|
||||
|
||||
### DRY princips
|
||||
|
||||
[DRY princips Vikipēdijā](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself)
|
||||
|
||||
> Katram zināšanu gabalam ir jābūt vienotam, nepārprotamam, autoritatīvam attēlojumam sistēmā.
|
||||
|
||||
DRY ir akronīms _Neatkārtot sevi_. Šī principa mērķis ir palīdzēt izstrādātājiem samazināt koda atkārtojumu un saglabāt informāciju vienā vietā, un 1999. gadā to citēja Endrū Bads un Deivs Tomass grāmatā [The Praietverot izstrādātāju](https://en.wikipedia.org/wiki/The_Pragmatic_Programmer)
|
||||
|
||||
> PRETĒJS sausums būtu _WET_ (Rakstiet All Twice vai We Enjoy Typing).
|
||||
|
||||
Praksē, ja jums ir viena un tā pati informācija divās (vai vairākās) dažādās vietās, varat izmantot DRY, lai sapludinātu tās vienā un atkārtoti izmantotu visur, kur vēlaties/vajag.
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [Pracistic Developer](https://en.wikipedia.org/wiki/The_Pragmatic_Programmer)
|
||||
|
||||
### KISS princips
|
||||
|
||||
[KISS princips Vikipēdijā](https://en.wikipedia.org/wiki/KISS_principle)
|
||||
|
||||
> saglabāt vienkāršu, stulbu
|
||||
|
||||
KISS princips nosaka, ka vairums sistēmu darbojas vislabāk, ja tās ir vienkāršas, nevis sarežģītas; tāpēc vienkāršībai jābūt galvenajam mērķim, un jāizvairās no nevajadzīgas sarežģītības. Šī frāze, kuras izcelsme ir ASV Jūras kara flotē 1960. gadā, ir saistīta ar gaisa kuģu inženieri Kelliju Džonsonu.
|
||||
|
||||
Šo principu vislabāk raksturo stāsts par to, ka Džonsons ir pasniedzis dizaina inženieru komandai sauju darbarīku, ar izaicinājumu, ka reaktīvo lidmašīnu, ko viņi projektēja, ir jālabo vidusmēra mehāniķim kaujas apstākļos ar tikai šiem rīkiem. Līdz ar to “muļķīgais” attiecas uz attiecību starp to, kā viss sabrūk, un to, cik sarežģīti ir instrumenti, kas ir pieejami, lai tos salabotu, nevis uz pašu inženieru spējām.
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [Galla Likums](#galla-likums)
|
||||
|
||||
### YAGNI
|
||||
|
||||
[YAGNI Vikipēdijā](https://en.wikipedia.org/wiki/You_ain%27t_gonna_need_it)
|
||||
|
||||
Šis ir akronīms, kas paredzēts _**Y**ou **A**in't **G**onna **N**eed **I**t_.
|
||||
|
||||
> vienmēr ieviesiet lietas, kad tās jums patiešām ir vajadzīgas, nekad neparedzot, ka jums tās ir nepieciešamas.
|
||||
>
|
||||
> ([Ron Jeffries](https://twitter.com/RonJeffries)) (XP līdzdibinātājs un grāmatas “Extreme Programming Installed” autors)
|
||||
|
||||
Šis _Extreme Programming_ (XP) princips paredz, ka izstrādātājiem ir tikai jāievieš tūlītējām prasībām nepieciešamā funkcionalitāte un jāizvairās no mēģinājumiem prognozēt nākotni, ieviešot funkcionalitāti, kas varētu būt nepieciešama vēlāk.
|
||||
|
||||
Ievērojot šo principu, būtu jāsamazina neizmantotā koda daudzums konvertācijā un jāizvairās no laika un pūles izniekošanas funkcionalitātei, kas nerada nekādu vērtību.
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [Lasīšanas saraksts: Extreme Programming Installed](#lasīšanas-saraksts)
|
||||
|
||||
### Dalītās datošanas maldības
|
||||
|
||||
[Dalītās datošanas maldības Vikipēdijā](https://en.wikipedia.org/wiki/Fallacies_of_distributed_computing)
|
||||
|
||||
Fallacies, ko dēvē arī par _Networking Computing_, ir Fallacies saraksts ar pieņēmumiem (vai uzskatiem) par dalīto skaitļošanu, kas var novest pie kļūmēm programmatūras izstrādē. Pieņēmumi ir šādi:
|
||||
|
||||
- tīkls ir uzticams
|
||||
- latentums ir nulle
|
||||
- joslas platums ir bezgalīgs
|
||||
- tīkls ir drošs
|
||||
- topoloģija nemainās
|
||||
- ir viens administrators,
|
||||
- transporta izmaksas ir nulle
|
||||
- tīkls ir viendabīgs
|
||||
|
||||
Pirmo četru pozīciju sarakstā bija iekļauti [Bill Joy](https://en.wikipedia.org/wiki/Bill_Joy) un [Tom Lyon](https://twitter.com/aka_pugs) aptuveni 1991. gadā, un tās pirmo reizi klasificēja [James Gosling](https://en.wikipedia.org/wiki/James_Gosling) kā “Networks Computing” Fallacies. [L. Peter Deutsch](https://en.wikipedia.org/wiki/L._Peter_Deutsch) pievienoja 5., 6. un 7. 90. gadu beigās Goslings pievienoja 8. maldu.
|
||||
|
||||
Grupu iedvesmoja tas, kas tolaik notika [Sun Microsystems](https://en.wikipedia.org/wiki/Sun_Microsystems).
|
||||
|
||||
Šīs kļūdas būtu rūpīgi jāapsver, izstrādājot kodu, kas ir elastīgs; pieņemot, ka kāds no šiem viltojumiem var novest pie kļūdainas loģikas, kas nerisina dalīto sistēmu realitāti un sarežģītību.
|
||||
|
||||
Skatīt arī:
|
||||
|
||||
- [Barošana dalītās datošanas maldības (1. daļa) — Vaidehi Jošipar vidēju](https://medium.com/baseds/foraging-for-the-fallacies-of-trapped-part-1-1b35c3b85b53)
|
||||
- [Deutsch's Fallacies, 10 years After](http://java.sys-con.com/node/38665)
|
||||
|
||||
## Lasīšanas saraksts
|
||||
|
||||
Ja šos jēdzienus esat uzskatījis par interesantiem, varat baudīt šādas grāmatas.
|
||||
|
||||
- [Extreme Programming Installed - Ron Jeffries, Ann Anderson, Chet Hendrikson](https://www.goodreads.com/en/book/show/67834).
|
||||
- [The Mythical Man Monthly - Frederik P. Brooks Jr.](https://www.goodreads.com/book/show/13629.The_Mythical_Man_Month) - Klasisks sējums par programmatūras inženieriju. [Brūku likums](#bruku-likums) ir grāmatas galvenā tēma.
|
||||
- [Gödel, Escher, Bahs: An Mūžīgais Zelta Breids - Duglass R. Hofštters.](https://www.goodreads.com/book/show/24113.G_del_Escher_Bach) - Šo grāmatu ir grūti klasificēt. [hofstadtera likums](#hofstadtera-likums) ir no grāmatas.
|
||||
- [Dilberta princips - Scott Adams](https://www.goodreads.com/book/show/85574.The_Dilbert_Principle) - Komisks skats uz korporatīvo Ameriku, no autora, kurš radīja [Dilbert principu](#the-dilbert-principle).
|
||||
- [The Peter Principle - Lawrence J. Peter](https://www.goodreads.com/book/show/890728.The_Peter_Principle) - Vēl viens komisks skatījums uz lielāku organizāciju un tautas menedžmenta izaicinājumiem, [The Peter Principle](#the-peter-principle) avots.
|
||||
|
||||
## Saistītie projekti
|
||||
|
||||
- Dienas padoms - saņemiet ikdienas hakeru likumu/principu.
|
||||
|
||||
## Ieguldījums
|
||||
|
||||
Lūdzu, sniedziet ieguldījumu! [celiet problēmu](https://github.com/dwmkerr/hacker-laws/issues/new), ja vēlaties ierosināt papildinājumu vai izmaiņas, vai [Atvērt vilkšanas pieprasījumu](https://github.com/dwmkerr/hacker-law/compare), lai piedāvātu savas izmaiņas.
|
||||
|
||||
Lūdzu, izlasiet [Ieguldījuma vadlīnijas](./.github/contributing.md) prasības par tekstu, stilu un tā tālāk. Iesaistoties diskusijās par projektu, lūdzu, ņemiet vērā [Uzvedības kodeksu](./.github/CODE_OF_CONDUCT.md).
|
||||
|
||||
## TODO
|
||||
|
||||
Sveiks! Ja jūs nolaisties šeit, jūs esat noklikšķinājis uz saites uz tēmu, kuru es vēl neesmu uzrakstījis, atvainojiet par to - šis ir darbs, kas notiek!
|
||||
|
||||
Lai iesniegtu piedāvāto tēmas definīciju, varat [Raise an Issue](https://github.com/dwmkerr/hacker-law/issues) pieprasīt detalizētāku informāciju vai [Open a Pull Request](https://github.com/dwmkerr/hacker-laws/pull).
|
||||
479
translations/pt-BR.md
Normal file
479
translations/pt-BR.md
Normal file
@@ -0,0 +1,479 @@
|
||||
# 💻📖 hacker-laws
|
||||
|
||||
Leis, Teorias, Principios e Padrões que desenvolvedores acham úteis.
|
||||
|
||||
- 🇨🇳 [中文 / Versão Chinesa ](https://github.com/nusr/hacker-laws-zh) - Obrigado [Steve Xu](https://github.com/nusr)!
|
||||
- 🇰🇷 [한국어 / Versão Koreana](https://github.com/codeanddonuts/hacker-laws-kr) - Obrigado [Doughnut](https://github.com/codeanddonuts)!
|
||||
- 🇷🇺 [Русская версия / Versão Russa](https://github.com/solarrust/hacker-laws) - Obrigado [Alena Batitskaya](https://github.com/solarrust)!
|
||||
- 🇹🇷 [Türkçe / Versão Turka](https://github.com/umutphp/hacker-laws-tr) - Obrigado [Umut Işık](https://github.com/umutphp)
|
||||
|
||||
---
|
||||
|
||||
<!-- vim-markdown-toc GFM -->
|
||||
|
||||
* [Introdução](#introdução)
|
||||
* [Leis](#leis)
|
||||
* [Lei De Amdahl](#lei-de-amdahl)
|
||||
* [Lei de Brook](#lei-de-brook)
|
||||
* [Lei de Conway](#lei-de-conway)
|
||||
* [Número de Dunbar](#número-de-dunbar)
|
||||
* [Navalha de Hanlon](#navalha-de-hanlon)
|
||||
* [Lei de Hofstadter](#lei-de-hofstadter)
|
||||
* [O Ciclo Hype e Lei de Amara](#o-ciclo-hype-e-lei-de-amara)
|
||||
* [Lei de Hyrum (A lei de interfaces implicitas)](#lei-de-hyrum-a-lei-de-interfaces-implicitas)
|
||||
* [Lei de Moore](#lei-de-moore)
|
||||
* [Lei de Parkinson](#lei-de-parkinson)
|
||||
* [Lei de Putt](#lei-de-putt)
|
||||
* [A lei da Conservação de Complexidade (Lei de Tesler)](#a-lei-da-conservação-de-complexidade-lei-de-tesler)
|
||||
* [A lei das Abstrações gotejantes](#a-lei-das-abstrações-gotejantes)
|
||||
* [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)
|
||||
* [Principles](#principles)
|
||||
* [The Pareto Principle (The 80/20 Rule)](#the-pareto-principle-the-8020-rule)
|
||||
* [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)
|
||||
* [YAGNI](#yagni)
|
||||
* [Lista de Livros](#lista-de-livros)
|
||||
* [Em Progresso](#em-progresso)
|
||||
|
||||
<!-- vim-markdown-toc -->
|
||||
|
||||
## Introdução
|
||||
|
||||
Existem muitas leis que as pessoas discutem quando falam sobre desenvolvimento. Esse repositório é uma referencia e uma visão global dos mais comuns. Sinta-se a vontade para contribuir e compartilhar.
|
||||
|
||||
<!--There are lots of laws which people discuss when talking about development. This repository is a reference and overview of some of the most common ones. Please share and submit PRs! <!-->
|
||||
|
||||
❗: Esse repositório contém explicações sobre algumas léis, pincípios e padrões, mas não _advoca_ para nenhum. Se eles devem ser aplicados sempre é uma questão de debate, e depende diretamente no que você está trabalhando.
|
||||
|
||||
## Leis
|
||||
|
||||
Lá vamos nós!!
|
||||
|
||||
### Lei De Amdahl
|
||||
|
||||
[Lei de Amdahl na Wikipedia](https://pt.wikipedia.org/wiki/Lei_de_Amdahl)
|
||||
|
||||
> 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.
|
||||
|
||||
O diagrama abaixo mostra alguns exemplos de melhoria na velocidade:
|
||||
|
||||

|
||||
|
||||
*(Image Reference: By Daniels220 at English Wikipedia, Creative Commons Attribution-Share Alike 3.0 Unported, https://en.wikipedia.org/wiki/File:AmdahlsLaw.svg)*
|
||||
|
||||
Como pode-se perceber, mesmo um programa que teve metade da sua implementação de forma paralela, o benefício é menos de 10 _processing units_. Porém, um programa 95% paralelo, o ganho pode passar de 20 _processing units_.
|
||||
|
||||
### Lei de Brook
|
||||
|
||||
[Lei de Brooks na Wikipeia](https://en.wikipedia.org/wiki/Brooks%27s_law)
|
||||
|
||||
|
||||
> 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.
|
||||
|
||||
|
||||
Esse é um tema central do livro'[The Mythical Man Month](#lista-de-livros)'.
|
||||
|
||||
Veja também:
|
||||
|
||||
- [Death March](#em-progresso)
|
||||
- [Livro: The Mythical Man Month](#lista-de-livros)
|
||||
|
||||
### Lei de Conway
|
||||
|
||||
[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.
|
||||
|
||||
Veja também:
|
||||
|
||||
- [Modelo do Spotify](#modelo-spotify)
|
||||
|
||||
### Número de Dunbar
|
||||
|
||||
[Número de Dunbar na Wikipedia](https://en.wikipedia.org/wiki/Dunbar%27s_number)
|
||||
|
||||
[Dumbar] 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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
Veja também:
|
||||
|
||||
- [Lei de Conwy](#lei-de-conway)
|
||||
|
||||
### Navalha de Hanlon
|
||||
|
||||
[Navalha de Hanlon na wikipedia](https://en.wikipedia.org/wiki/Hanlon%27s_razor)
|
||||
|
||||
> Nunca atribua à malícia aquilo que é adequadamente explicado por estupidez.
|
||||
>
|
||||
> 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.
|
||||
|
||||
|
||||
|
||||
### Lei de Hofstadter
|
||||
|
||||
[Lei de Hofstadter na Wikipedia](https://en.wikipedia.org/wiki/Hofstadter%27s_law)
|
||||
|
||||
|
||||
> Sempre leva mais tempo do que esperado, mesmo quando se leva em conta a lei do Hofstadter.
|
||||
>
|
||||
> Douglas Hofstadter
|
||||
|
||||
Você já deve ter ouvido sobre essa lei quando se fala em estimar tempo para fazer algo. Quando se fala em desenvolvimento de software parece obvio que nós tendemos a não sermos muitos precisos em estimar quando tempo levará para entregar alguma coisa.
|
||||
|
||||
This is from the book '[Gödel, Escher, Bach: An Eternal Golden Braid](#lista-de-livros)'.
|
||||
|
||||
|
||||
### O Ciclo Hype e Lei de Amara
|
||||
|
||||
|
||||
[The ciclo Hype on Wikipedia](https://en.wikipedia.org/wiki/Hype_cycle)
|
||||
|
||||
>Nós tendemos a superestimar os efeitos da tecnologia em curto prazo e subestimar os efeitos a longo prazo.
|
||||
>
|
||||
> Roy Amara
|
||||
|
||||
O Ciclo Hype é uma representação visual da empolgação e desenvolvimento da tecnologia ao longo do tempo, originalmente produzida por Gartner.
|
||||

|
||||
|
||||
*(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".
|
||||
|
||||
|
||||
### Lei de Hyrum (A lei de interfaces implicitas)
|
||||
|
||||
[Lei de Hyrum site](http://www.hyrumslaw.com/)
|
||||
|
||||
|
||||
>Com um número suficientes de clientes de uma API,
|
||||
>não importa a sua pré-condição no contato:
|
||||
>todos os comportamentos observáveis do seu sistema
|
||||
>serão dependentes de alguém.
|
||||
>
|
||||
> (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.
|
||||
|
||||
Veja Também:
|
||||
|
||||
- [XKCD 1172](https://xkcd.com/1172/)
|
||||
|
||||
### Lei de Moore
|
||||
|
||||
[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.
|
||||
|
||||
|
||||
Até meados de 1965 não havia nenhuma previsão real sobre o futuro do hardware, quando Gordon E. Moore fez sua profecia, na qual o número de transistores dos chips teria um aumento de 100%, pelo mesmo custo, a cada período de 18 meses. Essa profecia tornou-se realidade e acabou ganhando o nome de Lei de Moore.
|
||||
|
||||
Esta lei serve de parâmetro para uma elevada gama de dispositivos digitais, além das CPUs. Na verdade, qualquer chip está ligado a lei de Gordon E. Moore, até mesmo o CCD de câmeras fotográficas digitais (sensor que capta a imagem nas câmeras nuclear; ou CNCL, sensores que captam imagens nas câmeras fotográficas profissionais).
|
||||
|
||||
Esse padrão continuou a se manter, e não se espera que pare até, no mínimo, 2021.
|
||||
|
||||
### Lei de Parkinson
|
||||
|
||||
[Lei de Parkinson](https://en.wikipedia.org/wiki/Parkinson%27s_law)
|
||||
|
||||
>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.
|
||||
|
||||
### Lei de Putt
|
||||
|
||||
[Lei de Putt na wikipedia](https://en.wikipedia.org/wiki/Putt%27s_Law_and_the_Successful_Technocrat)
|
||||
|
||||
> Tecnologia é dominada por dois tipos de pessoa. Aqueles que entendem o que não gerenciam e aqueles que gerenciam o que não entendem.
|
||||
|
||||
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)
|
||||
|
||||
Veja também:
|
||||
|
||||
- [O Principio de Peter](#em-progresso)
|
||||
- [Lei de Dilbert](#em-progresso).
|
||||
|
||||
|
||||
### A lei da Conservação de Complexidade (Lei de Tesler)
|
||||
|
||||
[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.
|
||||
|
||||
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.
|
||||
|
||||
Um elemento interessante para essa lei é a sugestão de que, mesmo simplificando todo o sistema, a complexidade intrínseca não é reduzida, ela é “movida para o usuário”, que deve se comportar de uma maneira mais complexa.
|
||||
|
||||
### A lei das Abstrações gotejantes
|
||||
|
||||
[The Law of Leaky Abstractions on Joel on Software](https://www.joelonsoftware.com/2002/11/11/the-law-of-leaky-abstractions/)
|
||||
|
||||
>Todas as abstrações não triviais, até certo ponto, são vazadas
|
||||
|
||||
This law states that abstractions, which are generally used in computing to simplify working with complicated systems, will in certain situations 'leak' elements of the underlying system, this making the abstraction behave in an unexpected way.
|
||||
|
||||
An example might be loading a file and reading its contents. The file system APIs are an _abstraction_ of the lower level kernel systems, which are themselves an abstraction over the physical processes relating to changing data on a magnetic platter (or flash memory for an SSD). In most cases, the abstraction of treating a file like a stream of binary data will work. However, for a magnetic drive, reading data sequentially will be *significantly* faster than random access (due to increased overhead of page faults), but for an SSD drive, this overhead will not be present. Underlying details will need to be understood to deal with this case (for example, database index files are structured to reduce the overhead of random access), the abstraction 'leaks' implementation details the developer may need to be aware of.
|
||||
|
||||
The example above can become more complex when _more_ abstractions are introduced. The Linux operating system allows files to be accessed over a network but represented locally as 'normal' files. This abstraction will 'leak' if there are network failures. If a developer treats these files as 'normal' files, without considering the fact that they may be subject to network latency and failures, the solutions will be buggy.
|
||||
|
||||
The article describing the law suggests that an over-reliance on abstractions, combined with a poor understanding of the underlying processes, actually makes dealing with the problem at hand _more_ complex in some cases.
|
||||
|
||||
See also:
|
||||
|
||||
- [Hyrum's Law](#hyrums-law-the-law-of-implicit-interfaces)
|
||||
|
||||
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 Triviality
|
||||
|
||||
[The Law of Triviality on Wikipedia](https://en.wikipedia.org/wiki/Law_of_triviality)
|
||||
|
||||
This law suggests that groups will give far more time and attention to trivial or cosmetic issues rather than serious and substantial ones.
|
||||
|
||||
The common fictional example used is that of a committee approving plans for nuclear power plant, who spend the majority of their time discussing the structure of the bike shed, rather than the far more important design for the power plant itself. It can be difficult to give valuable input on discussions about very large, complex topics without a high degree of subject matter expertise or preparation. However, people want to be seen to be contributing valuable input. Hence a tendency to focus too much time on small details, which can be reasoned about easily, but are not necessarily of particular importance.
|
||||
|
||||
The fictional example above led to the usage of the term 'Bike Shedding' as an expression for wasting time on trivial details.
|
||||
|
||||
### The Unix Philosophy
|
||||
|
||||
[The Unix Philosophy on Wikipedia](https://en.wikipedia.org/wiki/Unix_philosophy)
|
||||
|
||||
The Unix Philosophy is that software components should be small, and focused on doing one specific thing well. This can make it easier to build systems by composing together small, simple, well-defined units, rather than using large, complex, multi-purpose programs.
|
||||
|
||||
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 Spotify Model
|
||||
|
||||
[The Spotify Model on Spotify Labs](https://labs.spotify.com/2014/03/27/spotify-engineering-culture-part-1/)
|
||||
|
||||
The Spotify Model is an approach to team and organisation structure which has been popularised by 'Spotify'. In this model, teams are organised around features, rather than technologies.
|
||||
|
||||
The Spotify Model also popularises the concepts of Tribes, Guilds, Chapters, which are other components of their organisation structure.
|
||||
|
||||
### Wadler's Law
|
||||
|
||||
[Wadler's Law on wiki.haskell.org](https://wiki.haskell.org/Wadler's_Law)
|
||||
|
||||
> In any language design, the total time spent discussing a feature in this list is proportional to two raised to the power of its position.
|
||||
>
|
||||
> 0. Semantics
|
||||
> 1. Syntax
|
||||
> 2. Lexical syntax
|
||||
> 3. Lexical syntax of comments
|
||||
>
|
||||
> (In short, for every hour spent on semantics, 8 hours will be spent on the syntax of comments).
|
||||
|
||||
Similar to [The Law of Triviality](#the-law-of-triviality), Wadler's Law states what when designing a language, the amount of time spent on language structures is disproportionately high in comparison to the importance of those features.
|
||||
|
||||
See also:
|
||||
|
||||
- [The Law of Triviality](#the-law-of-triviality)
|
||||
|
||||
## Principles
|
||||
|
||||
Principles are generally more likely to be guidelines relating to design.
|
||||
|
||||
### The Pareto Principle (The 80/20 Rule)
|
||||
|
||||
[The Pareto Principle on Wikipedia](https://en.wikipedia.org/wiki/Pareto_principle)
|
||||
|
||||
> Most things in life are not distributed evenly.
|
||||
|
||||
The Pareto Principle suggests that in some cases, the majority of results come from a minority of inputs:
|
||||
|
||||
- 80% of a certain piece of software can be written in 20% of the total allocated time (conversely, the hardest 20% of the code takes 80% of the time)
|
||||
- 20% of the effort produces 80% of the result
|
||||
- 20% of the work creates 80% of the revenue
|
||||
- 20% of the bugs cause 80% of the crashes
|
||||
- 20% of the features cause 80% of the usage
|
||||
|
||||
In the 1940s American-Romanian engineer Dr. Joseph Juran, who is widely credited with being the father of quality control, [began to apply the Pareto principle to quality issues](https://en.wikipedia.org/wiki/Joseph_M._Juran).
|
||||
|
||||
This principle is also known as: The 80/20 Rule, The Law of the Vital Few and The Principle of Factor Sparsity.
|
||||
|
||||
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 Robustness Principle (Postel's Law)
|
||||
|
||||
[The Robustness Principle on Wikipedia](https://en.wikipedia.org/wiki/Robustness_principle)
|
||||
|
||||
> Be conservative in what you do, be liberal in what you accept from others.
|
||||
|
||||
Often applied in server application development, this principle states that what you send to others should be as minimal and conformant as possible, but you should be aim to allow non-conformant input if it can be processed.
|
||||
|
||||
The goal of this principle is to build systems which are robust, as they can handle poorly formed input if the intent can still be understood. However, there are potentially security implications of accepting malformed input, particularly if the processing of such input is not well tested.
|
||||
|
||||
### SOLID
|
||||
|
||||
This is an acronym, which refers to:
|
||||
|
||||
* S: [The Single Responsibility Principle](#the-single-responsibility-principle)
|
||||
* O: [The Open/Closed Principle](#the-openclosed-principle)
|
||||
* L: [The Liskov Substitution Principle](#the-liskov-substitution-principle)
|
||||
* I: [The Interface Segregation Principle](#the-interface-segregation-principle)
|
||||
* D: [The Dependency Inversion Principle](#the-dependency-inversion-principle)
|
||||
|
||||
These are key principles in [Object-Oriented Programming](#todo). Design principles such as these should be able to aid developers build more maintainable systems.
|
||||
|
||||
### The Single Responsibility Principle
|
||||
|
||||
[The Single Responsibility Principle on Wikipedia](https://en.wikipedia.org/wiki/Single_responsibility_principle)
|
||||
|
||||
> Every module or class should have a single responsibility only.
|
||||
|
||||
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.
|
||||
|
||||
See also:
|
||||
|
||||
- [Object-Oriented Programming](#todo)
|
||||
- [SOLID](#solid)
|
||||
|
||||
### The Open/Closed Principle
|
||||
|
||||
[The Open/Closed Principle on Wikipedia](https://en.wikipedia.org/wiki/Open%E2%80%93closed_principle)
|
||||
|
||||
> Entities should be open for extension and closed for modification.
|
||||
|
||||
The second of the '[SOLID](#solid)' principles. This principle states that entities (which could be classes, modules, functions and so on) should be able to have their behaviour _extended_, but that their _existing_ behaviour should not be able to be modified.
|
||||
|
||||
As a hypothetical example, imagine a module which is able to turn a Markdown document into HTML. If the module could be extended to handle a newly proposed markdown feature, without modifying the module internals, then it would be open for extension. If the module could _not_ be modified by a consumer so that how existing Markdown features are handled, then it would be _closed_ for modification.
|
||||
|
||||
This principle has particular relevance for object-oriented programming, where we may design objects to be easily extended, but would avoid designing objects which can have their existing behaviour changed in unexpected ways.
|
||||
|
||||
See also:
|
||||
|
||||
- [Object-Oriented Programming](#todo)
|
||||
- [SOLID](#solid)
|
||||
|
||||
### The Liskov Substitution Principle
|
||||
|
||||
[The Liskov Substitution Principle on Wikipedia](https://en.wikipedia.org/wiki/Liskov_substitution_principle)
|
||||
|
||||
> It should be possible to replace a type with a subtype, without breaking the system.
|
||||
|
||||
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.
|
||||
|
||||
This principle has particular relevance for object-oriented programming, where type hierarchies must be modeled carefully to avoid confusing users of a system.
|
||||
|
||||
See also:
|
||||
|
||||
- [Object-Oriented Programming](#todo)
|
||||
- [SOLID](#solid)
|
||||
|
||||
### The Interface Segregation Principle
|
||||
|
||||
[The Interface Segregation Principle on Wikipedia](https://en.wikipedia.org/wiki/Interface_segregation_principle)
|
||||
|
||||
> No client should be forced to depend on methods it does not use.
|
||||
|
||||
The fourth of the '[SOLID](#solid)' principles. This principle states that consumers of a component should not depend on functions of that component which it doesn't actually use.
|
||||
|
||||
As an example, imagine we have a method which reads an XML document from a structure which represents a file. It only needs to read bytes, move forwards or move backwards in the file. If this method needs to be updated because an unrelated feature of the file structure changes (such as an update to the permissions model used to represent file security), then the principle has been invalidated. It would be better for the file to implement a 'seekable-stream' interface, and for the XML reader to use that.
|
||||
|
||||
This principle has particular relevance for object-oriented programming, where interfaces, hierarchies and abstract types are used to [minimise the coupling](#todo) between different components. [Duck typing](#todo) is a methodology which enforces this principle by eliminating explicit interfaces.
|
||||
|
||||
See also:
|
||||
|
||||
- [Object-Oriented Programming](#todo)
|
||||
- [SOLID](#solid)
|
||||
- [Duck Typing](#todo)
|
||||
- [Decoupling](#todo)
|
||||
|
||||
### The Dependency Inversion Principle
|
||||
|
||||
[The Dependency Inversion Principle on Wikipedia](https://en.wikipedia.org/wiki/Dependency_inversion_principle)
|
||||
|
||||
> 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.
|
||||
|
||||
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.
|
||||
|
||||
This principle is complex, as it can seem to 'invert' the expected dependencies of a system (hence the name). In practice, it also means that a separate orchestrating component must ensure the correct implementations of abstract types are used (e.g. in the previous example, _something_ must still provide the metadata reader component a HTTP file downloader and HTML meta tag reader). This then touches on patterns such as [Inversion of Control](#todo) and [Dependency Injection](#todo).
|
||||
|
||||
See also:
|
||||
|
||||
- [Object-Oriented Programming](#todo)
|
||||
- [SOLID](#solid)
|
||||
- [Inversion of Control](#todo)
|
||||
- [Dependency Injection](#todo)
|
||||
|
||||
### The DRY Principle
|
||||
|
||||
[The DRY Principle on Wikipedia](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself)
|
||||
|
||||
> 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)
|
||||
|
||||
> The opposite of DRY would be _WET_ (Write Everything Twice or We Enjoy Typing).
|
||||
|
||||
In practice, if you have the same piece of information in two (or more) different places, you can use DRY to merge them into a single one and reuse it wherever you want/need.
|
||||
|
||||
See also:
|
||||
|
||||
- [The Pragmatic Developer](https://en.wikipedia.org/wiki/The_Pragmatic_Programmer)
|
||||
|
||||
### YAGNI
|
||||
|
||||
[YAGNI on Wikipedia](https://en.wikipedia.org/wiki/You_aren%27t_gonna_need_it)
|
||||
|
||||
This is an acronym for _**Y**ou **A**ren't **G**onna **N**eed **I**t_.
|
||||
|
||||
> Always implement things when you actually need them, never when you just foresee that you need them.
|
||||
>
|
||||
> ([Ron Jeffries](https://twitter.com/RonJeffries)) (XP co-founder and author of the book "Extreme Programming Installed")
|
||||
|
||||
This _Extreme Programming_ (XP) principle suggests developers should only implement functionality that is needed for the immediate requirements, and avoid attempts to predict the future by implementing functionality that might be needed later.
|
||||
|
||||
Adhering to this principle should reduce the amount of unused code in the codebase, and avoid time and effort being wasted on functionality that brings no value.
|
||||
|
||||
See also:
|
||||
|
||||
- [Reading List: Extreme Programming Installed](#reading-list)
|
||||
|
||||
|
||||
## Lista de Livros
|
||||
|
||||
If you have found these concepts interesting, you may enjoy the following books.
|
||||
|
||||
- [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.
|
||||
|
||||
## Em Progresso
|
||||
|
||||
Hi! If you land here, you've clicked on a link to a topic I've not written up yet, sorry about this - this is work in progress!
|
||||
|
||||
Feel free to [Raise an Issue](https://github.com/dwmkerr/hacker-laws/issues) requesting more details, or [Open a Pull Request](https://github.com/dwmkerr/hacker-laws/pulls) to submit your proposed definition of the topic.
|
||||
@@ -7,6 +7,10 @@ Programcıların faydalı bulacağı yasalar, teoriler, prensipler ve desenler.
|
||||
- 🇰🇷 [한국어 / Korece İçin](https://github.com/codeanddonuts/hacker-laws-kr) - Teşekkürler [Doughnut](https://github.com/codeanddonuts)!
|
||||
- 🇷🇺 [Русская версия / Rusça İçin](https://github.com/solarrust/hacker-laws) - Teşekkürler [Alena Batitskaya](https://github.com/solarrust)!
|
||||
- 🇹🇷 [Türkçe / Turkçe İçin](https://github.com/umutphp/hacker-laws-tr) - Teşekkürler [Umut Işık](https://github.com/umutphp)
|
||||
- 🇧🇷 [Brasileiro / Brezilyaca İçin](./translations/pt-BR.md) - Teşekkürler [Leonardo Costa](https://github.com/LeoFC97)
|
||||
- 🇪🇸 [Castellano / İspanyolca İçin](./translations/es-ES.md) - Teşekkürler [Manuel Rubio](https://github.com/manuel-rubio)
|
||||
|
||||
Bu projeyi beğendiniz mi? Lütfen [sponsor olmayı](https://github.com/sponsors/dwmkerr) düşünün!
|
||||
|
||||
---
|
||||
|
||||
@@ -15,27 +19,32 @@ Programcıların faydalı bulacağı yasalar, teoriler, prensipler ve desenler.
|
||||
- [Giriş](#introduction)
|
||||
- [Yasalar](#laws)
|
||||
- [Amdahl Yasası](#amdahls-law)
|
||||
- [Kırık Camlar Teorisi](#k%C4%B1r%C4%B1k-camlar-teorisi)
|
||||
- [Brooks Yasası](#brooks-law)
|
||||
- [Conway Yasası](#conways-law)
|
||||
- [Cunningham Yasası](#cunninghams-law)
|
||||
- [Dunbar Sayısı](#dunbars-number)
|
||||
- [Gall Yasası](#galls-yasa)
|
||||
- [Gall Yasası](#galls-law)
|
||||
- [Goodhart Yasası](#goodharts-law)
|
||||
- [Hanlon'un Usturası](#hanlons-razor)
|
||||
- [Hofstadter Yasası](#hofstadters-law)
|
||||
- [Hutber Yasası](#hutbers-law)
|
||||
- [Hype Döngüsü ve Amara Yasası](#the-hype-cycle--amaras-law)
|
||||
- [Hyrum Yasası (Arabirimlerin Örtülü Hukuku)](#hyrums-law-the-law-of-implicit-interfaces)
|
||||
- [Metcalfe Yasası](#metcalfes-law)
|
||||
- [Moore Yasası](#moores-law)
|
||||
- [Murphy Yasası / Sod Yasası](#murphys-law--sods-law)
|
||||
- [Parkinson Yasası](#parkinsons-law)
|
||||
- [Olgunlaşmamış Optimizasyon Etkisi](#premature-optimization-effect)
|
||||
- [Putt Yasası](#putts-law)
|
||||
- [Reed Yasası](#reeds-law)
|
||||
- [Karmaşıklığın Korunması Yasası (Tesler Yasası)](#the-law-of-conservation-of-complexity-teslers-law)
|
||||
- [Sızdıran Soyutlamalar Yasası](#the-law-of-leaky-abstractions)
|
||||
- [Önemsizlik Yasası](#the-law-of-triviality)
|
||||
- [Unix Felsefesi](#the-unix-philosophy)
|
||||
- [Spotify Modeli](#the-spotify-model)
|
||||
- [Wadler Yasası](#wadlers-law)
|
||||
- [Wheaton Yasası](#wheatons-law)
|
||||
- [Prensipler](#principles)
|
||||
- [Dilbert Prensibi](#the-dilbert-principle)
|
||||
- [Pareto Prensibi (80/20 Kuralı)](#the-pareto-principle-the-8020-rule)
|
||||
@@ -48,9 +57,11 @@ Programcıların faydalı bulacağı yasalar, teoriler, prensipler ve desenler.
|
||||
- [Arayüz Ayrım Prensibi](#the-interface-segregation-principle)
|
||||
- [Bağımlılığın Ters Çevrilmesi](#the-dependency-inversion-principle)
|
||||
- [DRY Prensibi](#the-dry-principle)
|
||||
- [KISS prensibi](#%C3%B6p%C3%BCc%C3%BCk-prensibi)
|
||||
- [KISS prensibi](#the-kiss-principle)
|
||||
- [YAGNI](#yagni)
|
||||
- [Dağıtık Sistemlerin Yanılgıları](#the-fallacies-of-distributed-computing)
|
||||
- [Ek Kaynaklar](#reading-list)
|
||||
- [Katkıda Bulunmak İçin](#katk%C4%B1)
|
||||
- [TODO](#todo)
|
||||
|
||||
<!-- vim-markdown-toc -->
|
||||
@@ -75,7 +86,7 @@ En güzel şu örnekle anlatılabilir. Bir programın iki bölümden oluştuğun
|
||||
|
||||
Aşağıdaki diyagram bazı olası hız geliştirmelerine örnekler içeriyor:
|
||||
|
||||

|
||||
<img width="480px" alt="Diagram: Amdahl's Law" src="../images/amdahls_law.png">
|
||||
|
||||
*(Diyagramın kaynağı: Daniels220 tarafından İngilizce Wikipedia'da, Creative Commons Attribution-Share Alike 3.0 Unported, https://en.wikipedia.org/wiki/File:AmdahlsLaw.svg)*
|
||||
|
||||
@@ -88,6 +99,24 @@ Ek kaynaklar:
|
||||
- [Brooks Yasası](#brooks-law)
|
||||
- [Moore Yasası ](#moores-law)
|
||||
|
||||
### Kırık Camlar Teorisi
|
||||
|
||||
[Wikipedia'da Kırık Camlar Teorisi](https://en.wikipedia.org/wiki/Broken_windows_theory)
|
||||
|
||||
Kırık Camlar Teorisi, gözle görülebilir suç belirtilerinin (ya da ortamın bakımsızlığının) daha ciddi suçlara (ya da ortamın daha da bozulmasına) yol açtığını göstermektedir.
|
||||
|
||||
Bu teori, yazılım geliştirmeye şu şekilde uygulanabilir; düşük kalite kodun (veya [Teknik Borcun](#TODO)) varlığı kaliteyi geliştirme çabalarının göz ardı edilebileceği veya önemsenmeyeceği algısına yol açabileceği ve dolayısıyla düşük kalite koda sebep olabileceğidir. Bu etki zamanla kalitenin daha çok azalmasına neden olur.
|
||||
|
||||
Ek kaynaklar:
|
||||
|
||||
- [Teknik Borç](#yapmak)
|
||||
|
||||
Örnekler:
|
||||
|
||||
- [Pragmatik Programlama: Yazılım Entropisi](https://pragprog.com/the-pragmatic-programmer/extracts/software-entropy)
|
||||
- [Kodlama Kabusu: Kırık Camlar Teorisi](https://blog.codinghorror.com/the-broken-window-theory/)
|
||||
- [Açık Kaynak: Eğlenceli Programlama - Kırık Camlar Teorisi](https://opensourceforu.com/2011/05/joy-of-programming-broken-window-theory/)
|
||||
|
||||
### Brooks Yasası
|
||||
|
||||
[Wikipedia'da Brooks Yasası](https://en.wikipedia.org/wiki/Brooks%27s_law)
|
||||
@@ -145,6 +174,8 @@ Ek kaynaklar:
|
||||
|
||||
> Çalışan karmaşık bir sistemin her zaman işe yarayan daha basit bir sistemden evrimleştiği kesinlikle söylenebilir. Başlangıçtan itibaren karmaşık tasarlanmış bir sistemin asla çalışmayacağı ve sonradan da düzeltilemeyeceği kesindir. Çalışsan daha basit bir sistem ile başlamanız gerekir.
|
||||
> ([John Gall](https://en.m.wikipedia.org/wiki/John_Gall_(author)))
|
||||
> ([John Gall](https://en.m.wikipedia.org/wiki/John_Gall_(author)))
|
||||
> ([John Gall](https://en.m.wikipedia.org/wiki/John_Gall_(author)))
|
||||
|
||||
Gall Yasası der ki, çok karmaşık sistemleri *tasarlamaya* çalışmak her zaman başarısızlıkla sonuçlanır. Bu tür sistemlerin ilk denemede başarılı olmaları çok nadir görülür ama genellikle basit sistemlerden evrilirler.
|
||||
|
||||
@@ -154,6 +185,32 @@ Ek kaynaklar:
|
||||
|
||||
- [KISS (Keep It Simple, Stupid)](#the-kiss-principle)
|
||||
|
||||
### Goodhart Yasası
|
||||
|
||||
[Wikipedia'da Goodhart Yasası](https://en.wikipedia.org/wiki/Goodhart's_law)
|
||||
|
||||
> Gözlemlenen herhangi bir istatistiksel düzenlilik, kontrol amaçları için üzerine baskı uygulandığında çökme eğiliminde olacaktır.
|
||||
> *Charles Goodhart*
|
||||
> *Charles Goodhart*
|
||||
|
||||
Ayrıca şu şekilde de ifade edilir:
|
||||
|
||||
> Bir ölçüm hedef haline geldiğinde, iyi bir ölçüm olmaktan çıkar.
|
||||
> *Marilyn Strathern*
|
||||
> *Marilyn Strathern*
|
||||
|
||||
Bu yasa, ölçüme dayalı optimizasyonların, ölçüm sonucunun kendisinin anlamsızlaşmasına yol açabileceğini belirtmektedir. Bir prosese kör bir şekilde uygulanan aşırı seçici tedbirler ( [KPI'ler](https://en.wikipedia.org/wiki/Performance_indicator) ) çarpık bir etkiye neden olur. İnsanlar, eylemlerinin bütünsel sonuçlarına dikkat etmek yerine belirli metrikleri tatmin etmek için sistemle "oynayarak" yerel olarak optimize etme eğilimindedir.
|
||||
|
||||
Gerçek dünyadan örnekler:
|
||||
|
||||
- "Asert" olmadan yazılan testler, ölçümün amacının iyi test edilmiş bir yazılım oluşturmak olmasına rağmen sadece kod kapsamı beklentisini karşılar.
|
||||
- Yazılan satır sayısının gösterdiği geliştirici performans puanı haksız yere şişirilmiş kod tabanına yol açar.
|
||||
|
||||
Ek kaynaklar:
|
||||
|
||||
- [Goodhart Yasası: Yanlış Şeyleri Ölçmek Ahlaksız Davranışları Nasıl Yönlendirir?](https://coffeeandjunk.com/goodharts-campbells-law/)
|
||||
- [Sorunsuz bir yazılım dünyasında Dilbert](https://dilbert.com/strip/1995-11-13)
|
||||
|
||||
### Hanlon'un Usturası
|
||||
|
||||
[Wikipedia'da Hanlon'un Usturası](https://en.wikipedia.org/wiki/Hanlon%27s_razor)
|
||||
@@ -218,6 +275,19 @@ Ek kaynaklar:
|
||||
- [The Law of Leaky Abstractions](#the-law-of-leaky-abstractions)
|
||||
- [XKCD 1172](https://xkcd.com/1172/)
|
||||
|
||||
### Metcalfe Yasası
|
||||
|
||||
[Wikipedia'da Metcalfe Yasası](https://en.wikipedia.org/wiki/Metcalfe's_law)
|
||||
|
||||
> Ağ teorisinde, bir sistemin değeri yaklaşık olarak sistemin kullanıcı sayısının karesi ile orantılı olarak büyür.
|
||||
|
||||
Bu yasa, bir sistem içindeki muhtemel çift bağlantıların sayısına dayanmaktadır ve [Reed Yasası](#reeds-law) ile yakından ilgilidir. Odlyzko ve diğerleri, hem Reed Yasası hem de Metcalfe Yasası'nın, insan bilişinin ağ etkileri üzerindeki sınırlarını hesaba katmayarak sistemin değerini abarttığını öne sürerler; [Dunbar Sayısı'na](#dunbars-number) bakınız.
|
||||
|
||||
Ek kaynaklar:
|
||||
|
||||
- [Reed Yasası](#reeds-law)
|
||||
- [Dunbar Sayısı](#dunbars-number)
|
||||
|
||||
### Moore Yasası
|
||||
|
||||
[Wikipedia'da Moore Yasası](https://en.wikipedia.org/wiki/Moore%27s_law)
|
||||
@@ -289,6 +359,19 @@ Ek kaynaklar:
|
||||
- [Peter Prensibi](#the-peter-principle)
|
||||
- [Dilbert Prensibi](#the-dilbert-principle)
|
||||
|
||||
### Reed Yasası
|
||||
|
||||
[Wikipedia'da Reed Yasası](https://en.wikipedia.org/wiki/Reed's_law)
|
||||
|
||||
> Büyük ağların, özellikle sosyal ağların kullanımı, ağın boyutuna katlanarak ölçeklenir.
|
||||
|
||||
Bu yasa, programın faydasının olası katılımcı veya ikili bağlantı sayısından daha hızlı olan olası alt grup sayısı olarak ölçeklendiği grafik teorisine dayanmaktadır. Odlyzko ve diğerleri, Reed Yasası'nın, insan bilişinin ağ etkileri üzerindeki sınırlarını hesaba katarak sistemin yararını abarttığını öne sürerler; [Dunbar Sayısı'na](#dunbars-number) bakınız.
|
||||
|
||||
Ek kaynaklar:
|
||||
|
||||
- [Metcalfe Yasası](#metcalfes-law)
|
||||
- [Dunbar Sayısı](#dunbars-number)
|
||||
|
||||
### Karmaşıklığın Korunması Yasası (Tesler Yasası)
|
||||
|
||||
[Wikipedia'da Karmaşıklığın Korunması Yasası](https://en.wikipedia.org/wiki/Law_of_conservation_of_complexity)
|
||||
@@ -330,7 +413,7 @@ Bu yasa diyor ki, ekipler önemsiz ve kozmetik sorunlara ciddi ve önemli sorunl
|
||||
|
||||
En çok kullanılan kurgu örnek nükleer enerji reaktörünü onaylayacak olan komitenin reaktörün genel tasarımını onaylama zamanından çok bisiklet parkının tasarımını onaylamak için zaman harcamasıdır. Çok büyük ve karmaşık konularla ilgili o alanda bir eğitime, tecrübeye ve hazırlığa sahip olmadan kayda değer yorum getirmek zordur. İnsanlar genelde değerli katkılar verdiklerinin görülmesini isterler. Dolayısıyla insanlar kolayca katkı verebilecekleri gerekli ve önemli olmasa bile küçük detaylara odaklanma eğilimi gösterirler.
|
||||
|
||||
Bu kurgu örnek 'Bike Shedding' diye bir deyimin yaygınlaşmasına sebep olmuştur. Türkçe'deki 'pire için yorgan yakmak' ya da 'attığın taş ürküttüğün kurbağaya değsin' gibi deyimlere benzer.
|
||||
Bu kurgu örnek 'Bike Shedding' diye bir deyimin yaygınlaşmasına sebep olmuştur. Türkçe'deki 'pire için yorgan yakmak' ya da 'attığın taş ürküttüğün kurbağaya değsin' gibi deyimlere benzer. Alternatif bir terim 'Yak Shaving' de kullanılmaktadır.
|
||||
|
||||
### Unix Felsefesi
|
||||
|
||||
@@ -365,6 +448,17 @@ Ek kaynaklar:
|
||||
|
||||
- [Önemsizlik Yasası](#the-law-of-triviality)
|
||||
|
||||
### Wheaton Yasası
|
||||
|
||||
[Link](http://www.wheatonslaw.com/)
|
||||
|
||||
[Resmi Gün](https://dontbeadickday.com/)
|
||||
|
||||
> Öküzlük yapmayın.
|
||||
> *Wil Wheaton*
|
||||
|
||||
Wil Wheaton (Star Trek: The Next Generation, The Big Bang Theory) tarafından oluşturulan bu basit, özlü ve güçlü yasa, profesyonel bir organizasyon içinde uyum ve saygının artmasını amaçlamaktadır. İş arkadaşlarınızla konuşurken, kod incelemeleri yaparken, diğer bakış açılarını öne sürerken, insanları eleştirirken ve genel olarak insanların birbirleriyle olan profesyonel etkileşimlerinin çoğunda uygulanabilir.
|
||||
|
||||
## Prensipler
|
||||
|
||||
Prensiplerin genellikle tasarıma ilişkin rehberlerdir.
|
||||
@@ -376,7 +470,7 @@ Prensiplerin genellikle tasarıma ilişkin rehberlerdir.
|
||||
> Şirketler, yetersiz çalışanları, iş akışından uzaklaştırmak için sistematik olarak yönetici olmaya teşvik etme eğilimindedir.
|
||||
> *Scott Adams*
|
||||
|
||||
Scot Adams (Dilbert çizgi dizisinin yazarı) [Peter prensibinden](#the-peter-principle) esinlenerek ortaya atılmış bir yönetim kavramıdır. Dilbert prensibine göre yetenekli olmayan çalışanlar yönetim kadorlarına dopru yükseltilirler ki üretime verecekleri zarar aza indirilsin. Adams bunu ilk olarak 1995'te Wall Street Journal'da yazdığı bir makalede açıkladı daha sonra ise 1996'da yazdığı [Dilbert Prensibi](#reading-list) adlı kitabında detaylandırdı.
|
||||
Scot Adams (Dilbert çizgi dizisinin yazarı) [Peter prensibinden](#the-peter-principle) esinlenerek ortaya atılmış bir yönetim kavramıdır. Dilbert prensibine göre yetenekli olmayan çalışanlar yönetim kadorlarına doğru yükseltilirler ki üretime verecekleri zarar aza indirilsin. Adams bunu ilk olarak 1995'te Wall Street Journal'da yazdığı bir makalede açıkladı daha sonra ise 1996'da yazdığı [Dilbert Prensibi](#reading-list) adlı kitabında detaylandırdı.
|
||||
|
||||
Ek kaynaklar:
|
||||
|
||||
@@ -399,6 +493,7 @@ Pareto Prensibi der ki, çıktıların önemli bir çoğunluğu girdilerin çok
|
||||
|
||||
1940'lı yıllarda Romanya kökenli Amerikalı mühendis Dr. Joseph Juran, kendisi kalite kontrolün babası olarak nitelendirilir, [kalite kontrol sorunlarında Pareto Prensibini kullanmaya başladı](https://en.wikipedia.org/wiki/Joseph_M._Juran).
|
||||
|
||||
|
||||
Bu prensip aynı zamanda 80/20 Kuralı (The Law of the Vital Few and The Principle of Factor Sparsity) olarak da bilinir.
|
||||
|
||||
Gerçek dünyadan örnekler:
|
||||
@@ -451,7 +546,7 @@ Bunları [Nesne Tabanlı Proglamlama'nın](#todo) temel prensipleri olarak değe
|
||||
|
||||
Bu '[SOLID](#solid)' prensiplerinin ilkidir. Bu prensip der ki her bir sistem parçasının yada programlama sınıfının sadece ama sadece bir sorumluluğu olması gerekir. Daha sade anlatmak gerekirse, bir programdaki sadece bir özelliği etkileyen bir değişiklik sadece o özelliği ilgilendiren parça ya da sınıfta yapılmalı. Örneğin, şifrelerin doğruluğunun kontrolünde bir değiştirme yapılacaksa sadece programın o bölümünde değişiklik yapılmalı.
|
||||
|
||||
Teorik olarak, bu prensibe uygun yazılmış kodlar daha sağlam ve değiştirilmesi kolaydır. Sadece tek bir parçanın değiştirildiğine emin olunduğunda değişimi *tesk etmek* de kolay olacaktır. Önceki şifre örneğini düşünürsek, şifrenin zorluk seviyesi değiştirildiğinde sadece şifre ilgili bölümlerin etkilenecektir. Birden fazla sorumluluğu olan bir bölümde olan değişikliğin nereleri etkileceğini hesaplamak daha zordur.
|
||||
Teorik olarak, bu prensibe uygun yazılmış kodlar daha sağlam ve değiştirilmesi kolaydır. Sadece tek bir parçanın değiştirildiğine emin olunduğunda değişimi *test etmek* de kolay olacaktır. Önceki şifre örneğini düşünürsek, şifrenin zorluk seviyesi değiştirildiğinde sadece şifre ilgili bölümlerin etkilenecektir. Birden fazla sorumluluğu olan bir bölümde olan değişikliğin nereleri etkileceğini hesaplamak daha zordur.
|
||||
|
||||
Ek kaynaklar:
|
||||
|
||||
@@ -468,6 +563,7 @@ Bu '[SOLID](#solid)' prensiplerinin ikincisidir ve herhangi bir sistem parçası
|
||||
|
||||
Örneğin Markdown formatındaki belgeleri HTML formatına çeviren bir modülü düşünelim. Eğer bu modül kendisi değiştirilmeden yeni bir Markdown formatını da işlemesi sağlanacak şekilde geliştirilebiliyorsa, bu modül genişletilmeye açık demektir. Eğer sonradan değiştirilip Markdown formatı işlemesi ile ilgili geliştirme *yapılamıyorsa*, bu modül değiştirilmeye *kapalı* demektir.
|
||||
|
||||
|
||||
Bu prensip nesne-tabanlı programlamaya tam uygundur. Şöyle ki, kendi nesne ve sınıflarımızı miras alınarak geliştirmeye uygun ve değiştirmeye ihtiyaç duymayacak şekilde tasarlarsak ve yazarsak nesne-tabanlı programlamaya tam uygun kod yazmış oluruz.
|
||||
|
||||
Ek kaynaklar:
|
||||
@@ -539,6 +635,7 @@ Ek kaynaklar:
|
||||
|
||||
*DRY Don't Repeat Yourself* yani Kendini Tekrar Etme deyimin kısaltılmasıdır. İlk olarak Andrew Hunt ve Dave Thomas tarafından [The Pragmatic Developer](https://en.wikipedia.org/wiki/The_Pragmatic_Programmer) kitabında bahsedilmiştir. Bu ilke, geliştiricilere kod tekrarını azaltma ve bilgileri tek bir yerde tutmalarına yardımcı olmayı amaçlamaktadır.
|
||||
|
||||
|
||||
> DRY'nin tam tersi *WET* olacaktır (Write Everything Twice (Her Şeyi İki Kez Yaz) We Enjoy Typing (Yazmayı Seviyoruz)).
|
||||
|
||||
Uygulamada, aynı bilgi parçasını iki (veya daha fazla) farklı yerde kullanıyorsanız, DRY'yi bunları tek bir tanede birleştirmek ve istediğiniz / ihtiyaç duyduğunuz yerde tekrar kullanmak için kullanabilirsiniz.
|
||||
@@ -563,7 +660,7 @@ Ek kaynaklar:
|
||||
|
||||
### YAGNI
|
||||
|
||||
[Wikipedia'da YAGNI](https://en.wikipedia.org/wiki/You_aren%27t_gonna_need_it)
|
||||
[Wikipedia'da YAGNI](https://en.wikipedia.org/wiki/You_ain%27t_gonna_need_it)
|
||||
|
||||
***Y**ou **A**ren't **G**onna **N**eed **I**t* (İhtiyacın olmayacak) deyiminin kısaltmasıdır.
|
||||
|
||||
@@ -578,6 +675,33 @@ Ek kaynaklar:
|
||||
|
||||
- [Reading List: Extreme Programming Installed](#reading-list)
|
||||
|
||||
### Dağıtık Sistemlerin Yanılgıları
|
||||
|
||||
[Wikipedia'da Dağıtık Sistemlerin Yanılgıları](https://en.wikipedia.org/wiki/You_aren%https://en.wikipedia.org/wiki/Fallacies_of_distributed_computing)
|
||||
|
||||
*Ağ Tabanlı Sistemlerin Yanılgıları* olarak da bilinen yanılgılar dağıtık sistemleri geliştirme sırasında başarısızlıklara yol açabilecek varsayımların (veya inançların) bir listesidir. Varsayımlar:
|
||||
|
||||
- Ağ güvenilirdir.
|
||||
- Gecikme yoktur.
|
||||
- Bant genişliği sonsuzdur.
|
||||
- Ağ güvenlidir.
|
||||
- Topoloji değişmez.
|
||||
- Sadece bir tane yönetici vardır.
|
||||
- Taşıma maaliyeti sıfırdır.
|
||||
- Ağ homojendir.
|
||||
|
||||
İlk dört madde 1991'de [Bill Joy](https://en.wikipedia.org/wiki/Bill_Joy) ve [Tom Lyon](https://twitter.com/aka_pugs) tarafından listelenmiştir ve ilk önce [James Gosling](https://en.wikipedia.org/wiki/James_Gosling) tarafından "Ağ Tabanlı Sistemlerin Yanılgıları" olarak sınıflandırılmıştır. [L. Peter Deutsch](https://en.wikipedia.org/wiki/L._Peter_Deutsch) 5., 6. ve 7. yanılgıları ekledi. 90'lı yılların sonlarında Gosling 8. yanılgıyı ekledi.
|
||||
|
||||
Grup [Sun Microsystems](https://en.wikipedia.org/wiki/Sun_Microsystems) içinde başlarına gelen olaydan ilham aldı.
|
||||
|
||||
Dayanıklı sistemler tasarlarken bu yanılgılar dikkatlice ele alınmalı; bu yanılgılardan herhangi birinin varsayılması, dağıtılmış sistemlerin gerçeklikleri ve karmaşıklıkları ile başa çıkamayan hatalı bir mantığa yol açabilir.
|
||||
|
||||
Ek kaynaklar:
|
||||
|
||||
- [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)
|
||||
|
||||
## Ek Kaynaklar
|
||||
|
||||
Bu kavramları ilginç bulduysanız, aşağıdaki kitapların keyfini çıkarabilirsiniz.
|
||||
@@ -585,11 +709,18 @@ Bu kavramları ilginç bulduysanız, aşağıdaki kitapların keyfini çıkarabi
|
||||
- [Extreme Programming Installed - Ron Jeffries, Ann Anderson, Chet Hendrikson](https://www.goodreads.com/en/book/show/67834) - Extreme Programming kavramının temel prensiplerini içerir.
|
||||
- [The Mythical Man Month - Frederick P. Brooks Jr.](https://www.goodreads.com/book/show/13629.The_Mythical_Man_Month) - Yazılım mühendisliği klasiği sayılabilir. Brooks Yasası bu kitabın ana temasıdır.
|
||||
- [Gödel, Escher, Bach: An Eternal Golden Braid - Douglas R. Hofstadter.](https://www.goodreads.com/book/show/24113.G_del_Escher_Bach) - Sınıflandırması zor bir kitap. Hofstadter Yasası bu kitaptan alıntıdır.
|
||||
- [Dilbert Prensibi - Adam Scott](https://www.goodreads.com/book/show/85574.The_Dilbert_Principle) - Amerikadaki kurumsal hayata mizahi bir yaklaşım, [Dilbert Prensibinin](#the-dilbert-principl) sahibinden.
|
||||
- [Dilbert Prensibi - Scott Adams](https://www.goodreads.com/book/show/85574.The_Dilbert_Principle) - [Dilbert İlkesini](#the-dilbert-principle) oluşturan yazardan, kurumsal Amerika'ya komik bir bakış.
|
||||
- [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).
|
||||
|
||||
## Katkıda Bulunmak İçin
|
||||
|
||||
Lütfen katkıda bulunun! Bir ekleme veya değişiklik önermek istiyorsanız [bir sorun oluşturun](https://github.com/dwmkerr/hacker-laws/issues/new) veya kendi değişikliklerinizi önermek için [bir PR açın](https://github.com/dwmkerr/hacker-laws/compare) .
|
||||
|
||||
Lütfen metin, stil ve benzeri gereksinimler için [Katkıda Bulunma Kılavuzunu](./.github/contributing.md) okuduğunuzdan emin olun. Lütfen projeyle ilgili tartışmalarda [Davranış Kurallarına](./.github/CODE_OF_CONDUCT.md) dikkat edin.
|
||||
|
||||
## TODO
|
||||
|
||||
Selam!. Buraya ulaştıysanız, henüz yazmadığım bir konunun bağlantısını tıkladınız, bunun için üzgünüm - ve en kısa zamanda tamamlamaya çalışacağım!
|
||||
|
||||
Soru ve önerileriniz için [issue](https://github.com/dwmkerr/hacker-laws/issues) açabilirsiniz, ya da katkıda bulunmak isterseniz [Pull Request](https://github.com/dwmkerr/hacker-laws/pulls) açabilirsiniz.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user