loading...
Cover image for DRY — Don’t Repeat Yourself

DRY — Don’t Repeat Yourself

juuh42dias profile image Juliana Dias ・1 min read

Good morning, good afternoon, good evening, good night, what they are in common? Yeap, the word “Good”. The concept DRY consists in look this and “dry” your repetitions, after dry could be: Good, morning, afternoon, evening and night. Being thus the word would serve for all, without losing the logic.

Let’s see example in a code:

Trecho do código antes de aplicar o DRY

Trecho do código posterior a aplicação do DRY

The same logic but in fewer lines of code. That is one of the philosophies about Ruby on Rails best practices, Ruby (and Rails) is fantastic because of this and others practices, Ruby code is totally readable, simple and powerful. And Rails has MVC organization, Tests, Naming Convention making a clean code, also has Convention Over Configuration and others things. So that’s it, let’s study and code.

“Know, understand, modify and create.”

Posted on by:

juuh42dias profile

Juliana Dias

@juuh42dias

Software craftswoman & consultant, pseudo-writer, aspiring photographer, pamonha-eater and powered by coffee. 👩🏽‍💻☕🦄💎 she/her

Discussion

pic
Editor guide