5 ms·
If you write your code the correct way, there wouldn't be any states in your namespaces for you to keep track in your head. That only happens if your code is fu
by huahaiy 6y ago
If you write your code the correct way, there wouldn't be any states in your namespaces for you to keep track in your head. That only happens if your code is full of `(def some-state (atom {}))` or something like that.
You are basically illustrating my point about "You probably cannot learn Clojure all by yourself". You need a mentor to show you how to do Clojure correctly, or you have the humility to learn the proper Clojure way. Sadly, most people would rather just try something and jump onto conclusions immediately.
- adamkl 6y agoFunction definitions and vars are a form of state that can accumulate in a REPL session. Its not just atoms. This can lead to issues where you decide to refactor and rename a var (Clojure is all about concise and expressive names, so its not uncommon to do this.. At least not for me) but you might not catch every place the old var name is being used. Because both vars are still exist in the state of your REPL, everything seems to work, but once you compile your uberjar or whatever, things are broken. A REPL isn't a replacement for good unit tests, and there are techniques for reloading your REPL state on save, but the issue of needing to keep the "REPL state in your head" is real, and not an artifact of doing things wrong. Just something that the developer needs to be aware of as a potential hiccup in the REPL experience.
- klibertp 6y ago> If you write your code the correct way, Then you don't need a REPL. This is a very weak argument, overall: there are programming techniques to compensate for any deficiency in the environment. The fact that you need to use them is already worse than not having to worry about it at all. > Sadly, most people would rather just try something and jump onto conclusions immediately. Just a gentle reminder, you're not talking to "most people" here. Nevermind me, we [EDIT: cut out the irrelevant details] I just want to say that assuming good faith and informed criticism are the better defaults for this forum.
- 8note 6y agoRepl development is great for exploration, when you don't quite know the right representation of your problem yet. The alternatives isn't changing your development environment, it's writing on a white board
- huahaiy 6y agoNobody said you "need" REPL. Doing REPL driven programming is just more productive, hence it is considered the right way in the Clojure community. Heck, you don't even "need" any higher level languages, you can write code in machine code, but that's besides the point. Your boast about your Lisp credentials is exactly the kind of things I caution against in the article. Your pride has prevented you from properly learning Clojure, which has a very different programming style from other Lisps. You are basically illustrating my point live, again.
- klibertp 6y ago> Nobody said you "need" REPL. Well, you did, quoting the article: > Yes, if you are not using the REPL, you are not doing Clojure right. or should I understand this another way? > but that's besides the point. True. I'm saying that if you need to code in a particular way to make good use of the REPL, then it's already worse than being able to use the REPL well without any special coding style. Erlang and Elixir are great examples of that. I also have a problem with you believing there even is one correct way to use any language, but that's bearable. You being so sure that you're the only one qualified to know anything about that correct way is much worse. EDIT: I just saw so many "revolutionary ways to write code" which were being pushed hard by people absolutely sure their methods are so much better, and which ultimately amounted to little more than a few percent improvement in productivity in the real world - in the best case. It makes me suspicious of any such claims. > Your boast about your Lisp credentials My? I said: > Nevermind me, but [...] So you're putting words in my mouth; further, I said nothing about my knowledge of Clojure, so this: > Your pride has prevented you from properly learning Clojure Is completely unwarranted. And offensive. Could you please stop?