Live data from Hacker News

Ruby 2.5.0 Released

ruby-lang.org

41–50 of 113 posts

Re: Ruby 2.5.0 Released

#41
post #40

Earlier quoted context omitted.

rspec’s internal DSL is based on Ruby’s multi-line anonymous functions. I don’t know how you achieve a similar design in Python where you don’t have those in the same way. How do you write the equivalent of ‘it ‘does something’ do ... end’ in Python syntax?

This seems a good starting point https://stackoverflow.com/questions/37334668/is-there-a-pyth... TLDR: not as nice as RSpec but close.

> not as nice as RSpec

Right, well that probably answers the question about what they thought the magic is.

Re: Ruby 2.5.0 Released

#42
post #24
post #20

Earlier quoted context omitted.

Cool which libcurl bindings are you using?

Patron, from here: https://github.com/toland/patron . We use it in combination with our (open source) FastSend gem to keep the streamed data away from the Ruby garbage collector, since it gets a bit emotional if it has to clear out hundreds of MBs every second. If you're interested why we chose this architecture instead of just redirecting to S3, our lead engineer gave a talk about the reasoning behind this structure…

You can fill GB/s with net/http. You could do so easily with 1.9. The GC shouldn't be a problem unless your object graph is very complicated.

Re: Ruby 2.5.0 Released

#44
post #27
post #7

I started using Ruby only in April this year due to starting at a new job. Having used and/or dabbled in C, Java, Python and Haskell before (amongst others), I find it super interesting to see how Ruby manages to take some interesting parts from each and manages to integrate it into a very pleasant programming experience. Also the rspec testing library is nothing short of magic, none of the compiled languages have an…

I'd be very interested to know what you mean by "nothing short of magic". I've had a quick look at the rspec documentation and as a Python dev this looks very similar to what's in the Python standard library. Would that be considered magic as well or does rspec have some cool features that I have missed?

Note how I said compiled languages, I expect Python to have some very similar capabilities. :) But as an example, take the cleanness of the following mock:

  allow_any_instance_of(Set).to receive(:member?).and_return(true)
  
Contrast this for example with testing IO monad code in Haskell, where the best practice is to define a new monad 'underneath' your original monad stack, rewrite all your functions signatures to have a type constraint (of your new MonadIO type) and then switch out functions for their mocked equivalent as required by the test. Rspec can do the same switching out on any object or class, without any code required outside the test code. (Although as far as "handle with care" goes, monkeypatching the 'send' method has to score pretty high)

Re: Ruby 2.5.0 Released

#45
FYI: I've collected articles / blog posts about what's new in Ruby 2.5 over at the Ruby Advent Calendar [1]. The list so far includes:

- Standard Gems 2.5.0 - Default Gems, Bundled Gems // by Jan Lelis, Idiosyncratic Ruby

- 10 New Features in Ruby 2.5 // by Junichi Ito, Ruby programmer @ SonicGarden.jp

- 10 More New Features in Ruby 2.5 // by Tom Lord, Software Developer from London

- Performance Improvements in Ruby 2.5 // by Jesus Castello, Ruby Guides

- yield_self in Ruby 2.5 // by Michał Łomnicki

- Improved stacktrace display in Ruby 2.5 // by Michał Łomnicki

- Ruby 2.5 Series // by Amit Choudhary, Mohit Natoo et al @ BigBinary

[1]: https://planetruby.github.io/advent2017

Re: Ruby 2.5.0 Released

#46

When I discovered Ruby 12 years ago, it was an amazing moment. All the features I loved from my previous favorite languages Perl, Smalltalk, and Scheme in one place, but with a much more reasonable syntax, a far more robust standard library, a complete and dead-simple packaging system, and a practical and portable runtime. The fact that it still feels magical, fun, practical, and pragmatic all at the same time while…

I started a new contracting gig a couple of months ago, in Ruby. I had used it briefly years before in another project, but it was so long ago that I had to learn it again basically from scratch.

Although I don't really think the language is anything special (i.e. it's a standard dynamic OO language), what really turns me off Ruby is this dogmatic, almost religious aspect of its community.

Take POODR - it's more or less the community bible. If it's not written in POODR - don't do it. If it is - do it that way or else. It's POODR's way or the highway.

According to more experienced Rubyists more than 80% of the Ruby community use Rails. Rails is so widely spread that its development even fundamentally affects Ruby's roadmap.

Now irregardless of what you think about POODR or OO or dynamic types or whatever, a homogenous echo chamber filled with people chanting the same things over and over again is not a good thing.

As a counter example, take Javascript. Yes, it has its warts; its equality table is a joke. Ruby is a better thought out and implemented language in almost every aspect (although I do like Javascript's minimalism better, but that's a matter of taste I guess.) However, Javascript's community is as diverse, vibrant and experiment-friendly as it gets - there are the OO diehards, but there's also React, fantasy-land, macros, monads. People are trying out new things constantly.

Now I know you have monads in Ruby too or flow-like gradual typing libraries or rewrites of Clojure's spec. But at least where I work (and I work with some very experienced Ruby people) those libraries and the ideas they embody would never ever be considered as serious alternatives for anything. POODR or else.

Re: Ruby 2.5.0 Released

#47
post #9

Test Driven Development (TDD) gets a huge improvement with the new coverage capabilities for methods and branches. Thanks Ruby team!

I'm surprised by this comment. Having done TDD for many years now I've only ever felt the need for coverage tools on code that wasn't initially TDDed. If you do proper TDD your coverage is always pretty damn close to 100% and you are already well aware of where it isn't because you struggled TDDing in the first place.

That's true until you decide to delete tests/code that is no longer in use. Then it becomes much more difficult to track down dead code paths

Re: Ruby 2.5.0 Released

#48
post #46

When I discovered Ruby 12 years ago, it was an amazing moment. All the features I loved from my previous favorite languages Perl, Smalltalk, and Scheme in one place, but with a much more reasonable syntax, a far more robust standard library, a complete and dead-simple packaging system, and a practical and portable runtime. The fact that it still feels magical, fun, practical, and pragmatic all at the same time while…

I started a new contracting gig a couple of months ago, in Ruby. I had used it briefly years before in another project, but it was so long ago that I had to learn it again basically from scratch. Although I don't really think the language is anything special (i.e. it's a standard dynamic OO language), what really turns me off Ruby is this dogmatic, almost religious aspect of its community. Take POODR - it's more or l…

What is POODR?

Re: Ruby 2.5.0 Released

#49
post #46

When I discovered Ruby 12 years ago, it was an amazing moment. All the features I loved from my previous favorite languages Perl, Smalltalk, and Scheme in one place, but with a much more reasonable syntax, a far more robust standard library, a complete and dead-simple packaging system, and a practical and portable runtime. The fact that it still feels magical, fun, practical, and pragmatic all at the same time while…

I started a new contracting gig a couple of months ago, in Ruby. I had used it briefly years before in another project, but it was so long ago that I had to learn it again basically from scratch. Although I don't really think the language is anything special (i.e. it's a standard dynamic OO language), what really turns me off Ruby is this dogmatic, almost religious aspect of its community. Take POODR - it's more or l…

As a counterpoint, I have been writing Ruby as a primary language for about five years, both as an employee and a consultant. I am consistently solicited for advice on both code and architecture in Ruby by colleagues to positive results (and I do the same, don't get me wrong--that's how collegiate relationships should work). And, yet, I had to google what POODR was. I've also never used Rails; on this Christmas morning I'm noodling on a Grape API that uses grape-swagger for API documentation.

I have never seen any resistance to experiments or diversity in the space. There's a happy path, but there's plenty of room, and welcoming communities, outside of it.

(I like JavaScript, too, for much the same reasons you do.)

Re: Ruby 2.5.0 Released

#50
post #48
post #46

Earlier quoted context omitted.

I started a new contracting gig a couple of months ago, in Ruby. I had used it briefly years before in another project, but it was so long ago that I had to learn it again basically from scratch. Although I don't really think the language is anything special (i.e. it's a standard dynamic OO language), what really turns me off Ruby is this dogmatic, almost religious aspect of its community. Take POODR - it's more or l…

What is POODR?

Practical Object-Oriented Design in Ruby by Sandi Metz.

http://www.poodr.com/

Post reply on HN