Live data from Hacker News

An Ode to Ruby

blog.yboulkaid.com

31–40 of 204 posts

Re: An Ode to Ruby

#31
A coworker of mine is leaving for a Ruby job, which caught me off guard, so I've had Ruby on the brain a bit lately. I was a big fan of Ruby for a few years back in 2004-2006 or thereabouts. Rails was the new hot thing, but I wasn't into web dev so I didn't pay all that much attention to it. I remember blindsiding my networking professor by using Ruby for an assignment when he expected but failed to specify Java or C ... he was a good sport, thankfully.

I strayed from the CS path into econometrics and then data science, so Ruby just wasn't a good fit for basically anything I do. That seems to remain the case, unfortunately, though I like it on the language level more than my bread and butter Python. Oh well.

Re: An Ode to Ruby

#32
post #28
post #12

Earlier quoted context omitted.

"I still can't think of a better language for scripting." Python I find equally if not more simple. Would you agree?

Nope. Can't stand that Python uses built-in functions for basic things like list, map, fold, etc... instead of methods on base classes. Here's a super basic example. Add one to an array [1,2,3] and print results. Python: print(list(map(lambda x: x + 1, [1,2,3]))) Ruby: print [1,2,3].map {|x| x + 1} So much more readable, easy to write, etc... Ruby keeps it consistent by making pretty much everything an object and you…

print([x + 1 for x in [1,2,3]])

Re: An Ode to Ruby

#33
post #28
post #12

Earlier quoted context omitted.

"I still can't think of a better language for scripting." Python I find equally if not more simple. Would you agree?

Nope. Can't stand that Python uses built-in functions for basic things like list, map, fold, etc... instead of methods on base classes. Here's a super basic example. Add one to an array [1,2,3] and print results. Python: print(list(map(lambda x: x + 1, [1,2,3]))) Ruby: print [1,2,3].map {|x| x + 1} So much more readable, easy to write, etc... Ruby keeps it consistent by making pretty much everything an object and you…

To be fair, you almost never should use the map builtin instead of the pythonic equivalent, list comprehensions.

`print([x + 1 for x in [1, 2, 3])`

I agree that the ruby approach is better in terms of consistency, but most developers will be aware of the conventions python uses.

Re: An Ode to Ruby

#34
I like that the Ruby community has embraced the fact it is no longer cool.

I recently interviewed for a ruby/rails job where the dev team had come from a previous start up that tried to port an existing Rails app to a React/Microservices one with disastrous results. For this job they were relishing coming back to a monolithic Rails app. I hope this trend continues!

Re: An Ode to Ruby

#35
post #9
post #2

A big shoutout to the author to include the Nokogiri installation "experience"... :D Well done!

I have similar problems in Python with OpenCV. It should be so simple, but generally is not (or at least last I tried)

OpenCV has wheels built for all common platforms so it should be fine now. If your platform or python version is too new/old/unsupported then yeah, you can forget about building it and use another platform/python version.

To be honest, it's always this dice roll with most things on pypi. If there are wheels for you, golden. If not, you better hope it's a pure python package or it doesn't pull any outside libs. Things are getting better though with solutions like cibuildwheel.

Re: An Ode to Ruby

#36
post #33
post #28

Earlier quoted context omitted.

Nope. Can't stand that Python uses built-in functions for basic things like list, map, fold, etc... instead of methods on base classes. Here's a super basic example. Add one to an array [1,2,3] and print results. Python: print(list(map(lambda x: x + 1, [1,2,3]))) Ruby: print [1,2,3].map {|x| x + 1} So much more readable, easy to write, etc... Ruby keeps it consistent by making pretty much everything an object and you…

To be fair, you almost never should use the map builtin instead of the pythonic equivalent, list comprehensions. `print([x + 1 for x in [1, 2, 3])` I agree that the ruby approach is better in terms of consistency, but most developers will be aware of the conventions python uses.

Ok, that's a nicer result (obviously I don't write Python lol) but still seems inconsistent to me (putting the function before the array) considering Python is an OO language and most people are going to be writing methods for classes where you call methods with dot. I just remember list comprehensions from Coffee-script and not going to lie, I hate them. It's like reading backwards.

Re: An Ode to Ruby

#37
post #36
post #33

Earlier quoted context omitted.

To be fair, you almost never should use the map builtin instead of the pythonic equivalent, list comprehensions. `print([x + 1 for x in [1, 2, 3])` I agree that the ruby approach is better in terms of consistency, but most developers will be aware of the conventions python uses.

Ok, that's a nicer result (obviously I don't write Python lol) but still seems inconsistent to me (putting the function before the array) considering Python is an OO language and most people are going to be writing methods for classes where you call methods with dot. I just remember list comprehensions from Coffee-script and not going to lie, I hate them. It's like reading backwards.

Python is a multi-paradigm language, of which OO is one paradigm it supports.

Re: An Ode to Ruby

#38
post #33
post #28

Earlier quoted context omitted.

Nope. Can't stand that Python uses built-in functions for basic things like list, map, fold, etc... instead of methods on base classes. Here's a super basic example. Add one to an array [1,2,3] and print results. Python: print(list(map(lambda x: x + 1, [1,2,3]))) Ruby: print [1,2,3].map {|x| x + 1} So much more readable, easy to write, etc... Ruby keeps it consistent by making pretty much everything an object and you…

To be fair, you almost never should use the map builtin instead of the pythonic equivalent, list comprehensions. `print([x + 1 for x in [1, 2, 3])` I agree that the ruby approach is better in terms of consistency, but most developers will be aware of the conventions python uses.

You're splitting hairs about what the op said. How about len() ?

Re: An Ode to Ruby

#39
post #12

Earlier quoted context omitted.

"I still can't think of a better language for scripting." Python I find equally if not more simple. Would you agree?

I am not a Python or a Ruby dev. The Ruby devs I know are overall great devs The Python people are second-rate. Ruby produced tons of good software as a framework base besides Rails. Python? Eh.

I'm a Python dev. The python devs I know are average on average. I have never met a Ruby dev. But I'm sure I'm first rate!

Re: An Ode to Ruby

#40
I think Ruby might be the antithesis to Java.

For all that I despise Java's ridiculous boiler plate, I always know exactly what's going on.

In Ruby, I feel like there are unknowns in every file.

I hate Java, but Ruby makes me miss Java.

Post reply on HN