Questions tagged [semantics]

The study of meaning as it applies to programming languages

Semantics is the study of meaning. In computer programming, semantics refers to the relationships between symbols in a programming language, and how those symbols are combined and manipulated to produce a computing result.

Useful links

1650 questions
95
votes
4 answers

When is it better to use a Tuple versus a KeyValuePair?

I've generally used the KeyValuePair type whenever I have data that is pair-related in the sense that one is a key to the other. If the data is unrelated then the Tuple type makes more sense and I'd go with that. Now I just read…
Nick Gotch
  • 8,739
  • 13
  • 66
  • 94
90
votes
3 answers

Anchors inside headers, or vice versa - is there a different in relation to SEO?

I always stumble upon this (rather simple question) when making e.g. Wordpress blogs. Should I wrap the headline, which should also be a link, in a anchor element, or should it be the other way around. And why? (1):
Frederik Wordenskjold
  • 9,246
  • 6
  • 35
  • 55
84
votes
6 answers

html5: using header or footer tag twice?

quick question: is it actually allowed to use the header tag twice? e.g. i have two important head-sections in my header.php where both could have header tag?
matt
  • 37,699
  • 99
  • 250
  • 390
82
votes
11 answers

Are parentheses around the result significant in a return statement?

Is there a difference between these two statements inside a function? bool returnValue = true; // Code that does something return(returnValue); and this? bool returnValue = true; // Code return returnValue; The former has parentheses around…
Jose Villalta
  • 1,379
  • 1
  • 11
  • 17
80
votes
3 answers

How to properly use h1 in HTML5

Which of the following is the correct way to structure a page: 1) h1 only in header

Site title

Page title

If I use h1 exclusively inside header as the site's…
deb
  • 11,136
  • 19
  • 62
  • 83
78
votes
10 answers

GET vs POST in Ajax

What is the difference between GET and POST for Ajax requests? I don't see any difference between those two, except that when I use GET, the parameters are send in URL, which for me don't really make any difference, since all requests are made on…
Jakub Arnold
  • 79,807
  • 86
  • 218
  • 314
78
votes
14 answers

Semantics and Structure of Name-Value Pairs

This is a question I have been struggling with for a while. What is the proper way to mark up name/value pairs? I'm fond of the
element, but it presents a problem: There is no way to separate one pair from another - they have no unique…
Ryan Kinal
  • 16,165
  • 4
  • 41
  • 63
76
votes
9 answers

Are semantics and syntax the same?

What is the difference in meaning between 'semantics' and 'syntax'? What are they? Also, what's the difference between things like "semantic website vs. normal website", "semantic social networking vs. normal social networking" etc.
John
  • 28,573
  • 67
  • 217
  • 373
72
votes
10 answers

Javascript: difference between a statement and an expression?

I asked this question earlier, and after thinking about the topic some more, I began to wonder where the seemingly fuzzy boundary between the meanings of the terms "statement" and "expression" lies. Are all statements also expressions? Where do…
wwaawaw
  • 5,927
  • 9
  • 24
  • 39
72
votes
12 answers

when to use UL or OL in html?

Seems interchangable?
omg
  • 123,990
  • 135
  • 275
  • 341
64
votes
11 answers

Is there an algorithm that tells the semantic similarity of two phrases

input: phrase 1, phrase 2 output: semantic similarity value (between 0 and 1), or the probability these two phrases are talking about the same thing
btw0
  • 3,176
  • 4
  • 29
  • 35
62
votes
2 answers

Specification for a Functional Reactive Programming language

I am looking at messing around with creating a functional reactive framework at some point. I have read quite a lot about it and seen a few examples but I wanted to get a clear idea of what this framework would HAVE to do to be considered an FRP…
seadowg
  • 4,033
  • 6
  • 32
  • 43
59
votes
5 answers

Semantically, which is more correct: a in h2, or h2 in a?

I'm stuck deciding which to use as both seem to work. Should I be placing links inside of

elements? Or the other way around? What is the correct standard?

Only Bolivian Here
  • 32,571
  • 60
  • 151
  • 250
58
votes
8 answers

H1 in article page - site title or article title?

Within an article-oriented page (such as a blog post), the

element (level 1 heading) is commonly used to markup either: the blog title (i.e. the often-large site title at the top of the page, not to the element), or the article…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/html" class="post-tag grid--cell" title="show questions tagged 'html'" rel="tag">html</a> <a href="../../questions/tagged/usability" class="post-tag grid--cell" title="show questions tagged 'usability'" rel="tag">usability</a> <a href="../../questions/tagged/accessibility" class="post-tag grid--cell" title="show questions tagged 'accessibility'" rel="tag">accessibility</a> <a href="../../questions/tagged/semantics" class="post-tag grid--cell" title="show questions tagged 'semantics'" rel="tag">semantics</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Nov 06 '08 at 12:20">asked Nov 06 '08 at 12:20</time> <a href="../../users/5343/jon-cram" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/5343.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Jon Cram" onerror="onImageLoadingError(this);" /> </a> <div class="s-user-card--info"> <a href="../../users/5343/jon-cram" class="s-user-card--link">Jon Cram</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">15,309</li> <li class="s-award-bling s-award-bling__gold" title="21 gold badges">21</li> <li class="s-award-bling s-award-bling__silver" title="72 silver badges">72</li> <li class="s-award-bling s-award-bling__bronze" title="105 bronze badges">105</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-10875064"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>57</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>3</strong> answers </div> </div> </div> <div class="summary"> <h3><a href="../../questions/10875064/is-there-a-valid-way-to-wrap-a-dt-and-a-dd-with-an-html-element" class="question-hyperlink">Is there a valid way to wrap a dt and a dd with an HTML element?</a></h3> <div class="excerpt">I wish HTML could do something semantically equivalent to this; <dl class="main-list"> <definitionitem> <dt>Some Thing</dt> <dd>You know it!</dd> <dt>Another Thing</dt> <dd>Word.</dd> …</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/html" class="post-tag grid--cell" title="show questions tagged 'html'" rel="tag">html</a> <a href="../../questions/tagged/validation" class="post-tag grid--cell" title="show questions tagged 'validation'" rel="tag">validation</a> <a href="../../questions/tagged/semantics" class="post-tag grid--cell" title="show questions tagged 'semantics'" rel="tag">semantics</a> <a href="../../questions/tagged/w3c" class="post-tag grid--cell" title="show questions tagged 'w3c'" rel="tag">w3c</a> <a href="../../questions/tagged/specifications" class="post-tag grid--cell" title="show questions tagged 'specifications'" rel="tag">specifications</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Jun 04 '12 at 00:20">asked Jun 04 '12 at 00:20</time> <a href="../../users/417629/jo-sprague" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/417629.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Jo Sprague" onerror="onImageLoadingError(this);" /> </a> <div class="s-user-card--info"> <a href="../../users/417629/jo-sprague" class="s-user-card--link">Jo Sprague</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">13,523</li> <li class="s-award-bling s-award-bling__gold" title="9 gold badges">9</li> <li class="s-award-bling s-award-bling__silver" title="37 silver badges">37</li> <li class="s-award-bling s-award-bling__bronze" title="57 bronze badges">57</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="s-pagination pager fr"> <a class="s-pagination--item" href="../../questions/tagged/semantics_page=1" rel="prev" title="Go to page 1">Prev </a> <a class="s-pagination--item" href="../../questions/tagged/semantics_page=1" rel="" title="Go to page 1">1</a> <div class="s-pagination--item is-selected">2</div> <a class="s-pagination--item" href="../../questions/tagged/semantics_page=3" rel="" title="Go to page 3">3</a> <div class="s-pagination--item s-pagination--item__clear">…</div> <a class="s-pagination--item" href="../../questions/tagged/semantics_page=99" rel="" title="Go to page 99">99</a> <a class="s-pagination--item" href="../../questions/tagged/semantics_page=100" rel="" title="Go to page 100">100</a> <a class="s-pagination--item" href="../../questions/tagged/semantics_page=3" rel="next" title="Go to page 3"> Next</a> </div> </div> </div> </div> </div> <script src="../../static/js/stack-icons.js"></script> <script> /* replace <time class="fromnow" /> with human delta between `datetime` attr and now */ document.addEventListener('DOMContentLoaded', function(){ var time_elements = document.querySelectorAll("time.fromnow"); for (var i=0; i<time_elements.length; i++) { time_elements[i].innerHTML = moment(time_elements[i].getAttribute("datetime")).fromNow(); } }); </script> </body> </html>