^ exactly
Sorry if I confused the issue a bit there

Jon's answer is a perfectly good one.
And (as he also says) if you are the only dev, then it's fine to put it wherever makes you feel comfortable.
I just wanted to expand on the answer a little bit and give you some tips on some things to read as you learn over time. No need to have perfect organization the first time you write something.
Coding is about learning concepts and best practices
while managing your time, and getting your product finished.
So I just wanted to give you some ideas that you may want to read up on as you progress.
Also yes, you are correct in that sometimes coupling and cohesion can seem like opposites, but the goal is to make them work together.
I think a good easy way to help yourself organize things in the beginning is to ask yourself
Quote:
if I put XYZ here, will the next programmer:
1) know what it means at a glance
2) know where to find it
3) be able to change it without breaking things or having to change many other parts of the program
|
These are the concepts behind the fancy words like
cohesion, etc.
And most likely you will often find the "next" programmer to look at your code will be
you, in 6 months or a year (when you have completely forgotten what the code does or how it works).
So it helps if you try and code in a way where you keep in mind the "next guy".
hth