Skaut qoidasi
Qonunlar 0 06.08.2023 178

Scout Rule qoidasi O'Reilly

Har doim kodni topganingizdan ko'ra yaxshiroq qoldiring.

(Robert C. Martin (Uncle Bob))

"Skaut qoidasi"ga asoslanib, "lagerni har doim topganingizdan ko'ra tozaroq qoldiring", dasturlashda Skaut qoidasi shunchaki "kodni har doim topganingizdan ko'ra tozaroq qoldiring".

Bu Bob Martinning "Toza kod" kitobining birinchi bobida keltirilgan. Qoidaga ko'ra, ishlab chiquvchilar "optimistik refaktoring" ni amalga oshirishlari kerak, ya'ni kod ustida ishlayotganingizda uning umumiy sifatini yaxshilashga harakat qiling. Agar xatoni ko'rsangiz, uni tuzatishga yoki tozalashga harakat qiling. Biroq, kodga noto'g'ri ko'rinadigan o'zgartirishlar kiritilganda, Chestertonning panjarasini esga olish kerak!

Shuningdek qarang:

The Scout Rule
Qonunlar 0 06.08.2023 178

The Scout Rule on O'Reilly

Always leave the code better than you found it.

(Robert C. Martin (Uncle Bob))

Based on the "Scout Rule", which is "always leave the campground cleaner than you found it", the Scout Rule in programming is simply "always leave the code cleaner than you found it".

This was introduced in the first chapter of the book Clean Code by Bob Martin. The rule suggests that developers should perform 'optimistic refactoring', which means to endeavour to improve the overall quality of the code when you work on it. If you see a mistake, attempt to fix it or clean it up. However, when making changes to code which seems incorrect, it may be worth remembering Chesterton's Fence!

See also: