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.