Plugin Development - Determine If Run Directly - Best Practice

What is the best practice to determine if a plugin is run directly and not allow it?

I have come across both of the following.

if ( !function_exists( 'add_action' ) ) exit;

if ( ! defined( 'ABSPATH' ) ) exit;

Which is better? Is there an even better method?

Thank you for your time and knowledge.