Let's say I have the following piece in
4/4, Should it be notated as:
Are there any specific rules? From my previous experience, I believe the second one is the correct notation since it shows all the beats in
4/4, am I correct?
Yep, the second one is far better for precisely the reason you say. A general rule is that you shouldn't have dotted-notes that start on an off beat and carry through the next beat. There are exceptions even to this rule, but showing the underlying beat structure of the meter is paramount in the vast majority of situations.
Elliott Carter is an example of a composer that often violates this notational rule (sometimes using four beamed dotted notes, occasionally even crossing the barline), but this is for the specific purpose of notating multiple simultaneous tempos. Even with that reason, an argument could be made that it isn't worth it due to the difficulty with reading it.
If you are referring strictly to music written obeying to traditional rhythmic conventions (with rational time signatures and regular/even division), then your second example is more suitable. Please keep in mind that the first example is not wrong, but the second will make sight-reading much easier, as our own expectations when seeing a piece in 4/4 make us search for known beat patterns.
One possible exception is the dotted quarter, which can be exchanged with a quarter tied to an eighth. For example, the following fragment
is orthodox regarding to rhythmic division, but
is easy enough to read and can be more straightforward for those who are used to this kind of rhythmic figure.
This exchange can be especially useful in 3/4 meter, when you want to avoid a 6/8 feeling. For example, in this fragment
the continuous repetition of the pattern can lead, by assimilation, to that feeling of 6/8 (counting "1, 2" instead of "1, 2, 3"), as the dotted quarter is the time unit for such compound meter. Using, instead,
will highlight the first, second and third beats, visually aiding the reader to not assimilate the beat pattern to a binary compound meter (well, I know it has also to do with beaming of the notes, but I think you got what I mean).
As Pat Muchmore said, you can "break" these rules when working with unusual/irrational time signatures, free meter or other ingenious procedures (as is common with Elliot Carter's metric modulation, for instance). In such cases, you are the judge of what is more suitable or appealing to what you are trying to accomplish.
Here's a common chart showing how the notes break down:
Notice how each row is a full measure in 4/4. The general rule is that a note can span its direct children, or one of its children and one of its nephews. That is, a quarter note can span the 2nd and 3rd eighth notes, but not the 4th and 5th. A dotted note can only borrow from its sibling, not its cousin, so a quarter note can span eights 1-2-3 or 2-3-4, but not 3-4-5.
Your first example has the 3rd eighth note of the bar borrowing from its cousin, the 2nd eighth note. So this is "bad". The second way would be the proper way to write it.
Note that there are always exceptions to every rule, but it's good to follow the rules unless you have a really good reason not to.
The ideal is to keep each beat self-contained, so the second is preferrable.In 4/4 it's certainly best to keep each half of the bar separate, so anything which goes between beats 2 and 3 are shown as tied.It's easier to read, and the ties actually make you aware that the tune is syncopated.The same thing should happen in 6/8 too, which is effectively two halves of each bar. Some more modern composers and re-writers don't feel the need to do this. Change will happen slowly, but for now, at least, let's keep it easy to read - and probably easier to write (longhand at least).
It's good to see the dots alongside tab, so the rhythm can be followed, not guessed !
At the end of the day it's really a matter of preference to the composer. Most of the responses that I've read claim the second example is 'right' or 'easier to read' but those are truly opinions. It is my opinion that the first example is preferable, and that's the one I'd use. It has to do as much with how I was taught to read sheet music as it does the music itself. I would only use a tie as a slur between two different notes, and it's mathematically more complicated for me to read it in the second example. The dotted eighth in the first measure represents 3/16th of a beat. The tie in the second measure demands that I add 1/16th & 1/8th together, leading to extra math and at the very least a more difficult sightread. While it is a purposeful goal to make the music you annotate or compose legible and understandable, there is no real right or wrong here.