Earlier quoted context omitted.
Which becomes ironic because you end up writing way more text into the file for phpdoc then you would have if it were a static language to begin with; and you end up treating the variables as static type anyway! :|
PHP5 has real type hinting in the language, so you don't need to write any more than you would in Java.
“Did you mean?” Experience in Ruby
131–140 of 187 posts
Re: “Did you mean?” Experience in Ruby
#132A 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…
And with Ruby, especially since you mention Smalltalk, we have a tool that is getting closer to the kind of live introspection and modification that Smalltalk is famous for: Pry [1]. 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…
Re: “Did you mean?” Experience in Ruby
#133I'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…
When I code in Python I always have ipython console handy to try snippets of code and to autocomplete methods and fields.
Re: “Did you mean?” Experience in Ruby
#134Earlier quoted context omitted.
PHP5 has real type hinting in the language, so you don't need to write any more than you would in Java.
phpdoc handles much more than just typing function parameters.
Re: “Did you mean?” Experience in Ruby
#135A 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…
Is it possible that when you try and recreate your image from scratch, the code you have pasted into your editor is not sufficient to recreate the image? Maybe you pasted some things in the wrong order, or maybe you redefined a function, but some data that was created using the old version of the function is still in the image. If this is possible in your programming environment, then maybe the dead code is not worth…
Re: “Did you mean?” Experience in Ruby
#136Re: “Did you mean?” Experience in Ruby
#137I 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
#138Earlier 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…
Re: “Did you mean?” Experience in Ruby
#139Re: “Did you mean?” Experience in Ruby
#140>>> Sometimes I wasted hours and hours just becaue there is one charactor difference. I hate it. "because" misspelt.