Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
I wonder if there is an official or de facto code style for clojure. I am trying to pick it up from bits I see on the net and one of the things that I notice is that everyone uses very short names on functions. It seems customary to prefer fewer characters where possible. (Examples: fib rather than fibonacci, str rather then string)
This is the opposite of the trend I have observed in Java over the latest years where the preferance is for long and descriptive naming, helped by auto-completion in the IDEs.
I can decide for myself of course, but is it more usual to have shorter names in clojure?
Of course the link talks about coding standards for Clojure libraries, but it is useful any way.
I noticed Clojure coding looks like English, for example:
search-city , walk-the-graph , clean-and-build
IMHO, this is better than:
searchCity, walkTheGraph, cleanAndBuild
Personally, I don't prefer short as the code will looks obfuscated.
Prefer fibonacci instead of fibo, walk-the-graph instead of walk.
That was actually more than I asked for, which is wonderful!
The link to the assembla-wiki was perfect. Exactly what I was looking for. Copying what the api developers are doing is probably best. And I can see that they do have a preferance for short names, like x,y for numbers, pred for predicates etc.
I also prefer longer names for functions and vars. I am used to camel case so I don't read that any differently than the dashes used in Clojure. For me it would have been just as easy to go with camel case but I guess it is nice to explicitly see where you call down to Java code.
Bring me the box labeled "thinking cap" ... and then read this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth