Live data from Hacker News

Confessions of a Ruby Developer Whose Heart was Stolen by Scala

speakerdeck.com

21–30 of 74 posts

Re: Confessions of a Ruby Developer Whose Heart was Stolen by Scala

#21

For those interested in learning Scala I'd recommend the free chapters from Scala for the Impatient: http://logic.cse.unt.edu/tarau/teaching/SCALA_DOCS/scala-for...

Also, _Functional Programming Principles in Scala_ course on Coursera by Martin Odersky (Scala's designer) is very good.

https://www.coursera.org/course/progfun

Re: Confessions of a Ruby Developer Whose Heart was Stolen by Scala

#23
post #5

As a Ruby developer, I can't get through these sorts of slides. My other languages are C, Go and JavaScript, and the Scala syntax is totally inscrutable to me. Isn't the point of slides presenting something that can be easily absorbed? And I can't just quickly look up these declarations either — Scala is too complex for that given my experience level. Is there a gentle introduction talk for Scala around so I can eval…

The point of slides is to act as visual aids for a talk. So without the person talking, in many cases, they're perfectly useless.

Re: Confessions of a Ruby Developer Whose Heart was Stolen by Scala

#24
post #5

As a Ruby developer, I can't get through these sorts of slides. My other languages are C, Go and JavaScript, and the Scala syntax is totally inscrutable to me. Isn't the point of slides presenting something that can be easily absorbed? And I can't just quickly look up these declarations either — Scala is too complex for that given my experience level. Is there a gentle introduction talk for Scala around so I can eval…

As a Scala programmer I find Ruby syntax complex and inscrutable, almost like Perl.

You have a tumor in your brain.

Re: Confessions of a Ruby Developer Whose Heart was Stolen by Scala

#25
They way you'd build large systems in dynamic languages is to break it up into many smaller pieces that work together. This frees you to change parts without worrying about the rest.

To me, this type of development is much more natural and sane than the "one big clusterfuck" type of projects I've seen in Java et.al.

Edit: Also, dynamic languages let you make the tradeof between safety and speed. Sometimes you go slow and steady (simple code, tests..) and sometimes you just want to test something out.

Re: Confessions of a Ruby Developer Whose Heart was Stolen by Scala

#26
post #5

As a Ruby developer, I can't get through these sorts of slides. My other languages are C, Go and JavaScript, and the Scala syntax is totally inscrutable to me. Isn't the point of slides presenting something that can be easily absorbed? And I can't just quickly look up these declarations either — Scala is too complex for that given my experience level. Is there a gentle introduction talk for Scala around so I can eval…

As a Scala programmer I find Ruby syntax complex and inscrutable, almost like Perl.

As a Python programmer, I agree.

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
My conclusion? Ruby's syntax is awful. 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] [3]:

  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.

This is a copy-paste of a comment I made [4] weeks ago on another article.

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

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

[3] I split the line and inserted backslashes because HN gives me a horizontal scrollbar when it's a single long line; apologies if this transformation isn't legal Ruby, or changes the meaning of the code.

[4] https://news.ycombinator.com/item?id=5784296

Re: Confessions of a Ruby Developer Whose Heart was Stolen by Scala

#27
post #4

Earlier quoted context omitted.

Why do microsoft and google insist on static compiled languages?

Because they allow us to put very useful limits on the degree to which changes in a large and evolving codebase will violate the expectations of developers. When adding and changing code in large collaborative projects, the primary question in every developer's mind is "OK, what else depends on this, i.e., what is possibly going to break?" This goes back to the old wisdom of separating interface from implementation.…

> But programs in languages which enable, if not encourage, developers to add new methods to the integer '5' can quickly become very difficult to reason about.

Can you give me an example of a single ruby developer who thinks this is a good idea when writing new code/a library?

Re: Confessions of a Ruby Developer Whose Heart was Stolen by Scala

#28

Scala is a fantastic language, but my heart seems to resist due to things like this (slide 27/42): implicit class RichSeq[A, C[A]

Attention to syntax is what ruby is good at. Scala, Haskell treat syntax as a chore.

You don't know Haskell.

> take 8 $ cycle [1,2,3]

Re: Confessions of a Ruby Developer Whose Heart was Stolen by Scala

#29
post #4

Earlier quoted context omitted.

Why do microsoft and google insist on static compiled languages?

Because they allow us to put very useful limits on the degree to which changes in a large and evolving codebase will violate the expectations of developers. When adding and changing code in large collaborative projects, the primary question in every developer's mind is "OK, what else depends on this, i.e., what is possibly going to break?" This goes back to the old wisdom of separating interface from implementation.…

Fully agree, I'm a ocamler myself, was trying to make parent op think. Companies with dynamic language codebases should be fearful of the technical debt they've accrued (and hire us static guys to fix it!).

Re: Confessions of a Ruby Developer Whose Heart was Stolen by Scala

#30

Scala is a fantastic language, but my heart seems to resist due to things like this (slide 27/42): implicit class RichSeq[A, C[A]

What makes it a bit more complex than it would be in Ruby is the typesafety (what comes after RichSeq). So it's a bit harder to write such a library, but once it's written it's a breeze to use for users because the compiler tells them right away if something is wrong with the type.
Post reply on HN