2 ms·
Is there such a thing as web specific language constructs? The way I see it language constructs are language constructs no matter where or how they're used. I
by bpatrianakos 14y ago
Is there such a thing as web specific language constructs? The way I see it language constructs are language constructs no matter where or how they're used. I think the main point to keep in mind here is that PHP was made for the web while other popular languages used on the web were created moreso for the purpose of being general scripting languages.
- klibertp 14y agoYes of course, certainly there are language constructs or features specific for some domain. That doesn't necessarily mean that such constructs can't be used in other contexts or domains (sometimes they can, sometimes not) but they were introduced into a language with a specific domain in mind. For example Erlang's `receive...after...end` and `!` are language constructs that are specific to the domain of message passing concurrency and they cannot be used for anything else. On the other hand Erlang's bit syntax is specific to the domain of writing binary network protocols but can be used for extracting data from binary files or constructing chunks of bytes for interoperability with C (structs). There are many more such examples in various languages - despite being "general purpose" they frequently include features and constructs useful for some specific domain - it's a natural way the languages are created and evolve.