[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Is ruby worth learning?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 63
Thread images: 3

File: ruby.png (89KB, 959x833px) Image search: [Google]
ruby.png
89KB, 959x833px
Is ruby worth learning?
>>
>>56097577
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?
>>
>>56097577

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?
>>
>>56097577
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 >>56097779. 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.
>>
>>56097779
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?
>>
>>56097915
gr8 b8 m8 I r8 8/8
>>
>>56097577
If you're new to webdev then No
Learn Elixir instead.
>>
>>56097822
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
>>
>>56097915
Ruby is superior for scripting and text processing, but "all ways" will not be true until Ruby gets a worthwhile equivalent to scipy.
>>
>>56097919
flexible syntax, blocks, method_missing and instance_eval is what makes ruby great for dsls
>>
>>56097919
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.

>>56097915

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.

>>56097957

CoffeeScript is a fine language. Rails is terrible for other reasons. Namely that it's a big, bloated mess.
>>
>>56097976
If you're doing text processing in anything but Perl, you're doing it wrong.
>>
>>56098086
THIS
>>
>>56098086
Ruby is a better Perl than Perl is.
>>
>>56097919
Io is even better for metaprogramming and DSLs. Too bad it lost the race against Ruby.
>>
>>56098078
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.
>>
File: 1311949083856.jpg (55KB, 486x409px) Image search: [Google]
1311949083856.jpg
55KB, 486x409px
>>56098109
>Ruby is a better Perl than Perl is.

Gr8 b8 m8
>>
>>56098086
/thread
>>
>>56097957
>>56098078
why is coffeescript so disliked/bad?
>>
>>56098163
>ruby is far more popular

Where do you live?
>>
>>56098269
Retarded syntax. Deprecated by TypeScript.
>>
go is better scripting language
only girls and fags use ruby
>>
>>56098269
It is a really thin compiler over JavaScript. Basically just a syntax-to-syntax layer without any semantics improvement or optimization.
>>
>>56098329
Go is literally worse than ALGOL https://cowlark.com/2009-11-15-go/
>>
>>56098109

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
>>
>>56098824

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.
>>
>>56098893
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?
>>
>>56098918

>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.
>>
>>56097650
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.
>>
>>56099000

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
https://www.youtube.com/watch?v=EB8j-i5x6Hc
>>
>>56099206

Hooray for Ruby3x3 !!

Too bad it will take 3 or 4 more years..
>>
>>56099074
>github
>>
>>56098078

> 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.
>>
>>56097577
Of course, it's a very decent language
>>
>>56097957
CoffeScript is fine
>>
>>56099059
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.
>>
>>56098918
Me too, I hope for Lily to succeed
>>
>>56099785
are you jesse :D
>>
>>56097779
>>56097919
>>56098149
What is a DSL?
>>
>>56097577
To follow up on OP's question, is there any point to learning it if I don't care about web programming?
>>
>>56101381
no, better learn javascript then
>>
>>56101381
Amazon and Github are two examples of companies that use ruby extensively for infrastructure and services in addition to just web shit.
>>
>>56101381
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

>>56101289
Domain Specific Language
>>
>>56098149
Io is still a really fun language though
>>
>>56101576

Note to self: Apply for a job at Amazon.
>>
>>56099461
Lisp is even more fun.
>>
>>56101381
>>56101576
Also puppet and chef are well known and written in ruby and have nothing to do with web/frontend.
>>
File: dUz3Bbp.jpg (323KB, 1365x1024px) Image search: [Google]
dUz3Bbp.jpg
323KB, 1365x1024px
>>56101289
Dick suckin' lips.
>>
>>56097892

Exactly. I use Ruby for everything I used to do with perl. Ruby is the real perl6.
>>
>>56098918
I hope this happens but most of the popular options right now are complete dogshit. Especially Go.
>>
>>56104875

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..

>http://www.randomhacks.net/2005/12/03/why-ruby-is-an-acceptable-lisp/
>>
>>56098918
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.
>>
>>56101289
something that allows you to do this (not ruby for this example)
http://scrambledeggsontoast.github.io/2014/09/28/needle-announce/
this
f :: (Int, Int, Int) -> (Int, Int, Int, Int)
f = proc (a,b,c) -> do
d <- (+1) -< a
e <- uncurry div -< (d,c)
f <- negate -< e
g <- (*2) -< b
returnA -< (d,e,f,g)

can be written as
fNeedle :: (Int, Int, Int) -> (Int, Int, Int, Int)
fNeedle = [nd|
}=={(+1)}=\==========================>
\
}===\ \ /============>
\ \ /
}=) \ (==={uncurry div}=/={negate}===>
\
\=={(*2)}========================>
|]
>>
Everything is worth learning if you've got the time to spare
>>
>>56106634
Life is short, anon.
>>
>>56097577
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.
>>
>>56099074
http://rubyonrails.org/conduct/
Thread posts: 63
Thread images: 3


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.