Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stay DRY? Do Not Repeat Yourself! [closed]

Tags:

I find that one of the most frustrating aspects to software development is finding a solution to a problem, forgetting it, then being faced with the same issue in the future only to forgot how you previously solved it. Or to write a useful bit of code, then on a later project not be able to find this code.

My general question is this: How do you keep track of all the new things you learn each day while programming? Does anyone have a systematic way to capture knowledge and easily and efficiently apply it in the future?

UPDATE: Thanks the for the responses, here's what you came up with:

Social

  • Stackoverflow
  • Tumblr
  • Twitter
  • Evernote
  • Blogs/Wikis

Code Repositories

  • Github
  • Unfuddle
  • LaunchPad
  • Google Code

Desktop

  • Dropbox
  • Yojimbo (mac)
  • VoodooPad (mac)
  • Wikidpad (win)
  • Surfulater
like image 958
hagope Avatar asked Dec 03 '09 08:12

hagope


People also ask

In what ways does the DRY principle don't repeat yourself help make your code better?

DRY (Don't Repeat Yourself) is a principle of software development. The focus of DRY is to avoid repetition of information. Why? When you write code that performs the same tasks over and over again, any modification of one task requires the same change to be made to every single instance of that task!

When developing the DRY principle don't mean yourself?

"Don't repeat yourself" (DRY) is a principle of software development aimed at reducing repetition of software patterns, replacing it with abstractions or using data normalization to avoid redundancy.

What is DRY principle explain with an example?

DRY BenefitsLess code is good: It saves time and effort, is easy to maintain, and also reduces the chances of bugs. One good example of the DRY principle is the helper class in enterprise libraries, in which every piece of code is unique in the libraries and helper classes.

Can you please explain the DRY principle?

DRY, which stands for 'don't repeat yourself,' is a principle of software development that aims at reducing the repetition of patterns and code duplication in favor of abstractions and avoiding redundancy.


2 Answers

Stackoverflow is a good place to start :-)

Keeping a blog is another thing (here's mine).

Even Twitter can be useful for this.

There are also a number of "desktop wiki" applications that I find very useful: VoodooPad on the Mac and Wikidpad for Windows.

Finally, if you need to store snippets (or more) of code (that you have the rights to, of course), then there are plenty of source code repositories available now (GitHub, LaunchPad, Google Code or Unfuddle if you want complete control).

like image 154
philsquared Avatar answered Nov 27 '22 17:11

philsquared


The brain has limits. Accept it.

The solution is to have tests for your code so you can merge repeated code without breaking a sweat as soon as you notice it.

like image 31
Aaron Digulla Avatar answered Nov 27 '22 16:11

Aaron Digulla