[HN Gopher] Refactoring Clojure
___________________________________________________________________
Refactoring Clojure
Author : luu
Score : 53 points
Date : 2025-05-15 19:28 UTC (3 hours ago)
(HTM) web link (www.orsolabs.com)
(TXT) w3m dump (www.orsolabs.com)
| gleenn wrote:
| In general, it's a dream to test and refactor Clojure IMHO.
| Working with mostly static top-level functions, immutability by
| default, and mocking when necessary with the use of "with-redefs"
| makes writing tests easy. Also, the immutability makes it hard to
| break shared copies of memory which seemed to plague my earlier
| tangos with large Java code bases and standard OOP practices.
| sammy0910 wrote:
| most people I know eschew the use of with-redefs for testing
| because it's hard to verify that the testing environment is
| configured correctly as the codebase changes (but otherwise I
| second the points about immutability by default, and
| static/pure functions!)
| IceDane wrote:
| It's kind of funny that this article starts by showing a
| completely unreadable code snippet, but not because of the code,
| but because of the syntax highlighting scheme. There is no
| version of that code, or any code for that matter, that is
| readable using that color scheme.
| arijun wrote:
| > Our mission is to take this code and make it readable
|
| You failed. Between the unreadable text colors and the word wrap,
| the code is incomprehensible. I cut and pasted it into a
| plaintext notes app and it was way easier to understand
| NightMKoder wrote:
| Usually the controversial decision for Clojure code highlighting
| is rainbow parens. This color scheme is horrific and unreadable
| (on mobile at least).
| aeonik wrote:
| I don't like the color scheme, and in some of the snippets I
| don't understand the correlation, but some of them, I think the
| structural highlighting is very nice.
___________________________________________________________________
(page generated 2025-05-15 23:00 UTC)