QnA

philosophy

Q&A 정리: philosophy

FSD에서 슬라이스란 무엇이며, 그 목적은?

슬라이스는 비즈니스 의미에 따라 코드를 묶은 단위다. 기술 유형(컴포넌트, 훅 등)이 아니라 제품 기능 단위로 파일을 모아두어, 관련 코드를 한곳에서 찾을 수 있게 한다.

Their main purpose is to group code by its meaning for the product, business, or just the application. Slices are meant to be independent and highly cohesive groups of code files. Slices make your codebase easier to navigate by keeping logically related modules close together.


FSD에서 'components'나 'hooks' 같은 이름을 피해야 하는 이유는?

폴더 이름은 "이 파일이 뭔지(what)"가 아니라 "왜 존재하는지(why)"를 나타내야 한다. "components"라는 이름은 컴포넌트라는 사실만 알려줄 뿐, 어떤 기능을 위한 것인지 알 수 없어 코드 탐색에 도움이 되지 않는다.

The only important thing to remember when creating new segments is that segment names should describe purpose (the why), not essence (the what).

Names like “components”, “hooks”, “modals” should not be used because they describe what these files are, but don’t help to navigate the code inside.

The problem manifests itself at least in violation of the principle of High Cohesion and excessive stretching of the axis of changes.


도메인이란 무엇인가?

도메인은 소프트웨어가 다루는 현실 세계의 업무 영역을 말한다. 예를 들어 쇼핑몰 프로그램의 도메인은 "상품 관리, 주문, 결제" 같은 실제 비즈니스 영역이다.

Of primary importance is a domain of the software, the subject area to which the user applies a program.


FSD 공식 문서가 "변경에 최적화하지 말고, 삭제에 최적화하라"고 말하는 이유는 무엇인가?

미래에 어떤 변경이 올지 예측할 수 없으므로, 변경에 대비하는 것보다 필요 없어진 코드를 깔끔하게 제거할 수 있도록 구조를 짜는 것이 현실적이다.

No need to optimize for changes - we can’t predict the future. Better-optimize for deletion - based on the context that already exists.