Live data from Hacker News

“Did you mean?” Experience in Ruby

yukinishijima.net

21–30 of 187 posts

Re: “Did you mean?” Experience in Ruby

#22
post #8

I 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 ;)

Re: “Did you mean?” Experience in Ruby

#24
post #3

This sort of stuff should, at least in the 'easy' case be done at the editor level. Doesn't ruby have linter tooling for this? Still, props for the work.

Ruby has a linters, but this sort of problem is hard to solve with a linter in a dynamically typed language. It's even harder in a Rails environment since Rails adds many methods to your classes at run time.

Re: “Did you mean?” Experience in Ruby

#26

'Sometimes I wasted hours and hours just becaue there is one charactor difference. I hate it.' Not sure if the typos (Yeah, there are two) are intentional but I loved it :-)

> So what will happen when you misspell ActiveSupprt's Hash#with_indifferent_access?

Turned down the too-obvious ironic opportunity and went for somewhere else in the sentence.

Re: “Did you mean?” Experience in Ruby

#27

The 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++.

... until you start trying to make your app testable.

(I say this as a developer of primarily statically typed languages.)

Re: “Did you mean?” Experience in Ruby

#28
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 that shouldn't exist. It should either be solved by IDE/tooling in a dynamically typed language or by the compiler in a statically typed language. Stop guessing and let your tools do the hard work of remembering method names for you.

Re: “Did you mean?” Experience in Ruby

#29

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…

Context sensitive auto-complete is a godsend.

Re: “Did you mean?” Experience in Ruby

#30
post #22
post #8

I 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 ;)

For those who are interested, I'm pretty sure this is what you're referring to https://github.com/ajalt/fuckitpy. It's worth looking into for the documentation alone.
Post reply on HN