Live data from Hacker News

“Did you mean?” Experience in Ruby

yukinishijima.net

151–160 of 187 posts

Re: “Did you mean?” Experience in Ruby

#151
post #104

Earlier quoted context omitted.

Would you mind making a little screencast demo of your workflow? (Or do you know of any?) That sounds so cool.

Sure. I'm not near my machine for a couple of days but I'll post something when I get the chance. I see your contact info is in your profile so will ping an email when done.

I'd be curious to see this as well

Re: “Did you mean?” Experience in Ruby

#152

I'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…

I personally also find ruby to have uniquely poor naming - lots of similar methods with overlapping functionality, no consistent style, etc. 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.

Since it was written by a Japanese fellow originally i think that's where the unique names came from. Upcase and downcase were two that stuck out to me. Overall I like ruby quite a bit though.

Re: “Did you mean?” Experience in Ruby

#155

I'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…

I stick a 'binding.pry' (pry gem) in the body of the method I'm trying to write, and I trigger it with a test that has all the correct parameters (i.e. the happy path). I then write my code in the REPL. I can use 'ls' to look up available methods dynamically. Complex ActiveRecord queries are much easier to prototype. Finding the right method isn't usually too difficult. And pry supports prefix completion at the first…

I actually follow a very similar pattern when developing in both Ruby and Clojure. I particularly like it in Clojure because I can run `(doc function-name)` to get some documentation on the function I intend to use (I can never remember the order of arguments!!).

Re: “Did you mean?” Experience in Ruby

#156
Seems like a bandaid approach to fixing a severed artery. The real problem is the lack of desire to read documentation. This also has the problem of sending someone down the wrong path when the wrong "solution" is suggested. Read more documentation and pay attention while you're programming.

Re: “Did you mean?” Experience in Ruby

#157
post #104

Earlier quoted context omitted.

Would you mind making a little screencast demo of your workflow? (Or do you know of any?) That sounds so cool.

Sure. I'm not near my machine for a couple of days but I'll post something when I get the chance. I see your contact info is in your profile so will ping an email when done.

Thank you very much! I look forward to it!

Re: “Did you mean?” Experience in Ruby

#158
post #105
post #97

Earlier 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…

"without a Java IDE" 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.

Which is great, but that's almost not the main issue. In the ipython REPL I can work with my code and data at the same time. It's a huge disadvantage to not be be able to probe your data to create a working process.

Re: “Did you mean?” Experience in Ruby

#159
post #35

Earlier 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?

I use Intellij with the PyDev plugin as my IDE and Atom (with the script package) as my text editor. In general unless it's a really quick edit PyDev is MUCH better in the general IDE functions, like autocomplete, jump to definitions, visual breakpoint debugging, etc.. I love atom but Intellij is much better for serious dev/debugging sessions.

Yeah, that has also been my experience.

Why Intellij instead of Liclipse?

Re: “Did you mean?” Experience in Ruby

#160

Earlier quoted context omitted.

You could guess, but it wouldn't work in cases where, for example methods are added to a class dynamically and non deterministically as a side effect of some other operation.

Do you know how "image based" environments work? In short you live in the same space as your code, so when you write some new method you have access to all the "dynamically and non deterministically" code artifacts. With Smalltalk the code is always being run and you get many useful tools for querying the state of a running system. I know it's hard to believe, but you can get much better completion (not to mention re…

What if the available methods are potentially different each time the code is run?
Post reply on HN