what is ment by semantics in software terminology
what is ment by semantics in software terminology
http://en.wikipedia.org/wiki/Semantic
Do I need to say more?
thank you
Hmm... actually there is something more to be said. I don't think that wiki entry is that helpful for someone wanting to understand the meaning of the word when applied to computer programming since it does little to explore that area.
However my understanding of what it is my also be flawed. I'm sure anyone will correct me if the following is inaccurate.
Code semantics refers the meaning of code constructs. More exactly the meaning is conveyed by what can be done with those constructs and how they affect the program. In programming these constructs can be user-defined or language defined. If user-defined (classes), the class has its semantics defined when it defines its public interface. If language defined, the construct is generally one that affects the meaning of other constructs (pointers, references), or it is a general concept involving a program paradigm (reference semantics, value semantics,...)
Basically semantics can be perceived by how an object or a language construct is perceived by you the coder and how it affects the syntax involved in order to convey that meaning.
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
Semantics, although in principle it always means the same thing, is in the details highly dependent on the context.
Typically, you have two parts in analyzing a language, its syntax and its semantics. Syntax, the grammar, is about how the elements of the language can be correctly arranged. Semantics define what, if anything, a particular arrangement means.
The semantics of a program are the sum of its parts and they way they're interconnected. You can (in theory) find out what every program does by analyzing its parts and how they interact.
Both the C and C++ standards define precisely what program semantic means in terms of the C or C++ languages. They define the semantics of the program as the observable behaviour of it, i.e. the sequence of calls to I/O functions and reads from/writes to the volatile variables. Neither standard defines a way to mark an I/O function, though.
The interesting thing here is that every language implementation is free to do nearly whatever it wants with your code, as long as the semantics as defined by the standards remain the same.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law