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
655
votes
15 answers

Should I put input elements inside a label element?

Is there a best practice concerning the nesting of label and input HTML elements? classic way: or
jpsimard-nyx
  • 7,779
  • 6
  • 29
  • 47
629
votes
14 answers

Is there a difference between "==" and "is"?

My Google-fu has failed me. In Python, are the following two tests for equality equivalent? n = 5 # Test one. if n == 5: print 'Yay!' # Test two. if n is 5: print 'Yay!' Does this hold true for objects where you would be comparing…
Bernard
  • 43,502
  • 18
  • 52
  • 69
181
votes
10 answers

count vs length vs size in a collection

From using a number of programming languages and libraries I have noticed various terms used for the total number of elements in a collection. The most common seem to be length, count, and size. eg. array.length vector.size() collection.count Is…
molasses
  • 2,998
  • 5
  • 20
  • 22
173
votes
7 answers

Which is more correct:

...

OR

...

Are both

...

and

...

valid HTML, or is only one correct? If they are both correct, do they differ in meaning?
knokio
  • 1,890
  • 2
  • 13
  • 12
157
votes
14 answers

boolean in an if statement

Today I've gotten a remark about code considering the way I check whether a variable is true or false in a school assignment. The code which I had written was something like this: var booleanValue = true; function someFunction(){ …
DirkZz
  • 1,839
  • 2
  • 14
  • 11
147
votes
33 answers

What is the opposite of 'parse'?

I have a function, parseQuery, that parses a SQL query into an abstract representation of that query. I'm about to write a function that takes an abstract representation of a query and returns a SQL query string. What should I call the second…
Simon
  • 24,010
  • 36
  • 139
  • 249
146
votes
10 answers

What is the difference between syntax and semantics in programming languages?

What is the difference between syntax and semantics in programming languages (like C, C++)?
haccks
  • 97,141
  • 23
  • 153
  • 244
117
votes
9 answers

HTML table td meaning

In HTML table, what does td stand for? I mean literally, what is it an acronym for? Table division? Table data?
ilija veselica
  • 8,936
  • 36
  • 89
  • 143
115
votes
4 answers

What are "sugar", "desugar" terms in context of Java 8?

I hear about 'sugaring' and 'desugaring' more often in Java 8, what does these terms mean ? are they conceptual or syntactical. Some Example: Default iterated loop resugaring to java Observations about syntactic sugar in compilation.
Xelian
  • 14,624
  • 22
  • 83
  • 129
108
votes
8 answers

Semantic Diff Utilities

I'm trying to find some good examples of semantic diff/merge utilities. The traditional paradigm of comparing source code files works by comparing lines and characters.. but are there any utilities out there (for any language) that actually…
jasonmray
  • 2,242
  • 2
  • 18
  • 14
108
votes
4 answers

Does anyone knows what "rimraf" means?

Ok for the recursive options when deleting files, but what is rimraf? Is it an acronym? Does it come from words combination? The word is fairly pleasant, I would like to know where does it come from.
Joseph Merdrignac
  • 2,212
  • 2
  • 16
  • 16
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,534
  • 12
  • 49
  • 62
102
votes
10 answers

Computed read-only property vs function in Swift

In the Introduction to Swift WWDC session, a read-only property description is demonstrated: class Vehicle { var numberOfWheels = 0 var description: String { return "\(numberOfWheels) wheels" } } let vehicle =…
Stuart
  • 34,797
  • 19
  • 93
  • 135
101
votes
12 answers

Checking for empty arrays: count vs empty

This question on 'How to tell if a PHP array is empty' had me thinking of this question Is there a reason that count should be used instead of empty when determining if an array is empty or not? My personal thought would be if the 2 are equivalent…
Dan McGrath
  • 37,828
  • 10
  • 90
  • 123
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
  • 67,265
  • 44
  • 170
  • 236
1
2 3
99 100