Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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 the language rather than focusing on learning the syntax and keywords.

So why do different languages have different syntaxes?

share|improve this question
4  
@Tichodroma The question is asking why they don't, not stating they do. – Lattyware Nov 5 '12 at 12:15
2  
@Lattyware The question does state they do. So the question makes false assumptions. – user34768 Nov 5 '12 at 12:16
4  
@Tichodroma Reread the question, 'It seems like if every language had the same core syntax' - emphasis added. – Lattyware Nov 5 '12 at 12:18
4  
1  
@YannisRizos, it's a different question. That one was about common semantics. – SK-logic Nov 5 '12 at 12:21
show 7 more comments

closed as not a real question by Walter, Karl Bielefeldt, ChrisF Nov 5 '12 at 13:25

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.

2 Answers

up vote 6 down vote accepted

I'm going to give a couple of reasons why this could never really happen:

  • Personal preference.

    I love Python, personally, where the syntax uses indentation to specify code blocks. On the other hand, I know people who specifically hate Python for that exact reason and hate that syntax.

    Personal preference will always be a huge blocker for something like this.

  • Syntax can be better suited for certain tasks.

    Take, for example, a functional language and an object-oriented one. They will often have wildly different syntax as, due to the nature of how the languages work, a certain syntax can mean more to the reader in one context as opposed to another.

  • No governing body.

    If you expect a standard to be applied across the board, it would have to be agreed upon. If you have ever seen the effort it takes to make any open standard stick, imagine trying to ensure that that was the only method of doing it.

  • Programming isn't standing still.

    As higher-level programming languages become more and more common, we also develop higher level language constructs - these need new syntax to go with them, so who would make the call? Who would decide on the best syntax?

  • Languages evolve over time.

    Languages have not all been developed together, people make mistakes, changes, update as new ideas come along. Therefore there are many different syntaxes, just as there are multiple standards for most things.

Of course, there are other reasons, but this should make it clear the idea is as far fetched as, for example, unifying all operating systems, or having only one programming language.

share|improve this answer
I doubt that personal taste is the reason for different concepts of language syntax. – user34768 Nov 5 '12 at 12:24
@Tichodroma It is, language designers have their preferences too... – Yannis Rizos Nov 5 '12 at 12:25
@YannisRizos OK, let me rephrase: the (meaning one and only) reason. – user34768 Nov 5 '12 at 12:25
1  
@SK-logic How could you have "no syntax at all"? – Brad Nov 5 '12 at 14:14
1  
@Brad, well, I mean "no additional syntax at all besides the very basic and minimalistic syntax of S-expressions". Any new features, no matter how complicated and elaborate they are, can still fit into this minimal syntax, which is often branded as "no syntax" approach. – SK-logic Nov 5 '12 at 14:17
show 2 more comments

If a complete and finished theory of programming language design would have popped out of the void, maybe we would have The Syntax now. But each language has a more or less long history, was designed by different people/groups/committees with different preferences at different stages of computer science knowledge.

Additionally, each language implements different parts of the different paradigms, some more, some less. And it is still all evolving.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.