3 ms·
It's not impossible. But rather much less likely. And even less likely to do by accident. Lisp by itself basically encourages programming deviating from standar
by rowanG077 2y ago
It's not impossible. But rather much less likely. And even less likely to do by accident. Lisp by itself basically encourages programming deviating from standard practices. That the entire reason it's so powerful. It takes a real genius in addition to strong restraint to keep writing good code in that environment.
- cess11 2y agoWhat do you mean, "encourages programming deviating from standard practices"?
- kazinator 2y agoHe means he once read an article written by a web developer with no Lisp development experience called "The Lisp Curse", and that's his entire Lisp development experience.
- cess11 2y agoRight, yeah, seems likely. Such comparisons are usually pretty weird, putting non-hygienic macros against ordinary programming in some other language, rather than macros against the metaprogramming used there. Experience with macros and their footguns arguably prepared me pretty well for using JAXB and reflection professionally.
- tripleo1 2y agoHe means it's hard to do Java(script)
- rowanG077 2y agoLisp Macros are encouraged. In most other language you can't even write syntactical extensions. Such things are, generally, horrendous for readability. Like I said you can wield them effectively. But the average developer won't be able to.
- cess11 2y agoWhy not? Is "the average developer" hampered by some neurodevelopmental deficit? How come the freedom in naming of functions and data doesn't have the same effect?
- rowanG077 2y agoIf you disagree that Lisp has a tendency to become unreadable then maybe the typical developer might have a "neurodevelopmental deficit" compared to you. bindings don't change the language that's executing. That's the entire point why Macros can quickly make code unreadable.
- kazinator 2y agoMacros do not change the language that is executing (as in self-modifying code). Self-modifying code is possible to express by other means in traditional Lisps that have a quote operator. In Common Lisp, it is undefined behavior to modify a quoted part of the program. E.g. this wold be undefined: (defun counter () (inc (car '(1)))) The function is referring to a piece of its own syntax (1) which initially holds the integer 1 and incrementing that. This may have the expected effect under some circumstances. Or it could have the expected effect, plus some unexpected effect, or not have the expected effect at all. It may signal an error, also.
- cess11 2y agoYou can easily write unreadable Java code. So what?
- tripleo1 2y agostack overflow syndrome?
- kazinator 2y ago> are encouraged {by-whom} Google Lisp style guide: Use macros when appropriate, which is often. Define macros when appropriate, which is seldom. Heinrich Taube's "Lisp Style Tips for the Beginner": Beware of macros. They are a very important feature of Lisp but a poorly implemented macro can cause bugs that are very difficult for a beginner to solve. Avoid writing macros until you understand how the Lisp reader and evaluator work. Never write a macro to make things "more efficient". Guy Steele and Kent Pitman, "Tutorial on Good Lisp Programming Style" [1993]: Decide if a macro is really necessary. [...] Don't use a macro where a function would suffice.* Carnegie-Mellon Lisp FAQ: Never use a macro instead of a function for efficiency reasons. [...] Don't define a macro where a function definition will work just as well -- remember, you can FUNCALL or MAPCAR a function but not a macro. I've never seen a book, tutorial or style guide document saying that Lisp coders should be writing lots of macros, and constantly looking for any excuse to write another macro or some such advice.
- kazinator 2y ago[flagged]
- rowanG077 2y agoDo you think this is a good faith way to communicate with other people? No where in my comments did I attack anyone or accuse people of lying. Yet you suddenly come out of the gate swinging. Why?
- kazinator 2y ago[flagged]
- deleted 2y ago[deleted]
- dang 2y agoI happen to agree with your underlying point, but expressing it in the form of a personal attack is the worst thing you could do here. It destroys everything that we're trying for on HN, and also reinforces the worst clichés about Lisp on a social level. Please don't post like this to HN. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- deleted 2y ago[deleted]