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.
music.stackexchange.com/users/9155/Pat Muchmore
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.
music.stackexchange.com/users/6593/SeuMenezes
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.
music.stackexchange.com/users/10290/MattPutnam
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 !
music.stackexchange.com/users/2808/Tim
Correct.
There is a subjective component to this decision, but you generally want to keep the placement of the beat as clear as possible.
The rule of thumb is that when a note doesn't begin on a beat, it should not cross into another beat without a tie, unless the notation is simple enough (e.g. quarter, half, quarter) that there is no ambiguity in how the rhythm lines up with the beat.
music.stackexchange.com/users/18899/NoteNova
Let's say I have the following piece in  4/4 , Should it be notated as:   or   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?
When to use a dot or a tie in music notation?
music.stackexchange.com
<guitar><theory><notation><sheet-music><rhythm>
music.stackexchange.com/questions/23039
music.stackexchange.com/users/7131/rexcfnghk
A general rule is that you shouldn't have dotted-notes that start on an off beat and carry through the next beat. The rule of thumb is that when a note doesn't begin on a beat, it should not cross into another beat without a tie, unless the notation is simple enough (e.g. quarter, half, quarter) that there is no ambiguity in how the rhythm lines up with the beat. As a general rule, dotted notes shouldn't start on an off-beat. Therefore, the second example is correct in this case.
The second example is correct notation in this case. As a general rule, dotted notes shouldn't start on an off-beat.