Is ruby worth learning?

Is ruby worth learning?

Other urls found in this thread:

cowlark.com/2009-11-15-go/
youtube.com/watch?v=EB8j-i5x6Hc
randomhacks.net/2005/12/03/why-ruby-is-an-acceptable-lisp/
scrambledeggsontoast.github.io/2014/09/28/needle-announce/
rubyonrails.org/conduct/
twitter.com/SFWRedditVideos

It's a decent language, just stay away from the SJWs that dwell in the community. What do you want to do with it by the way?

Do you want to work in web development and use Ruby on Rails?

Do you want to write DSLs?

If you answered no to both of those questions, then don't bother to learn ruby.

I just started learning rails today as my first web framework, am I about to get fucked?

I've been using ruby for years for web scraping and text processing. It's basically perl with the option to use better syntax (as you can write really terse and confusing ruby, too).

Rails has been a double-edge sword for Ruby. On one hand, it has infested the community with SJW code artisan webdevs, leading to incorrect impressions like . On the other hand, it's probably the only reason that the language is still developed today, and the massive speed boosts between 1.8, 1.9 and 2.0

ruby is superior to python in all ways. if you need a scripting language, use ruby.

What makes Ruby good for DSLs? Not OP, just a guy interested in languages in general who hasn't looked into Ruby much yet. How does it compare to something like Racket for creating DSLs?

gr8 b8 m8 I r8 8/8

If you're new to webdev then No
Learn Elixir instead.

rails is great for making CRUD apps. the most unfortunate thing about rails is that it defaults to coffeescript, but you can easily rip that right out

Ruby is superior for scripting and text processing, but "all ways" will not be true until Ruby gets a worthwhile equivalent to scipy.

flexible syntax, blocks, method_missing and instance_eval is what makes ruby great for dsls

Ruby has first-class regular expressions and great text processing libraries.

It's a fun language to use, but you'll find that outside of a small number of cases, the majority of people won't work with it, preferring Python for areas where Ruby is worth using. If you plan on doing a number of projects on your own, Ruby may be worth using over Python simply because it's more enjoyable.

Python has one advantage: users. If you want someone to work on a project with you, you'll have a much easier time with Python than with Ruby. If you tell someone you're doing a project in Ruby, people will ask why. Most of them don't know Ruby, so the answer isn't as blatantly obvious as why someone did it in Python. Even among the people you find who do know Ruby, some only know Rails. I did not think this was possible, but apparently there exist people who know Rails, but barely have any grasp over the language of Ruby itself.

CoffeeScript is a fine language. Rails is terrible for other reasons. Namely that it's a big, bloated mess.

If you're doing text processing in anything but Perl, you're doing it wrong.

THIS

Ruby is a better Perl than Perl is.

Io is even better for metaprogramming and DSLs. Too bad it lost the race against Ruby.

in reality ruby is far more popular than python. there are 120k ruby gems, but only 80k python packages. all the people who were taught python in cs 101 and never did anything since don't really count.

>Ruby is a better Perl than Perl is.

Gr8 b8 m8

/thread

why is coffeescript so disliked/bad?

>ruby is far more popular

Where do you live?

Retarded syntax. Deprecated by TypeScript.

go is better scripting language
only girls and fags use ruby

It is a really thin compiler over JavaScript. Basically just a syntax-to-syntax layer without any semantics improvement or optimization.

Go is literally worse than ALGOL cowlark.com/2009-11-15-go/

This. Ruby has is strongly influenced by Perl, only with a much nicer syntax IMHO..

For example I prefer that the data comes before the manipulation, like functional languages do it:

#!/usr/bin/env perl
my %out;
grep !$out{$_}++, qw/z z z z z a q b b b r t a z z z l k f g g g/;
p %out;

#!/usr/bin/env ruby
out = Hash.new(0)
%w/z z z z z a q b b b r t a z z z l k f g g g/.grep(//){|i| out[i] +=1}
p out

The "Hash.new(0)" is a little bit ugly, if we don't need 0 as default value we could simply use "out = {}".

Even though I think that "{|i| out[i] +=1}" is easier to understand than "!$out{$_}++"..


It's not that much difference, OK, but nevertheless...

i hope all the old scripting languages will be replaced with a new generation soon. there is no reason a language can't be both convenient, statically typed (even if there are tons of union types inferred), and faster than js. i suppose jruby/pypy is pretty fast but still the current crop has opted to cross where the fence is lowest when it comes to performance.

the code is just drunken overall. why use grep instead of map? is the exclamation actually necessary in the perl version to avoid a type error or whatever?

>convenient
>statically typed (even if there are tons of union types inferred)
>faster than js

You might want to look into D, maybe?

Nevertheless, when it comes to scripting languages high-end performance is not that important and "explicit statically typing" is often not a good choice.

Elaborate on these SJWs in the community

Ruby is taking scripting languages torward the direction of being something like Clojure and Elixir. Ruby is very strong on the concept of objects and making classes unimportant because most everything in Ruby is an immutable object that is accessed by reference. Variables dont hold values in Ruby. Because Ruby uses duck typing its not constrained to class types, and so objects live very much on their own and are their own types. Even classes themselves can be instantiated as objects in order to give a class static method functionality. You almost never use a for or while loop in Ruby, every kind of container object as iterating methods built in. Its very rare to change a value of an object or container in place, when you do the method usually has a '!' bang appended to the name to warn you about it. Everything about Ruby is very consistent, its even more psuedo-code-like than Python. Its a very simple looking language that handles very deep concepts implicitly.

I tried to make both versions similar, to show the influence of perl. For example you don't often use $1 in Ruby, but you could if you want to..


I could also write like this:

[values].each.with_object(Hash.new(0)) { |w, a| a[w] += 1 }


Or like this:

Hash[ [values] . split(//) . sort . group_by{|i| i} . map{|k,v| [k,v.length]}]

Like in perl, there's more than one way to do it..

Matz want to add static typing (type inference) to Ruby
youtube.com/watch?v=EB8j-i5x6Hc

Hooray for Ruby3x3 !!

Too bad it will take 3 or 4 more years..

>github

> If you want someone to work on a project with you, you'll have a much easier time with Python than with Ruby.

This is true.

I always thought of Ruby like a superset of Python:
There are only very few things you can do in Python but not in Ruby, but there are many things you can do in Ruby, but not in Python.

This makes Ruby much more fun IMHO, but if I imagone I had to work with three different guys I don't know..
With python I'm pretty sure I can immediately understand their code. In Ruby you can also write extremely concise and clear, but you can also so "funky stuff" that is sometimes not easy to understand.

Of course, it's a very decent language

CoffeScript is fine

d is a nice language but afaict it doesn't quite have hashes the way scripting languages do. d has an associative array literal but it only allows values of a single type. imo in a scripting language there should be a way to create a data structure/named tuple on the spot without having to first declare a struct or whatever.

Me too, I hope for Lily to succeed

are you jesse :D

What is a DSL?

To follow up on OP's question, is there any point to learning it if I don't care about web programming?

no, better learn javascript then

Amazon and Github are two examples of companies that use ruby extensively for infrastructure and services in addition to just web shit.

There are a couple of good books on how to use Ruby for general purpose scripting:

-Building Awesome Command-Line Applications in Ruby
-Everyday Scripting with Ruby
-Practical Ruby for System Administration
-Eloquent Ruby
-Practical Ruby
-Ruby Cookbook

Domain Specific Language

Io is still a really fun language though

Note to self: Apply for a job at Amazon.

Lisp is even more fun.

Also puppet and chef are well known and written in ruby and have nothing to do with web/frontend.

Dick suckin' lips.

Exactly. I use Ruby for everything I used to do with perl. Ruby is the real perl6.

I hope this happens but most of the popular options right now are complete dogshit. Especially Go.

Yes, I'm working myself through SICP, it's amazing that some things in Ruby get much clearer once you get some Scheme basics..

Ruby is not Scheme, but some concepts are similar..

>randomhacks.net/2005/12/03/why-ruby-is-an-acceptable-lisp/

This. It's been a while since a high-level language went mainstream without corporate support (as opposed to Javascript). Ruby might actually be the latest.

something that allows you to do this (not ruby for this example)
scrambledeggsontoast.github.io/2014/09/28/needle-announce/
this
f :: (Int, Int, Int) -> (Int, Int, Int, Int)
f = proc (a,b,c) -> do
d
\
\=={(*2)}========================>
|]

Everything is worth learning if you've got the time to spare

Life is short, user.

Yes, of course it is. There may perhaps be languages worth learning more, but Ruby is still a solid language and you can also get work with it if that's what you're looking for. That seems enough reason to call it "worth it" to me.

rubyonrails.org/conduct/