Out of the several possible ways, what is the best practice for getting a field value for an entity? There are many different ways to get a field value from an entity.  For example, a text field:

$entity-&gt;get('title')-&gt;value;
$entity-&gt;get('title')-&gt;get(0)-&gt;get('value')-&gt;getValue();
$entity-&gt;get('title')-&gt;get(0)-&gt;getValue()['value'];
$entity-&gt;get('title')-&gt;first()-&gt;get('value')-&gt;getValue();
$entity-&gt;get('title')-&gt;first()-&gt;getValue()['value'];


And so on.

And then, depending on the entity, for the entity title (or name or label), you can sometimes do...

$entity-&gt;getName();


What is the best practice?  The first expression above (using the "value" property) is most concise -- are there any drawbacks to using it?

Is there any reason to prefer the first() helper instead of get(0)?  Why does the first() helper exist?  Are there cases when the first value in a field list doesn't have a 0 index?
There's likely no fast rule-of-thumb here because you're describing a few different things that will greatly depend on context (what entity, what fields?).

First, let's disregard ::getName(); it's a Taxonomy specific-wrapper around ::label() (whatever the entity has defined as its readable label in the entity definition it will return it). There's no such things a multiple labels so let's get to the main question being asked here: best practice on pulling field values.

It really depends on what you're trying to do.

If you look into ::get() method on the entity, you'll see its basically pulling data out of the internal $fields property which is is an array of objects that implement FieldItemListInterface. Classes that implement the interface supply the various get(), first(), getValue() methods that you can use when you're dealing with fields that may have one, none, or many values. They do extra overhead of checking for the existence of data or making sure it exists.

If you know for sure the data exists in your class you can skip the chaining of methods/properties and just get to the directly (e.g. $node-&gt;title-&gt;value), if not, these methods exists when you're dealing with uncertain structure in your entity/fields. Whatever the case, it depends on the specific entity class and the specific implementation of FieldItemListInterface to really decide what is best.