Heard about Syntactic sugar ?

Heard about Syntactic sugar ?

Syntactic sugar is a syntax of a programming language that is designed to make programming easier to read or write. It makes the programming language "sweeter" for human use. Things can be expressed more clearly, more concisely.

Few Syntactic sugar in C programming,

  • Operators like +=, -=, =, and /= are syntactic sugar for the longer forms x = x + y, x = x - y, x = x y, and x = x / y, resp.
  • i++, j-- is syntactic sugar for the i = i+1, j=j-1
  • Ternary operators x = (a < b) ? a : b, replacing the bigger if-else statements.

Lambda expression, initializer list are few more syntactic sugar in other famous languages.

Happy Learning ! Happy Sharing !!

要查看或添加评论,请登录

M Vijaynath的更多文章

社区洞察

其他会员也浏览了