How is the refactoring story for Common Lisp? Is it lacking? We don't have good IDE refactoring tools, do we?
Those are legitimate questions, specially when we are evaluating the language and its ecosystem. It pops up regularly on reddit. It's best if we talk about experience and precise points, so here's mine.
The biggest Common Lisp project I contributed to is Lem. It is close to 300k lines of Lisp code, it exists since at least 2016.
It was very easy to contribute to, and I am not the only newcomer to say this. It is well structured, clear code, almost "boring" code. It doesn't use fancy language extensions and has a few macros.
I received pull requests on top of my contributions (Lem's legit Git interface). One big PR had me do more manual testing that anticipated, but that wasn't because the code didn't compile or was incorrect (a build error or a failed linter in a CI is spotted quickly), it was because of missing behavior (a missing generic function implementation in a given package), because the PR obviously had not been tested by the author.
It's true that we don't have fancy refactoring tools in CL like in modern IDEs for other platforms (not that I know of), but we have many tools that make small (and larger) refactoring easy during development. Comparing to what I know, the development experience is miles ahead of Python's. CL makes refactorings easy thanks to:
- language features (no moving syntax, multiple return values are NOT returning a list or a tuple, methods, macros…),
- implementation features (all the useful errors and warnings at compile-time, when you press a keyboard shortcut to reload one single function or a file or a module or a project),
- tools (the built-in cross-references: who calls this macro? Who uses that function? etc)
- as well as culture (deprecation warnings staying for years (I saw 12 years))
- and more? (I'm sure we could leverage Comby and such tools for more clever such and replace)
TLDR;
I want to refactor a Python code base: I sweat, I look for the latest tools (if they are compatible), I augment my test coverage, I triple check and deploy to a partner client and I fix issues in production anyways.
I want to refactor a Common Lisp project: just do it multiple times a day.
more feedback here https://www.reddit.com/r/lisp/comments/1ib08ci/on_refactoring_lisp_pros_and_cons/ and in the other linked threads.
Top comments (0)