Hacker News new | ask | show | jobs
by spoiler 4773 days ago
I don't know about the first question, but:

2) Because Python would become Ruby, or at least Pubython, then. What attracts most people to Ruby is its humanist syntax, not sure what Pythons guiding philosophy behind the syntax is, but I tried both and ruby was just a lot better.

3) There is loads of little things that are just personal preference for me, but the choice of language always boils down to personal preference one way or the other! Never really tried Pip, so I can't answer.

1 comments

> Pythons guiding philosophy behind the syntax

Python's syntax philosophy in a nutshell: The more your program looks like line noise, the harder it is to read. Operators should be simple and minimal, operations like list comprehension should match existing usage in English, mathematics, or C.

> ruby was just a lot better

Here's a Ruby snippet. I don't want to pick on this particular project [1], rather, I've found that this is typical of Ruby code:

  state_machine :state, initial: :active do
    after_transition any => :blocked do |user, transition|
      # Remove user from all projects and
      user.users_projects.find_each do |membership|
        return false unless membership.destroy
      end
    end
Wow. There are colons, absolute value bars, implications, and who-knows-what-else flying everywhere! It gets worse, elsewhere in the same file there are messy lines like this one with single-arrow implications, question marks and ampersands [2]:

  scope :not_in_project, ->(project) { project.users.present? ? where("id not in (:ids)", ids: project.users.map(&:id) ) : scoped }
Simple, intuitive syntax? From where I sit, the syntax of Ruby is worse than C++, and approaches Perl levels of awfulness.

In most languages, I can at least sort-of grok what's going on from the context when I see unfamiliar operators, but not so in Ruby.

[1] https://github.com/gitlabhq/gitlabhq/blob/4caaea824cf51670d1...

[2] https://github.com/gitlabhq/gitlabhq/blob/4caaea824cf51670d1...

"Implications"? Is that a weird word for a block or what?
He/she means that `=>` looks like a mathematical implication, just like `|...|` looks like absolute value bars.