Live data from Hacker News

Don't name your variables after types:you wouldn’t name your pets “dog” or “cat”

dave.cheney.net

1–10 of 33 posts

Re: Don't name your variables after types:you wouldn’t name your pets “dog” or “cat”

#9
Were my domestic pets actually amorphous blobs of text, damned straight I'd prefix or suffix their names with "dog" or "cat" just so I could keep them straight. "Honey, where's the header file for the blue one? Can't remember if it gets dog food or cat food."

To torture the metaphor a bit more, of course I'd eventually remember which one is which because they live with me. A better metaphor is the feral cat that shows up on my doorstep once a week looking for a handout. I've slept since then, what are you again?

Re: Don't name your variables after types:you wouldn’t name your pets “dog” or “cat”

#10
My first girlfriend named our cat named Kitty; my first spouse named our truck Trucky and wouldn't let me name our snake Fluffy. Sometimes my variable names reference types, but typically in dynamically typed languages. Didn't read past the title because it's wrong about me and wrong about my code
Post reply on HN