-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdry.html
More file actions
67 lines (59 loc) · 3.98 KB
/
Copy pathdry.html
File metadata and controls
67 lines (59 loc) · 3.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Site Properities -->
<title>DRY (Don't Repeat Yourself) | Learn Learnin'</title>
<meta property="og:title" content="DRY (Don't Repeat Yourself) | Learn Learnin'" />
<meta property="og:description" name="description" content="If a coder writes the same code twice, he's doing it wrong" />
<meta property="og:url" content="http://learnlearn.in/dry/" />
<meta name="keywords" content="learn, learning, dry, coding, best practice" />
<meta name="generator" content="DocPad v6.78.6" />
<link rel="shortcut icon" type="image/png" href="/LofL.png" />
<link rel="apple-touch-icon" type="image/png" href="/LofL128.png" />
<link rel="stylesheet" href="/main.css" />
<link href="//asd.learnlearn.in/feed.atom" type="application/atom+xml" rel="alternate" title="Sitewide ATOM Feed" />
</head>
<body>
<header>
<a href="/" title="Go home"><img src="/LofL60.png" alt="~" title="~"></a>
<a href=""><h1>DRY (Don't Repeat Yourself) </h1></a>
</header>
<article role="main">
<p>Coders should never repeat themselves. Not just coders, anyone. That is a terrible waste of anyone's time.</p>
<p>That is why I write things down. Once you write your mind down somewhere, every time you have to pour out your ideas on something, you can just link people to what you've written down already and use that time to write more things.</p>
<p>When it comes to coding, there're very many ways to not repeat oneself.</p>
<h2 id="functions">Functions</h2>
<p>Create functions, and smaller functions, and even more functions. <a href="https://xkcd.com/974/">But don't get trapped in creating all serving functions either</a>.</p>
<h2 id="libraries">Libraries</h2>
<p>First, never code something yourself when there's a library for it.</p>
<p>Second, when you code something that could be a library, make it a library and reuse it.</p>
<h2 id="automation">Automation</h2>
<p>Everything can be automated (except maybe the creativity part). Do not type out code, use snippets. Do not compile manually, use Makefile. For every language, there are automation tools that does most repeated tasks with a single command.</p>
<p>Like <a href="../gulpjs/">gulp</a>, grunt (and yeoman) for <a href="../web-development/">web development</a>.</p>
</article>
<aside class="share separator separatorpipe" role="complementary">
Share this »
<a target="_blank" href="http://sharetodiaspora.github.io/?title=DRY (Don't Repeat Yourself) | Learn Learnin'&url=http://learnlearn.in/dry/">diaspora*</a>
<a target="_blank" href="http://www.facebook.com/sharer/sharer.php?u=http://learnlearn.in/dry/">Facebook</a>
<a target="_blank" href="https://twitter.com/intent/tweet?url=http://learnlearn.in/dry/">Twitter</a>
<a target="_blank" href="https://plus.google.com/share?url=http://learnlearn.in/dry/">Google+</a>
<a target="_blank" href="mailto:?subject=DRY (Don't Repeat Yourself) | Learn Learnin'&body=Check this out: http://learnlearn.in/dry/">Email</a>
<a target="_blank" href="https://telegram.me/share/url?url=DRY (Don't Repeat Yourself) | Learn Learnin' - &url=http://learnlearn.in/dry/"> Telegram</a>
<a class="mobileshare" href="whatsapp://send?text=DRY (Don't Repeat Yourself) | Learn Learnin' - http://learnlearn.in/dry/">Whatsapp</a>
</aside>
<footer id="footer" class="separator separatorpipe">
<a href="/keep-in-touch/#comments">Comment</a>
<a href="/about/">About</a>
<a href="/"> Home</a>
<a href="http://asd.learnlearn.in">Follow ASD</a>
<br>
<form id="ducksearch" name="ducksearch" action="https://duckduckgo.com/" target="_top">
<input type="search" class="search-bar" autocomplete="off" name="q" id="searchinput" placeholder="Search this site" value=" site:learnlearn.in "/>
<input id="search_button_homepage" type="submit" value="Duck!"/>
</form>
</footer>
<script defer="defer" src="/main.js"></script>
</body>
</html>