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