From: Eric Lavigne Date: 2007-11-25T00:16:22+09:00 Subject: Re: Choosing a scripting language for scientific programming I hope that the original poster will just start learning one of Ruby or Python and not spend too much time thinking about the difference for now. Learning the basics will only take a weekend, so it really does make sense to learn both and decide for yourself. However, I enjoy discussing the features and merits of programming languages, so I will reply anyway. :-D > When you invoke a method, such as cat.meow, in python you > MUST use the meow(). Python says this is to your advantage, but to > me it is a fundamental difference in philosophy ... > > It basically tells you, python way, or the highway. > > Python forces, ruby allows ... ;-) I believe that those parentheses are an advantage, and they actually allow me greater flexibility in my code by making the method invocation explicit. I have done a lot of functional programming, and in Python if I leave the parentheses off of a method then I can pass the method itself, uninvoked, as a parameter to another method. Typing two parentheses for each method call is a small price to pay for this convenience, especially since I end up typing as many parentheses in either case (but in different places) to control order of operations. It is strange to me that, in Ruby, if I try to pass around a method that takes several arguments, it complains about not receiving the arguments instead of just allowing itself to be passed around. Another Python advantage is that idiomatic Python code is extremely easy to read, even by mediocre programmers with no experience in the language. The indent-obsession that you criticize helps a great deal with that. On the other hand, here I am in a Ruby newsgroup. I like the blocks and iterators, the monkey patching, the greater support for concise code. Yes, I also like the consistency of length being a method (one less thing to remember), though I can't imagine why such a trivial issue comes up so often in these conversations. > "I've seen a lot of numerical libraries/extensions for > Python: does Ruby also support scientific programming?" > > Well there is gsl, also some stuff is in the Math module, then > we have some matrices and more stuff... I guess the hardcore > maths users go and use Haskell anyway :-) Haskell draws in programmer mathematicians, but most scientific programmers aren't quite so hardcore in either programming or mathematics. I wish that Haskell had better documentation for beginners (a problem that Haskellers are certainly working hard at) but for now the entrance barrier seems too high. -- There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult. - C.A.R. Hoare -