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
5054
votes
25 answers

Reference Guide: What does this symbol mean in PHP? (PHP Syntax)

What is this? This is a collection of questions that come up every now and then about syntax in PHP. This is also a Community Wiki, so everyone is invited to participate in maintaining this list. Why is this? It used to be hard to find questions…
Gordon
  • 312,688
  • 75
  • 539
  • 559
735
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
  • 8,587
  • 6
  • 32
  • 48
628
votes
13 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
  • 45,296
  • 18
  • 54
  • 69
317
votes
5 answers

What does it mean to hydrate an object?

When someone talks about hydrating an object, what does that mean? I see a Java project called Hydrate on the web that transforms data between different representations (RDMS to OOPS to XML). Is this the general meaning of object hydration; to…
Jim
  • 3,173
  • 2
  • 15
  • 4
203
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
  • 3,258
  • 6
  • 22
  • 22
193
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
  • 104,019
  • 25
  • 176
  • 264
190
votes
5 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
  • 3,510
  • 2
  • 19
  • 16
184
votes
9 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
  • 2,000
  • 2
  • 13
  • 13
184
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
  • 2,109
  • 2
  • 15
  • 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
  • 25,468
  • 44
  • 152
  • 266
129
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
  • 16,680
  • 25
  • 99
  • 152
119
votes
6 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
  • 9,414
  • 39
  • 93
  • 147
113
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,350
  • 2
  • 19
  • 14
110
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
  • 41,220
  • 11
  • 99
  • 130
108
votes
11 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
  • 36,683
  • 19
  • 101
  • 139
1
2 3
99 100