Is it better to use a constant or apply_filter?

I'm using WPML, which has several ways to access the current language.

ICL_LANGUAGE_CODE

if( ICL_LANGUAGE_CODE === 'en' ){
  // Do stuff
}

apply_filter( 'wpml_current_language', null )' docs

$lang = apply_filter( 'wpml_current_language', null );
if( $lang === 'en' ){
  // Do stuff
}

I can't find any documentation on the ICL_LANGUAGE_CODE.

The apply_filter has a documentation page, but in my opinion, the readability drops with this.

Are there any obvious drawbacks using one or the other?


Update

I know that I mentioned WPML, but that was to give the question context. This is WordPress-specific and not 3rd party specific. The dynamic could be anywhere in WordPress, in any plugin and/or theme.

Topic constants filters Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.