function gcd(a, b)
while b ≠ 0
t := b
b := a mod b
a := t
return a
Algoritmo de Euclides
def gcd(a,b):
while b != 0:
a, b = b, a % b
return a
Programas são como livros.
Readability counts.
O erro de reescrever software
Um Anjo
para ELA
Hacks
ou gambiarras?
//
// Dear maintainer:
//
// Once you are done trying to 'optimize' this routine,
// and have realized what a terrible mistake that was,
// please increment the following counter as a warning
// to the next guy:
//
// total_hours_wasted_here = 42
//
//When I wrote this, only God and I understood what I was doing
//Now, God only knows