4 ms·
Perhaps, but there's no hard evidence that lack of syntax leads to better results. All else being equal, most programmers seem to prefer at least some syntax. I
by nradov 9y ago
Perhaps, but there's no hard evidence that lack of syntax leads to better results. All else being equal, most programmers seem to prefer at least some syntax. Is a long s-expression containing multiple nested parentheses easy to think about?
- breadbox 9y agoI would heartily agree that some syntax is preferable to none ... when you're writing code in general. However, little or no syntax is a huge advantage when you're writing code that writes code. That's what makes Lisp so powerful.
- eternauta3k 9y agoWhy not have sugar for the human and s-expr for macros?
- flavio81 9y agoThen you would have to know two languages at the same time: the sugary one and the macro one. Having exactly the same languages makes macro writing really easy.
- fulafel 9y agoA long expression containing multiple nested parentheses is no easier to think about in syntaxful languages. Re parens: Lisp doesn't have more parentheses than other languages: (if (validate foo) (println foo "is the right answer")) vs if (foo.validate()) { console.log(foo, "is the right answer"); } Unless you consider curly braces special and virtuous, and "(" parens bad.
- CrystalGamma 9y agoRust: if foo.validate() { println!("{} is the right answer", foo); } This has less parentheses (unless you count the placeholder in the format string). Putting the condition in parentheses like C and friends do is redundant if you use braces for the block anyway.
- nocman 9y agoless parentheses, but not less bracket-like characters. If you count parens and curlies, it is exactly the same. Yours has 4 parens and 2 curlies (not including the format string), and the original lisp code has 6 parens.
- junke 9y agoWell, many languages like Ada/Pascal or even SQL try to reduce the number of parentheses/braces. But you can manipulate their AST in Lisp easily; that's what makes working with DSLs easy. (procedure foo ((integer x) (in-out integer y)) (set y (+ 3 x y)))) ;; https://sites.google.com/site/sabraonthehill/postmodern-examples/postmodern-intro-to-s-sql (query (:order-by (:select 'countries.name :from 'countries :where (:= 'name '$1))) "Vietnam")
- peatmoss 9y agoThink about? Maybe, as it's completely unambiguous. Edit? Oh hell yes. Once someone groks paredit (a weekend to get fluent), every other language is painful. It's because you're editing in terms of complete forms, rather than in units mismatched to the actual code. Remember your first text editing experience? You probably spent a long time editing in terms of characters. Then remember what a revelation it was when you learned a programmers editor and started being able to manipulate larger portions of text such as words, lines, and even paragraphs? Paredit is like that, but the next level, because you're working at the level of arbitrary syntactic forms.