Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

docs: update introductions translation to korean#11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
FacerAin wants to merge2 commits intomaster
base:master
Choose a base branch
Loading
fromfeat/introductions
Open
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 13 additions & 28 deletionsREADME.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,7 @@
- [설명 가능한 변수 사용하기](#설명-가능한-변수-사용하기)
- [암시적인 의미 피하기](#암시적인-의미-피하기)
- [불필요한 맥락 제거하기](#불필요한-맥락-제거하기)
- [Use default arguments instead of short circuiting or conditionals](#use-default-arguments-instead-of-short-circuiting-or-conditionals)
- [함수 중단, 조건문 대신 기본 인자 사용하기](#함수-중단-조건문-대신-기본-인자-사용하기)
- [**Functions**](#functions)
- [함수는 한 가지 일만 하기](#함수는-한-가지-일만-하기)
- [함수 인자 (이상적으로는 2개 이하)](#함수-인자-이상적으로는-2개-이하)
Expand All@@ -37,10 +37,7 @@
Robert C. Martin의 저서
[*Clean Code*](https://product.kyobobook.co.kr/detail/S000001032980)의 소프트웨어 엔지니어링 원칙들을 Python으로 소개합니다. 본 문서는 스타일 가이드가 아닙니다. Python에서 읽기 쉽고 재사용 가능하며 리팩토링 가능한 소프트웨어를 제작하기 위한 가이드입니다.

Not every principle herein has to be strictly followed, and even fewer will be
universally agreed upon. These are guidelines and nothing more, but they are
ones codified over many years of collective experience by the authors of *Clean
Code*.
여기에 있는 모든 원칙을 엄격하게 준수해야 하는 것은 아니며, 심지어 많은 사람들이 일반적으로 준수해야 한다고 동의할만한 원칙들은 훨씬 적을 것입니다. 원칙들은 어디까지나 가이드라인일 뿐이고, Clean Code의 저자들이 다년간의 경험을 집약해 성문화한 것입니다.

[clean-code-javascript](https://github.com/ryanmcdermott/clean-code-javascript)를 바탕으로 작성되었습니다.

Expand DownExpand Up@@ -252,7 +249,7 @@ class Car:

**[⬆ back to top](#table-of-contents)**

###Use default arguments instead of short circuiting or conditionals
###함수 중단, 조건문 대신 기본 인자 사용하기

**Tricky**

Expand All@@ -268,8 +265,7 @@ def create_micro_brewery(name):
# etc.
```

... when you can specify a default argument instead? This also makes it clear
that you are expecting a string as the argument.
... 위 코드를 기본 인자로 표현하면 어떨까요? 이는 인자에 문자열이 와야한다는 것을 분명히 합니다.

**좋은 예**:

Expand DownExpand Up@@ -1426,30 +1422,19 @@ by this author.

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

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

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

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

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

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

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


**나쁜 예:**

```python
from typing import List, Dict
Expand DownExpand Up@@ -1521,7 +1506,7 @@ company_managers = [
company_managers_list = get_manager_list(managers=company_managers)
```

**Good:**
**좋은 예:**

```python
from typing import List, Dict
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp