3

Q: How strenuously should we enforce elisp coding conventions on this site?

Users (often new-ish to Emacs) sometimes post code snippets in questions or answers that clash with pretty well-established coding conventions for elisp. The most common offenders are trailing parentheses and using camelCaseNames in place of hyphen-separated-lisp-names.

How proactive should we be in enforcing the conventions?

3 Answers 3

8

I think a soft approach is warranted.

Be gentle to the newbies, point out the errors of their ways in comments, but don't come down on them like a ton of bricks. A light edit of their post is okay, I think, in order to enhance readability (especially if their indentation is off)! As they gain experience and reputation, be more strict with them. And be more lenient with questions than answers.

I find it hard to be more specific without some concrete examples.

4

I would never edit those things in Question text unless it was so bad that the question was genuinely difficult to read.

I will always re-indent Question code which has been wrongly indented, as that absolutely makes it hard to read. This is the only aspect I feel should be enforced.

If posting a variant of such oddly-formatted code from the question in an Answer I will invariably reformat the code, which at least hints to the asker that their original formatting was non-standard.

1

I feel a bit unqualified to comment given my lack of points.

But from a personal perspective someone editing my code to adhere to style guides is a very non-confrontational way to enforce these standards. Opinions may differ, but "oh you made that better: I'll do that myself text time" seems a lot less confrontational than "you have to format your code this way and follow these arbitrary rules".

This involves more work on the part of the editor / moderator, but perhaps this is precisely what makes it more acceptable to people: You care about this enough to do a little work for the answering and the community, so I respect your actions.

Question as to how accepted these standards are

I have a little distrust of the legitimacy of coding standards. This standard is mostly by one or two authors and three years old and moderately opinionated about some issues. My impression that lots of the accepted standards that people talk about in elisp comes from people experience in other lisps. I have been referred to google's common lisp standards before.

In addition, I would note that emacs is very stateful (marks, point, buffer, restrictions, windows) while lisp tends to be quite functional, which means this shipping of standards may not be legitimate.

That said camel case versus hyphens seems a pretty straightforward question!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .