Codecademy
2014-01-04 23:39:28
Finally finished
No wonder they say Ruby gives you freedom. Just from the perspective of syntax sugar, it’s better than Python.
I used to dislike Ruby because of the ‘end’ issue, but overall:
- You don’t have to pay attention to indentation as much as in Python, and it even auto-indents (I haven’t seen this in Python). It’s a worry-free experience.
- There are fewer colons, making function calls more natural.
- It’s more object-oriented (Python still has the concept of types, like int, str, etc., which is particularly noticeable in parameter passing and return values; Ruby weakens this concept, to the point where you don’t even feel the presence of types when using them).
Overall, it has achieved:
- Less code unrelated to algorithms, even less than Python.
- More natural to write.
So, it’s better not to have subjective judgments before understanding something.
PS:
I’ve been using Java and Android for almost a year, still have no love for them. Can’t say I don’t understand them though.
2014-01-03 23:37:58
Don’t try to learn Python and Ruby at the same time.
Thanks to learning Ruby first, the ‘end’ is not too bad.
When writing Python, it’s miserable. I keep forgetting the colon and often forget return.
The class
requires (object)
, def func(self)
tortures people everywhere.
Writing patterns like ++ && from C is also embarrassing.
The functions in these two languages are also different, for example:
1 | python.append() ruby.add() |
I often mix them up and only realize it after submitting, plus the slow internet…
It’s annoying to rely on a proxy. I can’t even get in without connecting…
I’m the kind of person who runs code after writing a few lines to see the results.
A lot of time is wasted waiting for the results after submitting.
They say Ruby is slow. The most exaggerated saying is that when a ROR code is converted to GO, the server goes from 30 to 2.
I don’t believe it, but it’s so slow just doing a simple question (of course it should be the internet speed or the server of the website)
But this gives people the feeling of using someone else’s life to tell others that Ruby is slow… speechless.
A dumb hint
It’s too slow in mainland China, after a long time, it suggests checking loops. Please, I don’t even have a for/while loop.
Especially in Ruby, a language with multiple possible solutions for a single result.
It feels like there are two conditions to judge the results:
- Comparing result strings.
- Checking the source code with regex.
Translated by gpt-3.5-turbo