Skip to content

private, protectd 프로퍼티와 메서드 번역 #153#222

Merged
Violet-Bora-Lee merged 7 commits intojavascript-tutorial:masterfrom
JIN0419:translate
Oct 19, 2019
Merged

private, protectd 프로퍼티와 메서드 번역 #153#222
Violet-Bora-Lee merged 7 commits intojavascript-tutorial:masterfrom
JIN0419:translate

Conversation

@JIN0419
Copy link
Contributor

@JIN0419 JIN0419 commented Sep 27, 2019

#153
리뷰 부탁드립니다. :)


To hide internal interface we use either protected or private properties:
내부 인터페이스를 숨기기 위해서는 protected나 private 프로퍼티를 사용하세요:
- protected 필드는 `_`로 시작합니다. 이것은 언어 수준에서 강제적인 것은 아니지만 널리 알려진 관습입니다. 프로그래머는 그 클래스와 그 클래스를 상속하는 클래스로부터 `_`로 시작하는 필드에만 접근해야 합니다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line이 다르네요. 이부분 수정 되면 리뷰 시작하겠습니다.

관련 사항은 README.md파일 확인해주세요.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JIN0419
Copy link
Contributor Author

JIN0419 commented Sep 28, 2019

줄 수정 완료했습니다.!

Copy link
Member

@Violet-Bora-Lee Violet-Bora-Lee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

안녕하세요 번역에 기여해주셔서 감사합니다.

조금 시간이 걸리더라도 독자의 가독성을 위해 문장을 다듬는 연습을 해주시기 바랍니다.

눈에 띄인 사항들만 몇가지 적어보았습니다.

@@ -1,71 +1,71 @@

# Private and protected properties and methods
# Private, Protected 프로퍼티와 메서드
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Private, Protected 프로퍼티와 메서드
# private, protected 프로퍼티와 메서드

영어에선 첫 글자만 대문자로 하는데, 이 글은 한국어이므로 프로퍼티 키 를 그냥 적어주면 될 것 같습니다.

# Private, Protected 프로퍼티와 메서드

One of the most important principles of object oriented programming -- delimiting internal interface from the external one.
객체 지향 프로그래밍에서 가장 중요한 원리 중 하나는 "내부 인터페이스와 외부 인터페이스를 구분 짓는 것"입니다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#245 이슈 참고해주세요

커피 머신의 신뢰성과 단순함의 비밀은 모든 디테일들이 잘 조정되어있고 안쪽에 *숨겨져* 있다는 것입니다.

If we remove the protective cover from the coffee machine, then using it will be much more complex (where to press?), and dangerous (it can electrocute).
커피 머신에서 보호 커버를 없앤다면 커피머신을 사용하는 것이 훨씬 복잡해지고 위험해질 것입니다. (어디를 눌러야 하는지 복잡할 것이고, 감전이 될 수도 있습니다.)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- *외부 인터페이스* -- 메서드와 프로퍼티를 클래스의 외부에서도 접근할 수 있습니다.

If we continue the analogy with the coffee machine -- what's hidden inside: a boiler tube, heating element, and so on -- is its internal interface.
커피 머신으로 분석을 이어가자면 보일러 튜브, 발열 장치 등 안쪽에 숨겨진 것이 바로 내부 인터페이스입니다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

보일러보다는 가열된 물이 지나가는 튜브정도로 의역하는게 어떨까요?

그러나 외부로부터 커피 머신은 보호 커버에 의해 닫혀 있어서 아무도 그것들에 접근할 수 없습니다. 세부 사항들은 숨겨져있고 접근이 불가능합니다. 우리는 외부 인터페이스를 통해서 이것들의 기능을 사용할 수 있습니다.

So, all we need to use an object is to know its external interface. We may be completely unaware how it works inside, and that's great.
그렇기 때문에 우리가 오브젝트를 사용하기 위해 알아야 할 것은 이것의 외부 인터페이스입니다. 우리는 이것이 안에서 어떻게 작동하는지 완전히 알지 못해도 충분합니다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오브젝트 --> 객체

거의 표준에 따라 완성된 자바스크립트 제안서에서 private 프로퍼티와 메서드에 대해 언어 수준의 지원을 제공합니다.

Privates should start with `#`. They are only accessible from inside the class.
private 프로퍼티는 '#'으로 시작합니다. 이렇게 쓰인 프로퍼티나 메서드는 오직 클래스 안에서만 접근이 가능하다는 의미입니다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private 프로퍼티는 '#'으로 시작합니다. 이렇게 쓰인 프로퍼티나 메서드는 오직 클래스 안에서만 접근이 가능하다는 의미입니다.
private 프로퍼티는 '#'으로 시작합니다. 이렇게 쓰인 프로퍼티나 메서드는 오직 클래스 안에서만 접근이 가능합니다.

private 프로퍼티는 '#'으로 시작합니다. 이렇게 쓰인 프로퍼티나 메서드는 오직 클래스 안에서만 접근이 가능하다는 의미입니다.

For instance, here's a private `#waterLimit` property and the water-checking private method `#checkWater`:
예를 들면 private 프로퍼티인 `#waterLimit`과 물을 체크하는 private 메서드인 `#checkWater`를 보면 그렇습니다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
예를 들면 private 프로퍼티인 `#waterLimit`과 물을 체크하는 private 메서드인 `#checkWater`보면 그렇습니다.
private 프로퍼티인 `#waterLimit`과 물을 체크하는 private 메서드인 `#checkWater`살펴봅시다.

if (value < 0) throw new Error("Negative water");
if (value > this.#waterLimit) throw new Error("Too much water");
if (value < 0) throw new Error("물의 양이 음수입니다");
if (value > this.#waterLimit) throw new Error("물이 너무 많습니다");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

주술구조 문장은 마침표 필요함


*!*
// can't access privates from outside of the class
// 클래스 외부에서 private에 접근할 수 없음.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

명사(형 술어)로 끝나무로 마침표 없음

프로그래머들도 예외는 아닙니다.

**It's always convenient when implementation details are hidden, and a simple, well-documented external interface is available.**
**구현 세부 사항이 숨겨져 있는 것은 언제나 편리하고, 간단하고 잘 문서화된 외부 인터페이스가 가능합니다. **
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

. 뒤에 공백 들어가면 안됩니다(렌더링 오류남)

@javascript-translate-bot

Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review 👻

@JIN0419
Copy link
Contributor Author

JIN0419 commented Oct 19, 2019

/done

@JIN0419
Copy link
Contributor Author

JIN0419 commented Oct 19, 2019

리뷰 반영하여 전면적으로 수정하였습니다.
번역이 생각보다 더 엄격하고 어려워서 컨트리뷰톤 짧은 기간동안 리뷰만 더 하는게 더 도움이 되었을껄 하는 후회가 드네요.;)
리뷰 부탁드립니다.

@Violet-Bora-Lee
Copy link
Member

쉽지가 않은 작업임에도 기여해 주심에 감사드립니다 👍 👍 👍
본 프로젝트에선 (컨트리뷰톤 대회 기간 제약으로 인해) 제가 squash and merge진행하도록 하겠습니다.
interactive rebase를 꼭 배우셔서 다른 오픈소스에선 커밋을 합친후 푸시해주세요.

@Violet-Bora-Lee Violet-Bora-Lee merged commit c5012c7 into javascript-tutorial:master Oct 19, 2019
@JIN0419
Copy link
Contributor Author

JIN0419 commented Oct 19, 2019

넵, 잘 알아두겠습니다. 감사합니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants