Skip to content
0:00 / 0:00

#clojure#clojurescript#side-effects

Effect ive Clojure

denofclojure

179 subscribers • 1 video on Hallway

YouTube
  • Recommended by 2 people: 2 in engineering communities.
  • Presented by Ben, software engineer

Intermediate. Assumes working knowledge.

3K views7 years ago2 recommendations

Programming languagesSoftware designLisp and ClojureFunctional programmingSoftware architecture

Ben explores techniques for separating side effects from pure functions in Clojure and ClojureScript applications.

Pure functions are the building blocks of idiomatic Clojure(Script) programs, since we can easily understand and test them. By definition, these functions should not have any effects i.e. should not change the outside world. However, our programs are only useful if they produce effects like sending emails, displaying information, or saving information to databases. This talk explores techniques for writing effects in ClojureScript. We’ll look at how to separate effects from pure functions, discuss the tradeoffs of tools like callbacks, Promises, and core.async, and explore some strategies for simplifying sequences of effects. Bio: Ben has written code professionally for over a decade, working on projects ranging from IDEs, compilers, distributed test runners, code quality metrics, and web apps. After years of frustration with the verbosity of OOP (and a few production bugs related to mutable state), Ben switched to using Clojure professionally in 2015. His interests include data-driven programming and model-based testing. He currently works at Remix Labs, building native apps with ClojureScript and React Native.

Why it's here

2 people recommend this

What people say. Recommended as a helpful guide on managing side effects and IO in Clojure applications.

u/muhaaain r/Clojure • Recommends

Effect(ive) Clojure: Handle Side-effects with Clojure

u/jmayaalvin r/Clojure • Recommends

On “New Clojurians: Ask Anything”

>But how can I skip some IO step conditionally in clojure? It is just a simple If-statement in java world: { if (shouldDoIO) doSomeIO } But how can I achieve this with topmost function like yours? you may find this talks interesting: [video [video However IMO such patters make sense on large/complex apps.