3 ms·
Would you mind shedding some light on how you do development and the pros and cons you experienced comparing to REPL-driven development?
by marai2 5y ago
Would you mind shedding some light on how you do development and the pros and cons you experienced comparing to REPL-driven development?
- mjul 5y agoNot OP, but I would venture that REPL-driven development encourages a style that is essentially trial and error programming. This may be good for small scale, short lived scripts and projects but it does not scale. My experience from a somewhat large (400+ people) Clojure project is that people would be better off building a test suite as a checked-into-source-control REPL substitute to drive their experiments and make sure the expected application behaviour stays the same over time. REPLs may be useful, but don’t use them as your only tool.
- mbrodersen 5y agoYep a good match for how I am thinking. One of the large projects I work on is written in C++ and it has more than 90000 use case tests to make sure it is safe to deploy into production. I haven’t had a customer production bug in the last 5+ years.
- Blackthorn 5y agoFor me, the biggest problem with REPL-driven development is the handling of global state. That's why there's no fewer than 5 (!) actually-being-used Clojure libraries for handling it.
- capableweb 5y agoWhat "handling of global state" are you referring to? The state of "vars" or the state of actual application data (a la "atom"s)? The former being solved with the various ns-* functions, the latter depends on the application and how state is being used. If you could, could you share the libraries you're referring to too?
- Blackthorn 5y ago> If you could, could you share the libraries you're referring to too? Component, Mount, Integrant, System, Clip.
- mbrodersen 5y agoSure. I think REPL-driven development is great for what I call exploratory programming. When you are playing around with ideas and want to quickly try out different approaches and quickly test if a new function is working. However the code that I normally deal with are very large code bases where a lot of the code is not written by myself. And I find it a lot easier to navigate and build a mental model of where things are and how it works using an IDE. It simply works better for my brain but of course YMMV.
- mtrower 5y agoWhy not both? Are the two concepts somehow incompatible? A REPL is a (very) powerful tool for testing, probing, inspecting (etc) code; but it is only one tool. It should be a part of your IDE (if you go for such things), not replace it.
- mbrodersen 5y agoWouldn't it make more sense to automate the tests instead of doing it manually? I have 9000+ auto tests for the large complex C++ code base I am currently maintaining. And the result is zero customer production bugs in the last 5+ years. And I routinely refactor and rewrite large parts of the code without worrying about it.
- mtrower 5y agoYes, automated test suites are great! I don’t know that they need all the things some people stuff into them, but the idea is a useful one. If you take my comment in the context of REPL-driven development, it’s going to seem tangential at best. But you mentioned that you prefer IDEs over REPLs; I’m merely suggesting that the two need not be exclusive. Unless you’re advocating for TDD, in a strict sense?