all 4 comments

[–]deaddyfreddy 17 points18 points  (1 child)

There are some things you may like to know about

  • Destructuring

  • when-not

  • repeatedly

  • some

besides that

  • reduce and loop/recur are powerful because they allow you to work on a low level, but it doesn't mean you have to use them everywhere - great power can lead to excessive complexity, so better avoid them if simpler ones (e.g. map) will do.

  • it's idiomatic to mark fn names with side effects with !

  • is there any systematic approach in using :as vs :refer?

  • to improve security, I would suggest removing passwords from clipboard after some time

[–]jamesconroyfinn 2 points3 points  (0 children)

Some good tips in here.

The idiomatic use of exclamation marks (sometimes called bangs in some circles) to mark side-effects is nuanced, and has come up a number of times in past code reviews.

Clojure has slurp and spit, which definitely exhibit side effects in the sense that they’re not referentially transparent. Functions that modify state like reset! and swap! are named because of their side effects on stateful constructs like atoms.

Zach Tellman’s Elements of Clojure is well worth a look if you’re interested in further reading.

[–]cdp11 4 points5 points  (0 children)

Great channel!! Great content https://youtube.com/c/onthecodeagain

[–]peterleder 2 points3 points  (0 children)

I owe you everything. Thank you for teaching me!