Earlier quoted context omitted.
When I code in Python I always have ipython console handy to try snippets of code and to autocomplete methods and fields.
I also work that way. I use the autoreload feature of ipython so that any code I change in my editor is instantly replicated in my ipython objects. I've really never been more productive in development in my life. Contrast with some Java I was doing recently (granted, without a Java IDE) and I found the whole cycle painfully slow. Even things the compiler picked up were a magnitude slower to find than when I was in i…
“Did you mean?” Experience in Ruby
101–110 of 187 posts
Re: “Did you mean?” Experience in Ruby
#102I would love it if instead of quitting my program with an error, it just went ahead and called the method it thinks I'm referring to. This would remove a lot of unneeded friction from web development.
There is actually a python module that does something like that. It goes to the extreme to keep the program running no matter the error you make, arithmetic error are replaced with random results, missing functions skipped, exceptions silently swallowed etc etc. It is obviously a joke but they could benefit greatly from this feature ;)
Except you can find "On Error Resume Next" in "production" code. If I ever consider taking contracts doing Visual Basic, the contract will specify that any occurrence of "On Error Resume Next" automatically doubles my daily rate.
Re: “Did you mean?” Experience in Ruby
#103I've been pairing with ruby / rails developers since 2010 and coming from statically typed languages, it's unbelievable how much time gets spent playing "guess the method name". Even in rich IDEs like RubyMine, the utter lack of context in any given file in rails leaves programmers typing their best guess of a method name, running the tests, rinse, repeat. This solution, while creative and laudable, solves a problem…
That's not to say it's a bad language per se, but as someone who works in lots of different languages, I find ruby to be the one where I'm most likely to fail to guess correctly and have to spend time looking up the method I want.
Re: “Did you mean?” Experience in Ruby
#104Earlier quoted context omitted.
I also work that way. I use the autoreload feature of ipython so that any code I change in my editor is instantly replicated in my ipython objects. I've really never been more productive in development in my life. Contrast with some Java I was doing recently (granted, without a Java IDE) and I found the whole cycle painfully slow. Even things the compiler picked up were a magnitude slower to find than when I was in i…
Would you mind making a little screencast demo of your workflow? (Or do you know of any?) That sounds so cool.
Re: “Did you mean?” Experience in Ruby
#105Earlier quoted context omitted.
When I code in Python I always have ipython console handy to try snippets of code and to autocomplete methods and fields.
I also work that way. I use the autoreload feature of ipython so that any code I change in my editor is instantly replicated in my ipython objects. I've really never been more productive in development in my life. Contrast with some Java I was doing recently (granted, without a Java IDE) and I found the whole cycle painfully slow. Even things the compiler picked up were a magnitude slower to find than when I was in i…
This was your problem. Programming Java without an IDE that recompiles your changes on the fly is just so arcane and really slows you down as you noticed.
Re: “Did you mean?” Experience in Ruby
#106I've been pairing with ruby / rails developers since 2010 and coming from statically typed languages, it's unbelievable how much time gets spent playing "guess the method name". Even in rich IDEs like RubyMine, the utter lack of context in any given file in rails leaves programmers typing their best guess of a method name, running the tests, rinse, repeat. This solution, while creative and laudable, solves a problem…
It's not a problem that can be solved for a language like ruby without adding type hinting (and probably interfaces) to the language. FWIW php actually does support this.
Re: “Did you mean?” Experience in Ruby
#107I hope somebody forks this and creates a version that automatically corrects the method for you at runtime. Why even show an error or throw an exception? Bonus if the corrections are cached for performance.
Re: “Did you mean?” Experience in Ruby
#108Earlier quoted context omitted.
Seriously. Is there a good list of tools that provide it? In Python, the only one I've managed to love is PyDev. Supposedly Atom does it with the "script" package?
For Python I use jedi.el for Emacs ( http://tkf.github.io/emacs-jedi/latest/ ). There's also anaconda-mode ( https://github.com/proofit404/anaconda-mode ).
Personally I believe that things like Jedi - external static code analysers in form of a library - are what we should be doing. It's not good for IDE writers - it lessens vendor lock-in - but for the users it's a win. Having the same, very good, completions in both Vim and Emacs made my life much simpler.
Re: “Did you mean?” Experience in Ruby
#109I've been pairing with ruby / rails developers since 2010 and coming from statically typed languages, it's unbelievable how much time gets spent playing "guess the method name". Even in rich IDEs like RubyMine, the utter lack of context in any given file in rails leaves programmers typing their best guess of a method name, running the tests, rinse, repeat. This solution, while creative and laudable, solves a problem…
It's a hard problem to solve. In general inferring which methods are valid on any given variable or expression is undecidable. So you have to make an approximation, which is hard and the end results usually still disappointing. Here's a little test case: def foo(x): return x a = foo("hello") b = foo(34) To infer the methods that you can call on `a` and `b` you have to trace through the `foo` function. You can't just…
And yet, Hindley-Milner can do it. In general.
I've been working with dynamic and nontyped and weak typed and duck typed languages for over half of my life and you know what, it's getting ridiculous. They were never meant to support the team and project sizes we're forcing them into now.
Re: “Did you mean?” Experience in Ruby
#110Earlier quoted context omitted.
It's not a problem that can be solved for a language like ruby without adding type hinting (and probably interfaces) to the language. FWIW php actually does support this.
You don't need (static) type hinting, you can do the same with running a dynamic environment and querying it. That's how it's done in Smalltalk (see Pharo), some Lisps and so on.