
#404: Clean Code in Python
Talk Python To Me
00:00
Is There a Difference Between Numbers and Numbers in Computer Science?
There's two problems that are hard in computer science, naming things and validation. Maybe you can touch on the magic numbers there. Enums are a great recommendation because instead of saying, well, the default Sunday, so we're just gonna put Sunday here, like, Oh, I Sunday, this is weird. Or you say the function can take a string when really can only take seven strings,. You could really clearly communicate that with enums, which is quite nice.
Transcript
Play full episode