CodeThatDocumentsItselfSoWellItDoesNotNeedComments
2280 단어 performance
“You can imagine my excitement when it came time to opening The System, which was the lead developer’s masterpiece and culminated over a decade of design and development experience into a clean, almost-perfect application. You can also imagine my disappointment when I finally dived in and learned exactly what he meant by self-documenting code.”
switch (mIntegrationDirection)
{
case InventoryIntegrationDirection.DoTheSameChangeInShop:
DoTheSameChangeInShop(GetChangedDataFromInventory(mLastSynchDate));
break;
case InventoryIntegrationDirection.DoTheSameChangeInInventory:
DoTheSameChangeInInventory(GetChangedDataFromShop(mLastSynchDate));
break;
case InventoryIntegrationDirection.DoTheSameChangeInShopThenDoTheSameChangeInInventoryForNotChangedDataInInventory:
DoTheSameChangeInShopThenDoTheSameChangeInInventoryForNotChangedDataInInventory(
GetChangedDataFromInventory(mLastSynchDate),
GetChangedDataFromShop(mLastSynchDate));
break;
case InventoryIntegrationDirection.DoTheSameChangeInInventoryThenDoTheSameChangeInShopForNotChangedData:
DoTheSameChangeInInventoryThenDoTheSameChangeInShopForNotChangedData(
GetChangedDataFromShop(mLastSynchDate),
GetChangedDataFromInventory(mLastSynchDate));
break;
default:
break;
}
Ben added, “when the lead developer asked for my feedback, I gritted my teeth and smiled, doing my best to compliment-but-not-compliment the design. He responded, ‘and the best thing is, with code like this, there is no need to write a single comment, anywhere.’ I’m not sure if there wasn’t a need to have comments… but I can say that there wasn’t a single comment, anywhere.”
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
.NET 6 - AutoMapper 및 데이터 전송 개체(DTO) 🗺YouTube에서 전체 동영상을 볼 수 있습니다. 오늘 AutoMapper가 무엇이고 왜 필요한지 설명하는 것으로 시작할 수 있습니다. 이제 nuget 패키지가 설치되었으므로 automapper 구현 및 활용을 시작...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.