Re: Can you please give me some advice?



cmpython@xxxxxxxxx a écrit :
(snip)
I know nothing of Ruby, but just the fact that in Ruby the Hello World
program is

puts 'Hello, World!'

whereas the Python Hello World program is

print 'Hello, World!'

suggests to me that Python is more intuitive because the word "print"
has a meaning in English that makes sense given what you want to do,
but "puts" just doesn't.

Hem.... Sorry, but it reminds me of the most clueless comments on Python I've seen on c.l.ruby. I really don't think Python is more or less "intuitive" than Ruby, and making a judgement on such a pointless detail is not even worth the bandswith IMHO. FWIW, 'puts' means 'put string' (implied : on stdout), which is certainly much more semantically correct than what 'print' implies. When stdout is redirected to a socket that send bytes to a client program - like, say, a browser -, you're certainly not "printing" anything.

Anyway, at this level, Python and Ruby are surprisingly close to each other.

And, as someone who has been learning Python
from almost no knowledge of programming, I've found it is not too bad
in trying to keep as reasonably close to a natural language like
English
as possible.

Here again, Ruby claims (or at least some rubyists do) that Ruby is as close as possible to "natural language". With examples like:

5.times do {
something
and_something_else
}

which is arguably more "intuitive" than:

for i in range(5):
do_something()
and_something_else()


I also think the mandatory indenting of Python is helpful in forcing
new programmers to be neat and see code blocks quickly. Plus I doubt
the Ruby community has such a large group of helpful people

While perhaps smaller, the Ruby community is (AFAICT) known for being very active and helpful.

and
libraries
and such (but I could be wrong about that, just assuming it based on
the
fact that Python has been around longer).

On this last point at least, you're probably right !-)

On the other hand, perhaps because Ruby is newer it has been able to
freshly start with advantages learned from the difficulties of other
languages. Byung-Hee Hwang ought to go the Ruby group and see what
they are saying.

Indeed. Or even better, try both languages and find out which one he likes best. Implementation and 3rd part libs set aside, I could not say one is better than the other, so it's mostly a matter of personal taste and affinities.

As far as English goes, Byung-Hee, you have to admit English grammar
is easy

Would you say French is easy ? Because as far as I'm concerned, I find it the easiest language ever. Could it be because I'm french ?-)

(snip)
.



Relevant Pages

  • Re: Ruby vs. PHP
    ... done is checked out which versions of Perl, Python, YARV, Ruby, jRuby ... dynamic language to the seconds for the benchmark with gcc. ... YARV, Python, Perl and PHP have fairly close medians and the boxes are ...
    (comp.lang.ruby)
  • Re: Why not adopt "Python Style" indentation for Ruby?
    ... *language* features where Python leads Ruby.) ... When you come right down to it, there are only a few basic syntax styles that have survived the test of time. ... I suppose assembly language syntax has also survived, and FORTRAN and COBOL, but I don't think anyone would design a new language with those. ...
    (comp.lang.ruby)
  • Re: This is why Ruby 1.8.6 can never be made to run anywhere near as fast as Python 2.5.1
    ... having come here from many years with another scripting language. ... Ruby Maniac wrote: ... Ruby syntax seems to favor the notion that fewer characters is better ... Python runtimes are not affected by the number of characters one uses ...
    (comp.lang.ruby)
  • Re: lowering rubys reach
    ... Don't get me wrong it should make it a lot easier to write extensions for ruby - especially those that are merely for speed gains. ... What I was think of was the introduction of language profiles which would trigger certain language features. ... would complain about variable a not being declared and would need to be change to include a forward declaration, ...
    (comp.lang.ruby)
  • Re: Suggestion: swap name of "puts" and "print" and rename "puts" to "put_s"
    ... character and "puts" doesn't. ... Because that's how it is in the C language: ... Either way, just make it consistent. ... One of the benefits I have found from using Ruby is that it actively ...
    (comp.lang.ruby)