Syntax? Semantics? What's the difference? Let's break it down.
Syntax
It's the format we follow when we code in a particular programming language. Here are some examples:
Python
print("Hello Gel")
C
#include <stdio.h>
int main() {
printf("Hello Gel");
return(0)
}
Semantics
Semantics, on the other hand, is about the meaning or logic behind the code. It’s the formulation of how a program should behave. The logic can be expressed through:
- Algorithms
- Pseudocode
- Flowcharts
Top comments (0)