I'm new to WordPress and I'm still learning from tutorials, but I'm confused with their conflicted ways. What the difference between these two ways to make the title a link:

```
<h1>
    <a href="<?php the_permalink(); ?>">
    <?php the_title(); ?>
    </a>
</h1>

```

and

```
<?php the_title(sprintf(
            '<h1><a href="%s">',
            esc_url(get_permalink())),
            '</a></h1>');
?>

```

Is it a performance issue? or a security? or what?

thanks.

**Edit:**

I know that the function `the_permalink()` has embedded `esc_url` functionality while `get_permalink` doesn't. So in my case, is there still any difference?