Skip to content

Commit 2654992

Browse files
committed
docs: translate DRY to korean
1 parent c83c793 commit 2654992

File tree

1 file changed

+9
-20
lines changed

1 file changed

+9
-20
lines changed

README.md

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,30 +1426,19 @@ by this author.
14261426

14271427
## **Don't repeat yourself (DRY)**
14281428

1429-
Try to observe the [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself)
1430-
principle.
14311429

1432-
Do your absolute best to avoid duplicate code. Duplicate code is bad because it
1433-
means that there's more than one place to alter something if you need to change
1434-
some logic.
1430+
[DRY]((https://en.wikipedia.org/wiki/Don%27t_repeat_yourself)) 원칙을 따르세요.
14351431

1436-
Imagine if you run a restaurant and you keep track of your inventory: all your
1437-
tomatoes, onions, garlic, spices, etc. If you have multiple lists that you keep
1438-
this on, then all have to be updated when you serve a dish with tomatoes in
1439-
them. If you only have one list, there's only one place to update!
1432+
중복된 코드는 피하세요. 중복된 코드는 만약 변경이 생겼을 때 여러 군데에서 변경을 해줘야 하기 때문에 좋지 않습니다.
14401433

1441-
Often you have duplicate code because you have two or more slightly different
1442-
things, that share a lot in common, but their differences force you to have two
1443-
or more separate functions that do much of the same things. Removing duplicate
1444-
code means creating an abstraction that can handle this set of different things
1445-
with just one function/module/class.
1434+
식당을 운영하고 재고를 관리한다고 가정해보겠습니다. 토마토, 양파, 마늘, 향신료 등 모든 재고를 관리해야 합니다.이때 여러 개의 목록을 가지고 있다면 토마토가 들어있는 요리를 제공할 때마다 모든 목록을 업데이트해야 합니다. 반면에 목록이 하나만 있다면 업데이트할 곳은 한 곳 뿐입니다.
14461435

1447-
Getting the abstraction right is critical. Bad abstractions can be worse than
1448-
duplicate code, so be careful! Having said this, if you can make a good
1449-
abstraction, do it! Don't repeat yourself, otherwise you'll find yourself
1450-
updating multiple places any time you want to change one thing.
1436+
종종 중복된 코드가 생기는 이유로 코드에서 공통점이 많지만, 약간의 차이로 인해 동일한 작업을 수행하는 두 개 이상의 별도 함수를 가져야 하기 때문입니다. 중복된 코드를 제거하는 것은 단일 함수/모듈/클래스로 이 서로 다른 집합을 처리할 수 있는 추상화를 만드는 것을 의미합니다.
14511437

1452-
**Bad:**
1438+
추상화를 올바르게 얻는 것이 중요합니다. 잘못된 추상화는 중복된 코드보다 더 나쁠 수 있으므로 주의하세요! 그럼에도 불구하고, 좋은 추상화를 만들 수 있다면 그것을 하세요! 자신을 반복하지 마세요. 그렇지 않으면 한 가지를 변경할 때마다 여러 곳을 업데이트하게 될 것입니다.
1439+
1440+
1441+
**나쁜 예:**
14531442

14541443
```python
14551444
from typing import List, Dict
@@ -1521,7 +1510,7 @@ company_managers = [
15211510
company_managers_list = get_manager_list(managers=company_managers)
15221511
```
15231512

1524-
**Good:**
1513+
**좋은 예:**
15251514

15261515
```python
15271516
from typing import List, Dict

0 commit comments

Comments
 (0)