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

1728 questions
107
votes
40 answers

When is a language considered a scripting language?

What makes a language a scripting language? I've heard some people say "when it gets interpreted instead of compiled". That would make PHP (for example) a scripting language. Is that the only criterion? Or are there other criteria? See also: What’s…
Sietse
  • 7,884
  • 12
  • 51
  • 65
104
votes
3 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
  • 9,167
  • 14
  • 70
  • 97
100
votes
9 answers

Finding the id of a parent div using Jquery

I have some html like this:

Volume =

and some JS like this: $("button").click(function ()…
Rich Bradshaw
  • 71,795
  • 44
  • 182
  • 241
100
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
  • 42,713
  • 103
  • 264
  • 397
99
votes
11 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 the…
wwaawaw
  • 6,867
  • 9
  • 32
  • 42
94
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
  • 10,031
  • 6
  • 38
  • 57
94
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
  • 17,414
  • 6
  • 46
  • 63
91
votes
10 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,457
  • 1
  • 12
  • 20
84
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
  • 85,596
  • 89
  • 230
  • 327
84
votes
12 answers

when to use UL or OL in html?

Seems interchangable?
omg
  • 136,412
  • 142
  • 288
  • 348
83
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
  • 12,326
  • 21
  • 67
  • 86
80
votes
1 answer

What does the colon dash ":-" mean in bash

The result is the one desired; after a bit of trial and error. I don't understand what the "2:-" and "3:-" do/mean. Can someone explain. #!/bin/bash pid=$(ps -ef | grep java | awk ' NR ==1 {print $2}') count=${2:-30} # defaults to 30…
Stelios
  • 1,294
  • 3
  • 12
  • 28
77
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
  • 32,403
  • 80
  • 251
  • 422
68
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
  • 35,719
  • 63
  • 161
  • 257
67
votes
3 answers

What is exact meaning of "kitchen sink" in programming?

I read this word many time "Kitchen sink", mostly when i download something from github, there is folder with name "Kitchen sink". but i don't know exact meaning of this. Can anybody explain what is the meaning of Kitchen sink?
user5570620