4 ms·
As a non-ruby dev, it isn't obvious to me that I should grep 'Homme' instead of 'HommeController' ... A statically typed language with a good IDE (yes, like Ja
by smanek 17y ago
As a non-ruby dev, it isn't obvious to me that I should grep 'Homme' instead of 'HommeController' ...
A statically typed language with a good IDE (yes, like Java) will find almost all these errors for you as you type (excepting config files, like you said).
- futuremint 17y agoI've found RubyMine to do a pretty good job with "red squiggly things". Its an IDE (yes, like Java) but for Ruby. A dynamic language. Static typing isn't a necessity for a good IDE, just look at Smalltalk.
- latortuga 17y agoAs another data point, a few of my coworkers claim Netbeans is a reasonably good Rails IDE.
- patio11 17y agoI do Java at the day job. If we hired you as a new employee, and in the course of cutting your teeth on our Java framework you made those errors, I think Eclipse would have caught exactly one of them. Routes.rb errors 1 and 2: sorry, this is either handled in a configuration file or the database, which is loaded from an XLS file in our framework. None of this is checked. Linking to non-existent pages: we don't actually have a URL generation helper, but if we did, it would be in the JSP and thus not subject to fast checking. Since in Java you'd be passing a string as a parameter rather than an automatically generated method, you'd get nothing useful here prior to actually clicking on the link and finding it didn't go anywhere. Misspelling confirm: This would be caught in your JSP compile step prior to deploying the server, although you'd still waste a minute. Mistyped property names: OH GOD do I hate this one. You'll get as far as any page done by that action without error. Then the action gets loaded and the fun begins. Typically you'll get an error telling you that a form is not defined , which is your cue that says "Check the contents of the annotations for this action, something is borked", but if you don't know that symptom or (worse) if you borked something in one of the fields where the page can still load, you'd either waste a lot of time or miss the bug entirely. (For example, in our system, one way of causing this bug would leave "name" totally unchecked but let the form submission succeed for good input. Since many of our outsourcers don't bother testing with bad input...) Misspelled formats: We don't even have this feature. (P.S. I don't know why Rails books and tutorials always emphasize this so much, since most people don't need it. I always just delete that code from my own Rails methods.) Botching the key to a parameters access: Since the key is a string and there is no way to tell whether Map#contains("arbitrary string") at compile time, you'll get as far as execution before seeing any error here. It will probably be a NullPointerException.
- tptacek 17y agoIt's a religious thing. Writing actions that make sense both with XML output and with HTML output tends to force you to write REST-y web-service-y interfaces. I delete the code too, but I feel guilty for doing it.
- lonestar 17y agoIf you're not a Ruby/Rails dev, it doesn't seem reasonable to expect that all the framework's errors will make sense to you. If you took the time to learn how requests are routed in an MVC framework, this particular error would probably make perfect sense to you.
- deleted 17y ago[deleted]