What is the right way to get number of items from a field? In code review I saw a developer using count($paragraph->field_events) to get the number of referenced entities.

I thought, surely that can't work, that can't be right.  So the question is, what is the correct way to get the number of items from a field on an entity?
Using count() on a field is acceptable because there is an implementation of Countable::count in the ListInterface implemented by ItemList class where it overloads the count method to count the items, from which FieldItemList and EntityReferenceFieldItemList inherit.

So you can use:

$paragraph-&gt;field_events-&gt;count()


or

count($paragraph-&gt;field_events)


synonymously.  They do the same thing.

From ItemList.php:

public function count() {
  return count($this-&gt;list);
}


If you'd like test this, you can play with this simple class.  If you remove the "Implements Countable" calling count(a) on object a doesn't return the count() method, but if you add it back, it does.  So on a low level, Drupal is using this so you can call count() on fields.