The main difference is that the value stored in config
will need an extra step to read the value. If a var is defined in constants.php then it can be used directly.
In constants.php
$my_global = 'foo';
can be used directly
echo $my_global.'bar'; //outputs "foobar"
If the value is stored in config.php
$config['my_global'] = 'foo';
Then you have to read the value from config before you can use it.
$my_global = $this->config->item('my_global');
echo $my_global.'bar'; //outputs "foobar"
Or use the config retrieval directly
echo $this->config->item('my_global').'bar'; //outputs "foobar"
Constants are, by definition, a value that cannot change during the execution of the script. If that's what you need then define the value as a constant.
define(MY_GLOBAL, 'foo');
echo MY_GLOBAL.'bar'; //outputs "foobar"
If the value needs to change dynamically during script execution use config instead.
Both constants.php and the config library are loaded early in the framework's initialization and so are available for use when the controller is instantiated.