开发者

Why are Ruby and Python more suited for programming outside an IDE than Groovy?

开发者 https://www.devze.com 2023-02-21 07:44 出处:网络
This is mainly in reference to this answer in \"Python vs Groovy vs Ru开发者_开发百科by?\" What makes Python and Ruby easier to develop outside an IDE?

This is mainly in reference to this answer in "Python vs Groovy vs Ru开发者_开发百科by?"

What makes Python and Ruby easier to develop outside an IDE?

The link also mentions debugging in the console. What is meant by that exactly?


Python and Ruby are easier to develop outside of an IDE than most of the JVM languages in general because they require less "overhead." I will speak primarily about Python, because that's my primary language.

In general, a Python installation has a single source for libraries (unless you're using virtualenv), and the whole project lives on the filesystem. There is no need to worry about .jar or .class files -- everything is compiled at runtime, and the .py files are your distributables.

Furthermore, Python is more concise than Java, and Groovy inherits a lot of Java's syntax (although it abstracts some things away). IDEs help to deal with boilerplate, making it less work for the programmer -- but languages without so much boilerplate don't require that help.


I disagree with the assertion that groovy is harder to develop with outside of an IDE. I've done serious python and groovy development, and a little bit of ruby, mostly without an IDE.

While there isn't a pdb style debugger, there's a console: groovysh is a non-GUI console, command line app, and groovyConsole is a GUI with simple syntax highlighting and editing. The rails and TDD philosophies emphasize development with tests rather than debuggers, and I find I rarely, if ever, feel the need to use a full-on debugger if I've got good test coverage. Whether this matters to you really depends on your own style of development.

Groovy simplifies the whole jar/classpath mess. While you can still set the classpath if you want, it's much easier to let groovy manage it entirely. Groovy automatically includes jars in $GROOVY_HOME/lib and ~/.groovy/lib in the classpath. Installing a library is simply copying it there. Better than that, with @Grab, you can declare your dependencies right at the top of your script, and groovy will automatically download the version you specify, and recursively get all of its dependencies and set up the proper classpath and classloaders; it can even manage two libraries that depend different versions of the same jar. Grails also has declarative dependencies.

The groovy language itself is just as concise and flexible as either ruby or python. While you can write it like full-blown Java, groovy can be written to look very similar to ruby.

One valid complaint against groovy vs python and ruby is that the startup time of the JVM is still noticeably worse.


Also for example Ruby on Rails includes some things that would otherwise be handled by IDEs like generators and console.

0

精彩评论

暂无评论...
验证码 换一张
取 消