Giter Site home page Giter Site logo

Comments (3)

uvtc avatar uvtc commented on May 14, 2024

Incidentally, and related to this topic: where you, for example, have

;;; object creation
;; good
(java.util.ArrayList. 100)

;; bad
(new java.util.ArrayList 100)

;;; static method invocation
;; good
(Math/pow 2 10)

;; bad
(. Math pow 2 10)

I'd be tempted to make that:

;; ## object creation
;; good
(java.util.ArrayList. 100)

;; bad
(new java.util.ArrayList 100)

;; ## static method invocation
;; good
(Math/pow 2 10)

;; bad
(. Math pow 2 10)

such that "object creation" and "static method invocation" now look more like (H2) headings (both to the reader, and to the marginalia parser). :)

from clojure-style-guide.

bbatsov avatar bbatsov commented on May 14, 2024

The tradition dates back to Scheme AFAIK and is considered the facto standard in every Lisp. The margin exception rule is pretty common and I basically copied it from the Scheme style guide, but I dislike it as well and I'll probably remove it soon. I do like the triple and quadruple comments - they carry semantic information and that's not a bad thing.

from clojure-style-guide.

uvtc avatar uvtc commented on May 14, 2024

The tradition dates back to Scheme AFAIK and is considered the facto standard in every Lisp.

My guess is, that tradition may be changing with Clojure (just my 2 cents). I very much like the idea having comments in markdown. This way, if I'm away from some code for weeks/months, and want to quickly come to terms with it, I can have Marginalia process it and read through nicely-rendered (as html) comments side-by-side with the code. (Likewise, if I'm learning my way around someone else's code.)

If there were another popular tool like Marginalia which maybe rendered ";;; foo" ---> <h2>foo</h2>, ";;;; foo" --> <h1>foo</h1>, I could imagine the repeated semicolon syntax maybe being useful, but it's still problematic:

  • for one thing, I have to count semicolons
  • for another, there's no h3 (unless you make ;;; --> h3, ;;;; --> h2, ;;;;; --> h1).

Seems to me markdown is preferable to that. And also, many folks generally use some markdown in comments already (italics and code, for example).

from clojure-style-guide.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.