Tagged Questions
43
votes
7answers
3k views
Why are semicolons and commas interchanged in for loops?
In many languages (a wide list, from C to JavaScript):
commas , separate arguments (e.g. func(a, b, c)), while
semicolons ; separate sequential instructions (e.g. instruction1; instruction2; ...
41
votes
4answers
16k views
Why do programming languages, especially C, use curly braces and not square ones? [closed]
The definition of "C-Style language" can practically be simplified down to "uses curly braces ({})." Why do we use that particular character (and why not something more reasonable, like [], which ...
2
votes
2answers
246 views
Why do different languages have different syntaxes? [closed]
It seems like if every language had the same core syntax but different semantics and features, new programmers or those learning a new language could focus on the theory and more abstract concepts of ...
10
votes
8answers
1k views
Why isn't functional language syntax more close to human language?
I'm interested in functional programming and decided to get head to head with Haskell. My head hurts... but I'll eventually get it...
I have one curiosity though, why is the syntax so cryptic (in lack ...
1
vote
3answers
210 views
How can you learn names of methods or classes of a framework or an API?
I've been programming C++ for a year now. I've gone through the language features and I've written good programs with it, so I decided to move on to OpenGL. At first it seemed confusing. As I kept ...
2
votes
2answers
186 views
What defines a language as a scripting language? [duplicate]
Possible Duplicate:
What is the main difference between Scripting Languages and Programming Languages?
I'd like to know what defines a language as a scripting language compared against ...
1
vote
2answers
315 views
What are complete programming languages with a minimal syntax and how is that important? [closed]
With minimal syntax I mean a language that could be entirely described with the least words possible, but complete enough to make any kind of program.
97
votes
12answers
8k views
Why are statements in many programming languages terminated by semicolons?
Is there a reason that a semi-colon was chosen as a line terminator instead of a different symbol?
I want to know the history behind this decision, and hope the answers will lead to insights that may ...
10
votes
11answers
603 views
Is there a personalizable programming language you can use to convert to others?
Is there a programming language in which you can set your own syntax configurations and it would convert the code to a language you choose?
For instance, you would choose specific configurations like ...
0
votes
2answers
176 views
Does syntax matters for a (Lispy) Domain Specific Language (MELT, inside GCC)?
I am the main author and designer of MELT, a domain specific language to extend GCC (the Gnu Compiler Collection). The implementation is available free software (GPLv3 licensed). If you want a ...
12
votes
5answers
505 views
Does the syntax of programming languages depend upon their implementation?
Although, my question may be entirely irrelevant, but I have sensed a pattern between most programming languages and their official implementations.
Interpreted (byte-interpreted?) languages like ...
4
votes
3answers
2k views
Whats the difference between syntax and grammar?
I understand the difference between syntax and semantics -
syntax - how the symbols are combined to form a valid expression or statement.
semantics - the meaning of those symbols that form an ...
20
votes
11answers
1k views
Is there a language out there in which parameters are placed inside method name?
in JavaScript:
function getTopCustomersOfTheYear(howManyCustomers, whichYear) {
// Some code here.
}
getTopCustomersOfTheYear(50, 2010);
in C#:
public List<Customer> ...
16
votes
11answers
1k views
Is there a language offering LISP-like macros with a more complex syntax?
LISP's macros are extremely powerful constructs, and the inability to introspect and modify the program itself beyond the method signature level has always struck me as a limitation. Yet I favour ...
9
votes
14answers
928 views
How do you keep all those languages straight in your head
I know Java, C#, C++. I have used Perl, and am picking up Python and Actionscript 3.
This is certainly a path others have trodden, so I am asking how do you keep all these languages straight in your ...
3
votes
2answers
654 views
Why do more languages not support ===
I mean it as it is used in JavaScript. Just curious why this is not supported in more languages? Like Java for example does not have it? Seems to be a very useful operator to have.
10
votes
9answers
796 views
Should programming languages be strict or loose?
In Python and JavaScript, semi-colons are optional.
In PHP, quotes around array-keys are optional ($_GET[key] vs $_GET['key']), although if you omit them it will first look for a constant by that ...
70
votes
15answers
4k views
Why do memory-managed languages retain the `new` keyword? [closed]
The new keyword in languages like Java, Javascript, and C# creates a new instance of a class.
This syntax seems to have been inherited from C++, where new is used specifically to allocate a new ...
29
votes
17answers
3k views
Does syntax really matter in a programming language?
One of my professors says "the syntax is the UI of a programming language", languages like Ruby have great readability and it's growing, but we see a lot of programmers productive with C\C++, so as ...
11
votes
22answers
1k views
Which useful alternative control structures do you know? [closed]
Similar question was closed on SO.
Sometimes when we're programming, we find that some particular control structure would be very useful to us, but is not directly available in our programming ...
28
votes
14answers
4k views
Why is there still case sensitivity in some programming languages?
I don't see any use for case sensitivity in a programming language, apart from obfuscating code.
Why implement this in a programming language?
Update:
It looks like someone you know made a ...
9
votes
8answers
999 views
Rigorous Definition of Syntactic Sugar?
It seems like in language holy wars, people constantly denigrate any feature they don't find particularly useful as being "just syntactic sugar". The line between "real features" and "syntactic ...
2
votes
5answers
741 views
Which programming languages doesn't use operator precedence besides Lisp like languages?
And what do you think about operator precedences? Would be harder programming in language where the operations are executed in sequential order?
Ex.:
2 + 3 * 4 == 20
2 + (3 * 4) == 24
Ok, Lisp ...
6
votes
3answers
489 views
How useful are infix operators in a programming language?
How useful are infix operators in a programming language? Are they worth the extra complexity they provide? Can you provide any examples where infix operators are better suited to the problem that ...
20
votes
43answers
2k views
What syntax element do you love most in a programming language you use frequently? [closed]
The logical companion to the Which do you hate most question. What's your favorite syntax element in a programming language- what nicety to you like best? I'm sticking with the 'syntax' ...
27
votes
36answers
3k views
What syntax element do you hate most in a programming language you use frequently? [closed]
No matter how much you love a programming language, there are always a few details in it that aren’t quite as nice as they could be.
In this question, I would like to specifically focus on syntax ...
