4 ms·
How can you choose a language without knowing the syntax? It's not arbitrary. Some languages have elegance or gotchas in how the syntax is laid out
by Minor49er 7y ago
How can you choose a language without knowing the syntax? It's not arbitrary. Some languages have elegance or gotchas in how the syntax is laid out
- dudul 7y agoHow can you tell the elegance or gotchas from a 6 line Hello World?
- giancarlostoro 7y agoIt's how I picked my favorite Python web framework, I compared all the hello world samples they all had, and wound up with CherryPy. The rest had too many decorators and it just looked silly to me. You can also figure out if it's C-like or Lisp-like, and so on from looking at syntax.
- rixed 7y agoFrom what you describe, sounds to me you picked your framework mostly at random, like one would pick a car for its color.
- neurobashing 7y agoyou can infer a lot; is it LISPy, is it C-ish, or one of the Haskell family, etc. I think you can tell a lot from just which family of syntax.
- cttet 7y agoNo, take Reason as an example: it is basically Ocaml. Despite having a C-like syntax, it is quite different from it. The syntax barrier is usually much smaller than the language itself.
- CarlRJ 7y agoAnd yet... someone trying to “sell” me a language while seemingly refusing to show me any code samples feels like someone trying to sell me a car based entirely on a spec sheet with no pictures and without actually seeing, touching or experiencing the car. They both provoke a reaction of suspicion - “what are they trying to hide?” As if they don’t trust me, the customer, to be able to understand the very thing they want/expect me to buy. I’m perfectly fine with a page that says, “here’s a code sample - notice that it looks similar to C, but here’s a list of reasons / an explanation of why/how it’s actually quite different from C.” One of my favorite programming books of all time is K&R, from back before ANSI, even. It said, “here’s a simple problem to solve, and here’s how you solve it in our language.” Repeatedly. Explaining how the features helped to solve the problem at hand. It was revelatory. And it assumed its audience to be knowledgeable programmers. It didn’t spend the first chapter just describing all the features or how great the language is without showing any code.
- thesz 7y agoFor many programming languages the line count of "hello, world!" program is exactly one. So you can deduce something just from a line count of simple program alone - for one such deduction is an answer to a question "are there at least some attempts to provide useful defaults?"
- chhickman 7y agoI agree that a Hello World is fairly useless example for anyone already familiar with programming languages. Perhaps something like a Fibonacci function should be the de facto short syntax example, as is common in functional languages. More useful though would be to have an example of how composition data structures work in the language - standard example could be a binary tree.
- tobr 7y agoSyntax is easy to show, but ultimately rather unimportant. If the big idea of a language is something substantial, starting by showing the syntax arguably just creates a distraction.
- vidarh 7y agoSyntax stops me from even considering some languages, because to a lot of us it is important. I spend most of working hours reading code; as a result how easy it is to read is important not just for my productivity, but for my overall happiness in life. A small sample on the front page will not tell me if a language is good enough, but it can give me an idea if it's worth spending more time reading up on it or not.
- elcomet 7y agoSyntax is something you become used to in a few hours. But it's not what's the most important and will make your time more efficient in the end.
- antisthenes 7y ago> Syntax is something you become used to in a few hours. This is completely subjective and not at all universal.
- vidarh 7y agoMaybe you do. I don't. Syntax is something that has a substantial impact on how I think and work. Presentation overall matters immensely.
- frenchyatwork 7y ago2000 years ago, they didn't have spaces or punctuation in writing. We could try dropping them again, and people would adjust after a few hours, but that doesn't mean that the spaces and punctuation don't provide value.
- setr 7y agoThe problem is that readability is largely a matter of naming conventions, organization, and adherence to known patterns. The language becomes more readable as you use it. Anything that isn't a C derivative is unreadable if you only know C. There are of course actual blockers to readability, like usage of similar-looking sigils and poor system library naming, but otherwise the syntax really doesn't tell you any useful information. It's the semantics that tell you how it'll all fall apart
- rixed 7y agoArguably, the syntax is the simplest thing one can change in a language, by creating a wrapper (like there are, as evoked in this thread, such wrappers around OCaml for instance.) Francky, syntax has little to no incidence about how well a given language fits a domain problem, and in my experience the only thing syntax is really important to, is how attractive the language is to programmers who judge languages by their cover. I remember having read somewhere that the initial versions of lisp where missing an actual syntax, and that it was planned to add one later, but that until then users would have to write directly the AST in an ugly syntax full of parentheses and devoid of familiar syntactic landmarks. Well, time passed, an nobody cared enough to add that user friendlier syntax :)