On a custom template, should I use wp_footer? [duplicate]

<?php function theme_footerscript(){
wp_enqueue_script('main_js', get_template_directory_uri() . '/assets/js/main.js', array('jquery'), '1.0', true);
}    
add_action('wp_enqueue_scripts', 'theme_footerscript');  ?>

this way you will add a script on footer (add this code in functions.php).
if you set the last parameter to true, then the script will be at the bottom of html page.
you can check on WordPress Codex