Kernighan qonuni
Qonunlar 0 06.08.2023 263

Nosozliklarni tuzatish birinchi navbatda kod yozishdan ikki baravar qiyin. Shuning uchun, agar siz kodni iloji boricha aqlli tarzda yozsangiz, ta'rifiga ko'ra, uni disk raskadrovka qilish uchun etarli darajada aqlli emassiz.

(Brian Kernighan)

Kernigan qonuni Brayan Kernigan sharafiga nomlangan va Kernighan va Plaugerning "Dasturlash uslubining elementlari" kitobidan olingan iqtibosdan olingan:

Har bir inson disk raskadrovka birinchi navbatda dastur yozishdan ikki baravar qiyin ekanligini biladi. Xo'sh, agar siz uni yozishda iloji boricha aqlli bo'lsangiz, uni qanday qilib tuzatasiz?

Shuningdek qarang:

Kernighan's Law
Qonunlar 0 06.08.2023 263

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.

(Brian Kernighan)

Kernighan's Law is named for Brian Kernighan and derived from a quote from Kernighan and Plauger's book The Elements of Programming Style:

Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?

While hyperbolic, Kernighan's Law makes the argument that simple code is to be preferred over complex code, because debugging any issues that arise in complex code may be costly or even infeasible.

See also: