Newest Questions
877 questions
24
votes
5
answers
2k
views
What options in Unicode are there for balanced pairs of brackets like `(){}[]<>`?
My esolang involves the use of balanced brackets (){}[]<> to denote different scopes. However, unlike practical languages, all pairs of identical brackets ...
14
votes
11
answers
1k
views
What alternatives are there for C++ operator overloading syntax?
I noticed C++ has operator overloading syntax with just the operator names:
T& operator +(T& lhs, T& rhs) {
return /* ... */;
}
However, there are ...
41
votes
6
answers
3k
views
Why do some PL choose to have a dedicated keyword for elseif instead of like in C?
In C, else if is nothing but a new if statement after a single-statement else clause. Why do ...
18
votes
7
answers
2k
views
What are the advantages and disadvantages of implementing reals as rationals?
(By rationals, I mean fractions. So, 0.5 would be stored as 1/2.)
There's only one language I know of which does this. So, what ...
30
votes
9
answers
2k
views
What are the upsides of using explicit line-ending characters (like semicolons) as opposed to newlines?
A lot of C-family programming languages (C, C#, Java, etc.) require explicit line-ending characters in the form of semicolons. However, newer languages (Python, Kotlin) can infer the end of a line ...
23
votes
7
answers
961
views
Is there a widespread alternative to C-style or Python-style code block syntax?
Many C-style languages represent code blocks using curly brackets:
if (condition) {
...;
...;
}
Python, however, uses significant whitespace:
...
22
votes
3
answers
806
views
Which horizontal whitespace should be supported?
There seems to be three approaches to horizontal whitespace for separating tokens:
Only tab and space: Bash, C, D, Dart, Go, Java, Lua, OCaml, Python, PHP, Perl, Ruby, Rust, Scala, Swift (also ...