Hacker News new | ask | show | jobs
by catharsis 4867 days ago
Any IRC channel would work (##programming or ##python for example.) However, I wouldn't overthink it. There's really only two things you have to worry about when naming classes, variables, etc. That the name conveys properly what it's trying to represent, and also that it won't conflict with other names. A more minor point would be sticking to a naming convention (ie all_like_this or allLikeThis). Variables are the easiest, since they represent something specific at all times, even if the value changes (something like position.x for a sprite). Functions while harder, are still (if you're not overpacking functionality) a concrete input and output. Data goes in, data comes out, the name should describe what that processing is going on within (such as forierTransform). Classes are a lot like variables, they represent specific things no matter how they are changing inside (if your class is capable of representing a giraffe or an elephant for instance, then a broader Animal or Mammal title would apply better.) It's not supposed to be rocket science, so I don't think second guessing yourself on all your namings is going to do you any good. Learn more about what works and what doesn't and go from there.
1 comments

I would say these too. And one more thing - picking good names require an experience itself, too - if you write more code, your names will get better and better. Don't overthink it - if you make a little mistake for picking a not-really-suitable name for something you still have option to refactor your code.

And before I forget - having the opportunity to see more experienced people's code (well, the Internet is perfect for this) can nicely develop this skill.