In HTML5, I am learning about <header>,<nav>,<footer>,<article>,<section>, and <aside>. What is the purpose of these codes? If I take them out, it does not affect anything.
On a pure stylistic point of view, they are pointless and behave exactly like the <div> tag.
But, they do have a purpose: to give semantic value to the page content.
While a human being can easily distinguish what is the header and what is the footer on a webpage, a computer program will have hard time at making this kind of inferences.
Now, you may think that your web page is to be consumed by humans, not programs, and you're probably wrong: don't forget Search Engine bots.
By using proper tagging, googlebot (just as an example) will be able to give meaning to what would be otherwise just a pointless div. Google can this understand what is the REAL content of the page, what is navigation, and what is simply appendix.
Austin Gae
#HTML5
Ben Buchanan (200ok)
I make some bits of the web.
Quick extension to Francesco's answer...
Better to say "while a sighted human can visually distinguish the header and footer..." because these elements provide useful information to people using assistive technology like screen readers and braille printers.
That is, these elements are for accessibility - SEO is a bonus but not the primary reason semantic markup was defined in the specs.
If you are working on a system that only allows DIVs you can add equivalent functionality using ARIA, but the W3C's recommendation is to use native HTML where possible.