-
Notifications
You must be signed in to change notification settings - Fork 7
[3주차] BLINK_ONCE submit #22
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
자신의 의견을 한번쯤 정리해봐요
- 소프트웨어를 개발하는 일련의 모든 과정에 들어가는 비용 중 80%가 유지보수에 쓰여진다. | ||
- 소프트웨어를 직접 개발한 개발자가 그 소프트웨어의 유지보수를 담당하는 경우는 드물다. | ||
- code convention을 통해 다른 개발자가 그 소스코드를 처음 보았을 때 빠른 시간 안에 코드를 이해할 수 있도록 도와준다. 따라서 가독성이 높아진다. | ||
- 개발자가 자신의 소소코드를 제품으로 팔려 한다면, 자신이 작성한 다른 소스코드들과 잘 어울리도록 package를 적절하게 구성할 필요가 있다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
명심!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
네
3주차/README.md
Outdated
### methods 명명 규칙 | ||
- 메소드의 이름은 동사이어야 하며, 복합 단어일 경우 첫 단어는 소문자로 시작하고 그 이후에 나오는 단어의 문자는 대문자로 사용해야 한다. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"메소드 이름은 동사~" 이부분의 예제 필요할거같아요
그렇다면 명사는 어떄야 할까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
네
### 인스턴스 변수와 클래스 변수를 외부에 노출하지 말고 대신 접근을 제공 | ||
- 인스턴스 변수 또는 클래스 변수를 합당한 이유 없이 public으로 선언하지 말자. 인스턴스 변수들은 명시적으로 선언될 필요가 없는 경우가 많다. | ||
- 인스턴스 변수가 public으로 선언되는 것이 적절한 경우는 클래스 자체가 어떤 동작(behavior)을 가지지 않는 데이터 구조(data structure)일 경우이다. 만약 class대신 struct를 사용해야 하는 경우라면 (java가 struct를 지원한다 가정) class의 인스턴스 변수들을 public으로 선언하는 것이 적합하다. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
캡슐화(상태와 행동의 분리)라고 부릅니다.
더 자세히 공부해봐도 좋아요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넹
3주차/README.md
Outdated
### 클래스 변수와 클래스 메소드는 클래스 이름을 사용하여 호출 | ||
- 클래스(static) 변수 또는 클래스 메소드를 호출하기 위해서 객체를 사용하는 것을 피해야 한다. 대신 클래스 이름을 사용하자. | ||
```java | ||
classMethod();// good | ||
AClass.classMethod();// good | ||
anObject.classMethod();// bad |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
클래스 변수? 클레스 메소드? 예제가 조금더 필요할거같아요
## 타입 추론, var | ||
java 10에서 타입 추론을 지원하는 키워드 'var'가 추가됨. 이전 버전에도 generic, lambda를 사용할 때 타입추론이 관련된다. | ||
> 타입 추론이란 코드 작성 당시 타입이 정해지지 않았지만, 컴파일러가 그 타입을 유추하는 것이다. | ||
|
||
### var | ||
자바 10부터 추가된 타입 추론을 지원하는 var 키워드. 이 키워드는 local variable이면서 선언과 동시가 initializer가 필수적으로 요구된다. | ||
```java | ||
// java 9 이하 | ||
String message = "data"; | ||
// java 10 이상 | ||
var message = "the initializer present on the right-hand side"; | ||
``` | ||
### 주의사항 | ||
- 자바 7에서 다이아몬드 연산자라는 방식이 추가되었는데 자바10에서 나온 var와 함께 사용하게 되면 컴파일 에러가 발생한다. | ||
```java | ||
// 컴파일러가 타입을 유추할 수 있는 정보가 없다. | ||
var messages = new ArrayList<>(); | ||
``` | ||
|
||
- 가독성에 있어 다른 개발자가 읽을 때 가독성이 좋을지 고민해봐야 한다. | ||
```java | ||
public void some() { | ||
var message = getMessage(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var 말고도 타입추론이 더 있으니 추가바랍니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넹
No description provided.