10 replies [Last post]
thepineapplehead
thepineapplehead's picture
Offline
Guru
Last seen: 1 year 4 weeks ago
Timezone: GMT+1
Joined: 2004-06-30
Posts: 9668
Points: 801

Lots of people use the word "semantic" when referring to bad code; "you shoudl use semantic markup".

I read somewhere an article about the misuse of the word "semantic" when you should be using "structural".

From Google:

Quote:
Semantics is often opposed to syntax, in which case the former pertains to what something means while the latter pertains to the formal structure/patterns in which something is expressed (for example written or spoken).

Verschwindende wrote:
  • CSS doesn't make pies

Tags:
Lorraine
Lorraine's picture
Offline
Elder
UK
Last seen: 13 years 4 weeks ago
UK
Timezone: GMT+1
Joined: 2005-01-04
Posts: 1001
Points: 0

"Semantic" vs "Structural"

Translation please :?

Deuce
Deuce's picture
Offline
Guru
Somewhere, USA
Last seen: 2 years 9 weeks ago
Somewhere, USA
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4424
Points: 1843

"Semantic" vs "Structural"

all ยป http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph

thepineapplehead
thepineapplehead's picture
Offline
Guru
Last seen: 1 year 4 weeks ago
Timezone: GMT+1
Joined: 2004-06-30
Posts: 9668
Points: 801

"Semantic" vs "Structural"

Well, basically "structure" or "syntax" describes marking HTML up with the proper elements, example <p> for paragraphs, <h1> for a header, <em> for emphasis, etc. Semantics = what somethign means . . . I think. Tongue

Verschwindende wrote:
  • CSS doesn't make pies

Lorraine
Lorraine's picture
Offline
Elder
UK
Last seen: 13 years 4 weeks ago
UK
Timezone: GMT+1
Joined: 2005-01-04
Posts: 1001
Points: 0

&quot;Semantic&quot; vs &quot;Structural&quot;

Well you see I wondered why webbies chose to throw away a perfectly good word like "syntax" - that's been used in computing ever since... ever since :roll:

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 4 years 35 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

&quot;Semantic&quot; vs &quot;Structural&quot;

strange thread :?

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Anonymous
Anonymous's picture
Guru

&quot;Semantic&quot; vs &quot;Structural&quot;

thepineapplehead wrote:
Semantics = what somethign means . . . I think. Tongue
You mean like how <p> means a paragraph is here or <h1> means a main header is here or <em> means this part is emphasized? Wink

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 6 years 51 weeks ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

&quot;Semantic&quot; vs &quot;Structural&quot;

:?

Syntactically correct = passes the w3c validator.
Semantically correct means using the elements appropriately. The w3c validator doesn't care if you use an h1 element for your footer, a p for your banner img.

Structurally correct or incorrect, I have no idea what that means Wink

roytheboy
roytheboy's picture
Offline
Guru
North Wales, UK
Last seen: 6 years 7 weeks ago
North Wales, UK
Timezone: GMT+1
Joined: 2004-09-18
Posts: 2233
Points: 41

&quot;Semantic&quot; vs &quot;Structural&quot;

I was with Chris on this one, until I read this > http://en.wikipedia.org/wiki/Semantic_web which clearly states that semantics in terms of the web means: computer-processable meaning. Then I got confused. Then I went back to this:

Syntactically correct = passes the w3c validator i.e. uses the right characters in the right places.
Semantically correct = uses mark-up elements appropriate to their intended purpose.
Structurally correct = uses mark-up elements in a logical and stable fashion.

...but there's no point arguing about this as it's all just semantics at the end of the day :?

Life's a b*tch and then you die!

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 6 years 51 weeks ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

&quot;Semantic&quot; vs &quot;Structural&quot;

That's semantic web, which is different from semantic (html) markup.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 4 years 35 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

&quot;Semantic&quot; vs &quot;Structural&quot;

Words, in this area although they may have specific meaning/ connotations often seem to merge and actually express the same thing.

Syntax seems really to refer to coding construction; so
</p> is correct syntax
<p/> is incorrect syntax

<h1>semantic heading<h1/> is semantically correct in expressing the text in a deliberate context yet is syntactically incorrect

'Structure' in the context of the original quote just means the second paragraph tag above is structured incorrectly. Structured is really a rather loose expression we may use it but the conditions that we may use it under could be better explained by using the terms 'Semantic' or 'Syntax'

It's therefore quite possible to refer to a lack of semantic context in code as 'Bad code' isn't it? and not necessarily wrong, to start to refer to code as structurally wrong is loose and requires clarification as to exactly what is 'bad' when one would explain the lack of semantic tags, possibly!

Hugo

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me