Magnar Sveen 🌻 Profile picture
Sep 14 6 tweets 2 min read
Excellent point! This is one strength of types that doesn't really have a good direct equivalent in dynamic languages like #Clojure. I still don't miss types, tho. Why? Here are some of my strategies for understanding code that I'm reading. 1/
I will run the code as part of understanding it. With full access to the runtime in the REPL, I can often answer the question "What is this called with?" by actually calling it and then looking at the data. 2/
It's data! With Clojure you don't usually pass opaque objects around. Everything is represented with data. Maps, sets, vectors, scalars. It is easily inspected, filtered, drilled down into. 3/
The Clojure core library is packed with functions that work on its data structures. The result is less custom code to understand (what does this method even do). Instead you'll see the same common building blocks that you're intimately familiar with. 4/
Since the core library is so rich, the code is usually smaller in bulk. Add to that pure functions working on immutable data structures, and there's an immense amount of complexity that is removed. 5/
Finally, if all of these things fail me, I fall back to the tests. The tests should give me at least an example or two of how this is supposed to work. But normally, that is not necessary. The small code, the transparent data, the live REPL, is plenty.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Magnar Sveen 🌻

Magnar Sveen 🌻 Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @magnars

Sep 14
Some thoughts on why I do not miss type systems as a #Clojure developer. 1/
Type systems give you more security, in exchange for making your code more rigid. You "lock the code down" with types, and in return you get some guarantees. This is in my experience not a good trade-off. 2/
In many ways it is parallell to gaining security by deploying less often. Maybe the added time spent indeed reduces errors, but the reduction in flexibility and speed is not worth it. 3/
Read 7 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(