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:

  1. 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.
  2. There are fewer colons, making function calls more natural.
  3. 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:

  1. Less code unrelated to algorithms, even less than Python.
  2. 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
2
3
python.append()  ruby.add()

len(python) ruby.len

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:

  1. Comparing result strings.
  2. Checking the source code with regex.

Translated by gpt-3.5-turbo