There is a huge difference between the two versions.
From the docs,
If the current user has not logged in, this attribute will be set to an
instance of AnonymousUser, otherwise it will be an instance of User.
so you would want:
if request.user.is_authenticated():
# Do something for authenticated users.
else:
# Do something for anonymous users.