It's because some people don't like s-expressions, so they've been making up a bunch of other stuff.
My theory: people who don't like s-expressions don't get programming; Thus, everyone who gets programming and is exposed to lisp becomes a lisp programmer, and people who suck at programming are left out.
Ask HN: Can someone explain to me why all languages don't try to have the same syntax?
21–30 of 60 posts
Re: Ask HN: Can someone explain to me why all languages don't try to have the same syntax?
#22Some differences really are arbitrary, and could theoretically be merged. Some are historical, e.g. someone worked on Unix for years and thinks in terms of verbs like "echo" because that's what shells used.
But usually, there are very good reasons for any differences.
One reason is the inherent complexity of a parser for a full programming language. It turns out that it's fairly easy to confuse a parser, because they're just not as good as human beings at correctly interpreting the "intent" of a statement. Most languages don't have a reason for being unless they introduce a bunch of unique constructs; and they're lucky if their own constructs can be parsed unambiguously, much less after adding support for extra "standard" constructs from other languages.
Yet another reason is that languages aren't as universal as you may think. For example, what would 'print "hello world"' mean in a makefile...when would the print-out occur? Would languages be allowed to ignore "standard" expressions that they can't logically use, or be forced to invent some interpretation of them?
A final reason is what would happen when languages are embedded in each other, which is even summed up by your example, PHP. If one language is embedded in another, it's a plus that they have different syntax: it clearly separates one from the other. This reduces the risk that you'll have to (for instance) escape or namespace every single name used by the embedded code, to avoid collisions with the surrounding file.
Re: Ask HN: Can someone explain to me why all languages don't try to have the same syntax?
#23The problem with standardization is that you iron out all of the innovations. Certain language constructs are simply better for certain tasks. Lisp is built for recursion so it's great with lists. Object-oriented languages in theory are great for modularity and maintainability. Granted all these aspects have a lot to do with the coder in addition to the language. If all languages required you to manage memory as in C…
He asked why we need different syntaxes, not languages. Most of what you said doesn't relate to syntax at all.
Re: Ask HN: Can someone explain to me why all languages don't try to have the same syntax?
#24A better question is why doesn't everyone in the world speak Esparanto.
http://www.xibalba.demon.co.uk/jbr/ranto/
Esperanto is not particularly easy to learn, despite the claims of its founder, so learners devote their time and effort to learning languages with much more return on investment once the language is learned.
Re: Ask HN: Can someone explain to me why all languages don't try to have the same syntax?
#25Earlier quoted context omitted.
He asked why we need different syntaxes, not languages. Most of what you said doesn't relate to syntax at all.
How could you have two different languages with the same syntax? The only thing I can think of is one is a subset of the other.
Re: Ask HN: Can someone explain to me why all languages don't try to have the same syntax?
#26The problem with standardization is that you iron out all of the innovations. Certain language constructs are simply better for certain tasks. Lisp is built for recursion so it's great with lists. Object-oriented languages in theory are great for modularity and maintainability. Granted all these aspects have a lot to do with the coder in addition to the language. If all languages required you to manage memory as in C…
From what I've heard, programmers at Google put it in the same ballpark as C++.
This brings me to another point.. the choice of programming language often has more to do with image and branding as opposed to actual technical merit.
That's why we keep hearing the same old mantras:
Java -> uncool and slow
C/C++ -> fast
PHP -> hack
Ruby -> cool but slow
Cobol -> for dinosaurs
.. even after the problems are fixed, the image remains. It's pretty hard to change people's perceptions.
Re: Ask HN: Can someone explain to me why all languages don't try to have the same syntax?
#27A better question is why doesn't everyone in the world speak Esparanto.
Re: Ask HN: Can someone explain to me why all languages don't try to have the same syntax?
#28I think the different syntaxes help you (or at least me) switch contexts and remember what language I'm using.
Re: Ask HN: Can someone explain to me why all languages don't try to have the same syntax?
#29Re: Ask HN: Can someone explain to me why all languages don't try to have the same syntax?
#30The problem with standardization is that you iron out all of the innovations. Certain language constructs are simply better for certain tasks. Lisp is built for recursion so it's great with lists. Object-oriented languages in theory are great for modularity and maintainability. Granted all these aspects have a lot to do with the coder in addition to the language. If all languages required you to manage memory as in C…
I don't mean to be pedantic, but the 'Java is slow' thing simply isn't true anymore. It certainly used to be slow back in the day, but it's actually pretty good these days. From what I've heard, programmers at Google put it in the same ballpark as C++. This brings me to another point.. the choice of programming language often has more to do with image and branding as opposed to actual technical merit. That's why we k…