- It does not save when you run the program (so get used to saving before each run)
- I've yet to get the interrupt button to work while its running, so I've had to kill the process (thus issue 1 above).
- If you are working on a program (and have not saved it recently) and go to open another program (file-->open) you're not prompted to save the first file before its replaced. So save often.
Monday, March 15, 2010
Sunday, March 7, 2010
Create or replace a file and write a line of text to it:
new File("myfile.txt").write("Here is a line: \"whats a nice programmer like you doing at a blog like this\" \n");
Append to a file (creates the if it doesn't exist)
Read the second line (First line is line 0) of the file
println new File("myfile.txt").readLines() //what was the response
Saturday, March 6, 2010
What is Groovy anyway?
Groovy is a programming language based on java. Its what happens when you take mix Perl and Java, and sprinkle on some Ruby.
Groovy is weakly typed, unlike java, but shares most of java's syntax (as well as the java virtual machine), but guess what -- you don't need semicolons at the end of the line. You can use pretty much any java class and syntax you want, and that means that any java programmer can learn it quite quickly. Once you get the hang of it you can pound out code pretty quick. (BTW, Groovy is the core language of the Grails web framework.) Groovy comes with a simple editor (the groovy console) , as well as a shell for scripting fun, but for heavy duty programming fun its supported by Eclipse, and NetBeans (which I use) .
You can find plenty more Groovy propaganda (and doc) at the Groovy Hompage
The current version of Groovy can be downloaded for Linux and Windows ( No current OSx support -- whats up with that? I use all three OS's)