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…
“Did you mean?” Experience in Ruby
71–80 of 187 posts
Re: “Did you mean?” Experience in Ruby
#72The value of static typing is more and more apparent. Recently I've played with ocaml and F# and it felt great compared to Java or C++.
C++ and Java are statically typed. If you're referring to dynamic polymorphism , then yes, it can be a pain in the ass.
Re: “Did you mean?” Experience in Ruby
#73I 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.
Re: “Did you mean?” Experience in Ruby
#74A lot of people are recommending IDE-like tooling--but in truly dynamic language (one with a "living image" with path-dependent monkey-patched behavior that can't be replicated during static analysis, like Smalltalk--or, sometimes, Ruby) there's a more idiomatic way. In a dynamic language, if you're at all unsure of what code you need to write, then you don't write it in your editor in the first place. Instead, you b…
I like this approach, and I think that we're not doing it enough. Does anyone know an effective way to do this in the browser, with JavaScript?
Re: “Did you mean?” Experience in Ruby
#75I 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.
Re: “Did you mean?” Experience in Ruby
#76I'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
#77A lot of people are recommending IDE-like tooling--but in truly dynamic language (one with a "living image" with path-dependent monkey-patched behavior that can't be replicated during static analysis, like Smalltalk--or, sometimes, Ruby) there's a more idiomatic way. In a dynamic language, if you're at all unsure of what code you need to write, then you don't write it in your editor in the first place. Instead, you b…
Pry lets you call "binding.pry" anywhere in your program to dump you into a shell within that context, with full access to local variables etc.. And tab-completion and plenty of introspection features. I frequently find myself triggering Pry in the middle of handling http requests if something doesn't work, for example. Letting me inspect the environment, modify stuff, and when I exit the request is completed.
It can also do things (with some limitations) like bring up an editor to where the current method was defined, and let you edit and reload the code.
And you can attach to it remotely using Drb in case the app in question doesn't run attached to a terminal.
At this point it's almost criminal to do Ruby development without Pry.
Re: “Did you mean?” Experience in Ruby
#78Earlier quoted context omitted.
PyCharm's auto-complete is really nice. It seems to be the best Python editor going right now.
Really? I used Aptana, which includes the Pydev plugin. I notice everyone seems to give PyCharm lots of love, and have been tempted to try it. Autocomplete is one of the features I rely on heavily.
Re: “Did you mean?” Experience in Ruby
#79Earlier quoted context omitted.
Funny that you mention Smalltalk, because of its image model, completion usually works quite well. I remember using it on my Smalltalk days at the university in 1996.
It works great if either A. The IDE lives inside the same live image the project being developed is loaded in; or B. there exists some sort of network/RPC-exposed "code server" running within the live image, which you can ask to do these sorts of completions. Of non-Smalltalk languages, the only one I can think of with anything like that is Erlang. You could easily enough build a code server in Ruby, but you'd have t…
Take a look at Pry's remote sessions: https://github.com/pry/pry/wiki/Remote-sessions
Re: “Did you mean?” Experience in Ruby
#80I'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 have exactly this frustration as a person coming from static languages (mostly C++) to web dev. Anybody can recommend something more comfortable? I like the concept of Vaadin, but I'd prefer something non-Java.