Clean Code merupakan hal wajib yang dilakukan oleh seorang programmer untuk
dapat menulis kode yang berkualitas. Dari seorang penulis di Medium, beberapa
syarat Clean Code adalah:
<!--more-->
1. It should be elegant — Clean code should be pleasing to read. Reading it should make you smile the way a well-crafted music box or well-designed car would.
2. Clean code is focused —Each function, each class, each module exposes a single-minded attitude that remains entirely undistracted, and unpolluted, by the surrounding details.
3. Clean code is taken care of. Someone has taken the time to keep it simple and orderly. They have paid appropriate attention to details. They have cared.
4. Runs all the tests
5. Contains no duplication
6. Minimize the number of entities such as classes, methods, functions, and the like.
Salah satu hal yang saya ingin fokuskan di sini adalah poin nomor 5 dan 6. Dalam implementasinya
saya diharuskan untuk membuat sebuah adapter pattern yang menyambungkan elastic dan app tim kami.
Kenapa harus melalui app? Karena elastic tidak punya skema otentikasi sendiri, sehingga semua orang
bisa mengakses, karenanya diperlukan sebuah gerbang untuk hal itu. Kodenya dapat dilihat di