简体   繁体   中英

Why Clojure doesn't follow the most common indentation style in java code?

I was looking at java code in Clojure. I found the indentation to be very strange to me.

I'm pretty used to the indentation style by http://www.oracle.com/technetwork/java/javase/documentation/codeconventions-136091.html#262 . And most of the IDEs have configured auto-format in this way. Why doesn't Clojure follow this style?

UPDATE:

I meant the part of Clojure implemented in java eg https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/ARef.java

The code you are referring to uses the Whitesmiths style of brace indentation.

It is a matter of personal preference. Nothing wrong with it, other than it is not very common.

Why follow Java indentation style? Clojure follows Lisp.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM