Open hlolli opened 5 years ago
To start with, I take it for granted that this clojure-style-guide is used by organizations that write clojurescript, if I'm wrong please close or there's another clojurescript style-guide out there that I'm not aware of, please let me know in comments.
Yeah, it's meant to cover ClojureScript as well. I guess we should be more explicit about this in the intro.
In the wild, I see too often clojurescript developers writing React Classes in kebab-case.
kebab-case always makes me laugh so hard! In my mind it's always lisp-case, but maybe that's the right terminology indeed.
I would love a discussion around this since most code in the wild does not use PascalCase. I can see the argument, that since this is a symbol generated from a defn, it should be styled accordingly to a function. But that's outside of the intent of the code and just a re-agent implementation.
Interesting subject! I'm looking forward to hear what people think about it.
To start with, I take it for granted that this clojure-style-guide is used by organizations that write clojurescript, if I'm wrong please close or there's another clojurescript style-guide out there that I'm not aware of, please let me know in comments.
In the wild, I see too often clojurescript developers writing React Classes in kebab-case. This makes code very inconsistent when mixing interops with clojurescript functions.
Say I'm using in react-native the classes View and FlatList
and I decide to be clever and wrap the class FlatList into a clojurescript function
Then I will have a hiccup body of react classes where one class is PascalCase and the other one kebab-case. This I see as a real style inconsistency. Even worse is when I see developers literally writing react classes with kebab-case.
when it should be
whereas any js-linter and ts-linter would enforce PascalCase on classes
My argument for writing this into the style-guide would be, besides enforcing consistency, then in jvm-clojure the same styling applies, java classes are PascalCase, interfaces are PascalCase, same goes for proxy, defprotocol, definterface and deftype.
I would love a discussion around this since most code in the wild does not use PascalCase. I can see the argument, that since this is a symbol generated from a
defn
, it should be styled accordingly to a function. But that's outside of the intent of the code and just a re-agent implementation.