This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hmmmm. I hadn't tried this before, but I do enjoy working that way sometimes (the Jess rule engine has a read-eval-print loop, and I often use that to explore a new Java API by typing Lisp code!) I'm just giving it a try and you're right, it seems very cool. I'm going to check out if something similar is available plugin-wise for IntelliJ, because I'm pretty picky about keybindings and color and such when I'm coding.
I did a little research on the GroovyConsole inside Intellij thing. First, there really isn't anything in the JetGroovy plugin that lets you run the GroovyConsole. Now, that being said, you can create a .groovy file and put any kind of script code in it and tell IDEA to execute it. How is that different than putting it in GroovyConsole first?
Originally posted by Gregg Bolinger: I did a little research on the GroovyConsole inside Intellij thing. First, there really isn't anything in the JetGroovy plugin that lets you run the GroovyConsole. Now, that being said, you can create a .groovy file and put any kind of script code in it and tell IDEA to execute it. How is that different than putting it in GroovyConsole first?
Great question and I used to do that. Here's what I don't like about simply doing a script inside IntelliJ: 1) I need to worry that the script stays out of versioning. 2) I need to worry that the script isn't in a source path... otherwise it can break everything. 3) It adds to the clutter of editor tabs. 4) I'd rather not deal with the possibility of an infinite loop in a little experimental script slip-up bring my IDE to a crashing halt. 5) Most Importantly: I think it's easier to isolate what I'm trying to accomplish if I'm doing it in an environment that's separate from the rest of my code. It's easier for me to focus on "I have a list of [1,2,3] but I need a list of ['a','b','c']" when I know I don't have my other classes all around staring at me. Out of sight out of mind, and I think my objects have been more cohesive as a result.
I will agree that GroovyConsole isn't perfect with coloration of text. Sometimes it splits up colors where it shouldn't. But I've found that the shorter my methods and closures are, the less my brain needs code colorized to cope with it.