Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the meaning of 'construct' in programming languages

Tags:

c

I see the term 'construct' come up very often in programming readings. The current book I am reading, "Programming in C" by Stephen Koching has used it a few times throughout the book. One example is in the chapter on looping, which says:

"When developing programs, it sometimes becomes desirable to have the test made at the end of the loop rather than at the beginning. Naturally, the C language provides a special language construct to handle such a situation. This looping statement is known as the do statement."

In this case what does the term 'construct' mean, and does the word 'construct' have any relation to an object 'constructor' in other languages?

like image 874
Justin Avatar asked Apr 16 '14 16:04

Justin


People also ask

What is construct in programming language?

In computer programming, a language construct is a syntactically allowable part of a program that may be formed from one or more lexical tokens in accordance with the rules of the programming language. The term "language construct" is often used as a synonym for control structure.

What is the meaning of construct in Java?

A constructor in Java is a special method that is used to initialize objects. The constructor is called when an object of a class is created.


2 Answers

In this case you can replace the word construct with syntax.

does the word 'construct' have an relation to an object 'constructor' in other languages?

No. These two terms are different. There is nothing like constructor in C

like image 62
haccks Avatar answered Oct 12 '22 22:10

haccks


It's a generic term that normally refers to some particular syntax included in the language to perform some task (like a loop with the condition at the end). It has no relation at all with constructors.1


  1. Well, besides the fact that constructors are a particular language construct in many OO languages.
like image 39
Matteo Italia Avatar answered Oct 12 '22 23:10

Matteo Italia