Skip to main content

Questions tagged [syntax]

For questions relating to the syntax, or overall structure, of programming languages.

18 votes
2 answers
4k views

In a lot of languages (eg Java, C++, etc), you can use ++ and -- as increment/decrement operators. What was the origin of ...
Otakuwu's user avatar
  • 725
3 votes
0 answers
187 views

C++ notably has a way to skip initialization of members: ...
user23013's user avatar
  • 3,314
10 votes
6 answers
2k views

Consider the following example in Rust: ...
kaya3's user avatar
  • 22.4k
0 votes
2 answers
1k views

In most C-like languages, a call such as printf("%d", x) is followed by two parentheses; and I see that a statement such as ...
user avatar
34 votes
6 answers
6k views

I actually drafted most of this question before the relevant stack overflow question but it's still relevant. C has a famously confusing operator precedence order. It is divided into 15 levels and ...
mousetail's user avatar
  • 9,627
6 votes
4 answers
619 views

In the first high-level language (FORTRAN), lines of text would by default be treated as individual statements, except that a card which contained something other than an asterisk or C in column 1 and ...
supercat's user avatar
  • 2,330
37 votes
7 answers
10k views

C/C++ has an entrypoint int main(int argc, char **argv);, which provides the program with the arguments passed to it and a way to signal back the result: ...
404 Name Not Found's user avatar
9 votes
2 answers
1k views

After upgrading to Java 21, I realized that the promised switch expression has several surprising properties. The most surprising part is the yield keyword which ...
feldentm's user avatar
  • 2,498
4 votes
2 answers
578 views

I am probably lazy so I don't feel like thoroughly designing and implementing a new language. But maybe it already exists? Do any programming languages exist with the following traits? no need for ...
Марат Рамазанов's user avatar
3 votes
1 answer
395 views

I am confused about the implementation of a global namespace in python . How are variable names mapped as keys to the objects they reference as values ,since namespace is implemented as a dictionary? ...
Silah's user avatar
  • 33
21 votes
6 answers
5k views

The typical syntax for accessing an array (or list, map and similar data structures) at a specific index is a[i]. I believe C first introduced it as syntax sugar, ...
linux_user36's user avatar
18 votes
7 answers
4k views

Across languages that use the word static as a keyword or reserved word, I have observed it to mean: "This variable, despite being declared locally, shall be ...
Karl Knechtel's user avatar
6 votes
0 answers
332 views

I assume that C didn't originate the idea that, for example, the sequence \t inside a string literal should mean a tab character, that ...
Karl Knechtel's user avatar
3 votes
1 answer
376 views

Is the mass adoption of Unicode tokens as operators in general-purpose programming languages ​​a good idea? How acceptable is such a language to ordinary users and developers? Background I want to ...
Aster's user avatar
  • 3,508
7 votes
2 answers
877 views

Sorry if I am not using the correct terminology here, I'll correct it if it turns out to be that way. Programming languages such as Python or Mathematica typically have function syntax implemented as <...
CrSb0001's user avatar
  • 183

15 30 50 per page
1
2 3 4 5
10