1

Using Java big IDEs compile my code while it is written so that errors are detected before runtime.

Is that possible with Ruby too? Actually I code in a Text editor. Errors are detetected at runtime only.

  • 1
    Possible duplicate of [Is Ruby a scripting language or an interpreted language?](https://stackoverflow.com/questions/7284179/is-ruby-a-scripting-language-or-an-interpreted-language) – liorko Jun 18 '17 at 19:46

1 Answers1

2

Is that possible with Ruby too?

If by that you mean "compiling", then no. If you mean "edit-time error detection", then also no.

Smart IDEs, like RubyMine, can guess/detect some errors, but only simple cases. And they are often confused by ruby's dynamic nature. (can't find location for a method, even though it's defined within the project. Or the opposite, find too many false positives).

In ruby, you simply can't know what does a piece of code do without running it.

Sergio Tulentsev
  • 226,338
  • 43
  • 373
  • 367
  • Does that mean, a typical Ruby programmers life consists of write-save-run-find_errors ? –  Jun 18 '17 at 19:53
  • 1
    @user2945914: pretty much. Only it takes the form of "red-green-refactor" cycle. You write tests, run them, then write code to fix the errors from the tests. – Sergio Tulentsev Jun 18 '17 at 19:54
  • Doesnt that significally increase dev time compared to Java where the IDE helps me finding errors during coding? –  Jun 18 '17 at 19:57
  • 2
    @user2945914: in java you're also supposed to write tests. :) – Sergio Tulentsev Jun 18 '17 at 19:58
  • 1
    @user2945914 doesn't Java method overloading significantly increase dev time because you have to write similar methods to handle different objects. Doesn't compilation increase dev time as you have to wait for the application to compile or in some cases make changes to the compiler itself? Everything has its trade offs and I actually find development in ruby to be faster than most because I don't feel hamstrung by the type based functional dependence. – engineersmnky Jun 19 '17 at 13:42