[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]

What's your opinion on ruby on rails or ruby in general?

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: 58
Thread images: 12

What's your opinion on ruby on rails or ruby in general?
>>
File: ruby is ok.jpg (98KB, 1017x1089px) Image search: [Google]
ruby is ok.jpg
98KB, 1017x1089px
I have it installed but can't think of any uses for it other than a crappy 4chan clone
>>
>>55974683
I'm looking to create a crappy 4chan clone, but is ruby really the answer?
I just don't want to use PHP, but using something like RoR seems like overkill.
>>
>>55974747
the original idea I had before that was a yotsuba *booru combination, but I wasn't getting much of it done, other than having images set for the OP, comments to those images, and a weird login system that only kept getting more convoluted when I introduced encryption to the passwords
>>
>>55974656
poop from a butt for programmers who believe they can avoid having to think up solutions to their problems
>>
Ruby is dope. Rails is cool as well although it can be a bit of a clusterfuck because there so much going on 'behind-the-scenes'...very much like javascript. You find yourself asking why things work a certain way and NO ONE can tell you and its not in the docs. Rails motto is 'it just werks :^)'

Whihc is partly true. It's very easy to prototype with rails and on top of that its one of the easiest languages to write in, and definitely the easiest to read - and thus, to debug.
>>
>>55975164
>using the smiley with a carat nose
>>
File: pogo.jpg (12KB, 182x277px) Image search: [Google]
pogo.jpg
12KB, 182x277px
it has become the thing which it stood against
>>
Like Python/Django but less capable
>>
File: Rails.jpg (79KB, 720x479px) Image search: [Google]
Rails.jpg
79KB, 720x479px
>>55974656

Ruby is amazing, Rails is ambivalent.


Rails is the reason why many people look down on the Rubyists. But Rails is also the reason why Ruby became so popular in the first place - which is a good thing. Rails is very influential, many frameworks were at least inspired by it. On the other hand there are many very cool Ruby frameworks that don't get the attention they deserve because oftentimes people think "Ruby = Rails".

The Ruby community is great and friendly, the Rails community is.. well, there are also nice guys but more unfriendly people than in the Ruby community.

Now to the technical aspects:
Ruby is a langauge that can be used in an "explicit way" - then it looks pretty much like Python. But you can also do a lot of "magical" with stuff like monkey patching, continuations, metaprogramming and creating DSLs..

Well basically you can create "your own language" and build objects which can be manipulated at runtime in many different ways, i.e. add methods/constants at runtime or let them delegate methods to other objects or just ignore exceptions (NEVER rescue the exception class!!).. This is what people often refer to as "Ruby Magic".

Rails is the framework which makes the heaviest use of this magic. Actually Rails is a very huge application (Rails is over 40,000 LOC), but the code is very well hidden. It seems like a tiny framework because when you put Rails to action you have a clear structure..
DRY ("Don't repeat yourself") means you have one (and only one) place where everything belongs. This is usefull especially for beginners that don't have a clear understanding of what parts you need and where to put them.

But some people (especially if they are experienced) find is annyoying that Rails hides a lot of logic from you. You have to learn some words and have no idea what actually happens and why - unless you dig really deep in the Rails code base.
Some people can live with that, others don't..
>>
>>55974656
Seasoned Rails developer here, made a lot of money on it, and created a lot of VERY complex applications with it. I personally enjoy it, and even more now that rails 5 with --api mode and native websockets is released. Also ActiveRecord is a godsend
>>
>>55975926
>The Ruby community is great and friendly, the Rails community is.. well, there are also nice guys but more unfriendly people than in the Ruby community.
You say it like there is a Ruby community outside of Rails. Maybe there are some homosexual transgender parties, but nothing related to coding.
>>
>>55975996

Also, don't use it for simple projects, Rails is really for big, hardcore applications, where you have TONS of models nesting into each other, with many to many relationships, recurring jobs, document generation, hardcore file management, user management, etc.

To give you an example of a project we worked on, is an entire intranet for a chain of restaurants in France, we made their entire stock/supply/employees management using Ruby on Rails.
>>
>>55974656
It's pretty good. But I prefer Scala's Play Framework.

Maybe I even prefer Django, though certainly not because of Python (Ruby is nicer IMO).
>>
>>55974747
Ruby might be fine, but Rails is possibly not the answer.

A bit more Sinatra-like framework and perhaps some JS to do fancier loading of images or whatever might be better. Not that it needs to be *entirely* as minimalist as Sinatra proper...
>>
>>55976053

Last time I checked there was also a Sinatra community and so on.. But Rails people are the majority, I'll give you that.

>>55976160

>Not that it needs to be *entirely* as minimalist as Sinatra

Minimalist? Sinatra is 1476 LOC, there are frameworks like Cuba that have only 152 LOC.


>>55975926

Some words about Ruby:
Frankly it's the geratest langauge I've programmed with so far..


When you start learning it, it looks like the simplest language ever:
a = "World"
print "Hello #{a}"

[1, 2, 3] & [2, 3, 4] - [2] # returns [3]
print "faggot".upcase.reverse # TOGGAF


You also have a lot of super powerfull methods:
a, b = [1,2,3,4,5,6].partition{ |i| i.even? and i < 5} # a = [2, 4]; b = [1, 3, 5, 6]

Array(1..5) * "/" # "1/2/3/4/5"

"nice b%s m%s, I r%s %s/%s" % ("8" * 5).split(//) # "nice b8 m8, I r8 8/8"



But the coolest thing is that you can "imitate" a lot of languages, since you have many different expressions for the same thing..

p %w/Somehow 'Perlish', """readable""" syntax../.grep /Perl/

"abaaba" . split(//) . sort . group_by{|i|i} . map{|k,v| [k,v.length]} # [["a", 4], ["b", 2]], somehow 'haskell like' ?


And these are the BASICS, there's much more in the langauge..
>>
>>55976241
meanwhile it takes 2 fucking years to run that pretty code
>>
>>55976241

Sorry, just realized you can write two of them even shorter.. Wiht Ruby, refactoring is always fun..

a, b = (1..6).partition{|i| i.even? && i<5}

"abaaba"
. split(//)
. group_by {|i| i}
. map {|k,v| [k,v.size]}
>>
>>55976334

That's always the price you pay for a dynamic language, yes.

But it's often faster than python and it's going to be even faster (the goal of Ruby 3 is to be 3 times as fast as Ruby 2).
>https://benchmarksgame.alioth.debian.org/u64q/ruby.html


Also you can simply include C or C++ code for "heavy computation":
require 'inline'

class InlineTest
inline do |builder|
builder.include '<math.h>'
builder.c '
int inline_pow(int a, int n) {
return pow(a, n);
}'
builder.c '
long inline_factorial(int max) {
int i=max, result=1;
while (i >= 2) { result *= i--; }
return result;
}'
builder.c '
int inline_fibonacci(int n) {
int a = 1, b = 1, c, i;
if (n == 0) {
return 0;
}
for (i = 3; i <= n; i++) {
c = a + b;
a = b;
b = c;
}
return b;
}'
end
end

puts InlineTest.new.inline_factorial(5)
puts InlineTest.new.inline_fibonacci(9)
puts InlineTest.new.inline_pow(2, 10)
>>
Magnificient language hindered by an absolutely awful interpreter
>>
>>55976431
Didnt know that, looks nice.
But its probably not gonna be as fast as "real" C or C++, right?
>>
>>55976334

Truffle+Graal is going to really disrupt the performance question.
>>
>>55976478

I've benchmarked encryption libraries in Ruby at similar speeds to using OpenSSL CLI. When you embed C, it's literally loading C.
>>
>>55976061
If you already know Rails, there is no problem with using it for simpe stuff too.

Ruby is orders of magnitude better than any language that you can actually get a job with, but its days are numbered due to dynamic typing. There's nowhere left for it to evolve, and even its creator knows this (he created a new language based on streams or something random).

>tfw you can't just use Haskell or Lisp
>>
>>55976565
>its days are numbered due to dynamic typing
Javascript must be on its way out too then, eh?
>>
>>55976605
I don't know, I'm not that familiar with Javascript. It may be popular, but is it still evolving?
>>
>>55976528

Depends on how you do it..

There are many ways to include C or C++ stuff in ruby, i.e. Inline, Rice, Swig, mkmf (for generating makefiles) or the the foreign function interface (FFI)..

"Inline" might not even be the fastest option, but I like that you can just put pure C code in it.

If you already have C libraries you want to use (in differernt files) other options might be the better option..
>>
>>55976621
it's evolving as fast as a language can when it has the weight of the entire internet on its shoulders.

still not sure what your point is on dynamic typing. 4/5 of the top web languages are dynamic and Javascript especially is definitely evolving and definitely not going away anytime soon.
>>
>>55976752
Well, Ruby is more mature than Javascript. If something stops changing and improving then it leaves the option for something better to take its place. This process is inhibited by momentum, but obviously Ruby has nothing like Javascript's momentum.
>>
Only tried grails, and that alone made me puke. Can only imagine what clusterfucks ruby on rails is
>>
>>55976769

But senpai, Grails is A Java framework that uses "Groovy" not "Ruby"..
>>
File: 1461823591592.jpg (177KB, 600x740px) Image search: [Google]
1461823591592.jpg
177KB, 600x740px
Most frameworks have stolen the core ideologies behind what made RoR great. As a result, RoR seems quite outdated.

Ruby is a pretty tidy language, but rails is holding the language together. Without RoR ruby would would join the delphi/ lisp/ ASP garbage pile.Because of this, don't use RoR for anything serious. Ruby Gems are shit compared to composer packages or NPM libraries.

If you're going to use a hipster language, use a modern language with all the bells and whistles like golang or swift.
>>
guys what about Django? next to PHP/Laravel, RoR and Node.js, it's pretty good, right?
>>
>>55976518

But how mature is JRuby?

The problem is that you can't just run Ruby 2 code in JRuby and many Ruby libraries are still missing.

If only a large company would push JRuby to make it 100% compatible with Ruby - that would be great.

>>55976565

>Ruby is orders of magnitude better than any language that you can actually get a job with

This.
Ruby isn't Lisp, but it's as close as you can get without using a real Lisp.

>There's nowhere left for it to evolve

What are you talking about? There's a big fuzz about Ruby 3, it's still uncertain what it will include. Too bad it will probably take two more years..

But it will be interesting to see wether Matsu tries to build an advanced concurrency system or if he just decides that Elixir/Phoenix is already perfect for that job and calls it a day.

Personally I could totally live with that, Ruby doesn't have to clone Elixir. On the other hand a faster Ruby with decent concurrency would be also amazing.


Ruby got much faster with every version, but it's still nowhere as fast as it could be.

You can do tail recursion..

code = <<-CODE
class Factorial
def self.fact_helper(n, res)
n == 1 ? res : fact_helper(n - 1, n * res)
end

def self.fact(n)
fact_helper(n, 1)
end
end
CODE

options = {
tailcall_optimization: true,
trace_instruction: false,
}

RubyVM::InstructionSequence.new(code, nil, nil, nil, options).eval


..but it's not used by default.

Also there's a lot of stuff that could be done to optimize Ruby, but it's not easy considering the complexity of the language..
>>
>>55977000

> use a modern language with all the bells and whistles like golang or swift

Golang and Swift are both boring langauges. They have nothing new and look nice because they copy huge parts of Ruby's syntax.

Also which frameworks from Go or Swift could compete against RoR? None.


So if you want to learn something fancy, go with Rust or Elixir which have amazing new concepts.


>>55977094

I haven't used it, but from what I've heard it's the Python version of Rails. Which means if you know one of them you can easily pick up the other because the concepts are similar (Django being a little bit more explicit, Rails being a little bit more "magical").
>>
>>55977158
>But it will be interesting to see wether Matsu tries to build an advanced concurrency system or if he just decides that Elixir/Phoenix is already perfect for that job and calls it a day.

Sure, he could decide to add concurrency. Or optional typing annotations. In either case it will be bolted on and probably suffer a similar fate as Python 3. Except that Python 3 was made to fix all the bolted-on, inconsistent shit that already existed in the language.
>>
>>55977320

Matsu always said it's important to keep backwards compatibility in Ruby. But who knows, maybe he'll do the absolute madman and creates a shiny new Ruby from the scratch?


As for Rails, the good thing is you can just install both versions and have them specify which version in their environment file, which is not a bad way to deal with different versions.
>>
>>55977581
not if rvm gets broken too :^)
>>
File: 1468164250469.jpg (10KB, 229x240px) Image search: [Google]
1468164250469.jpg
10KB, 229x240px
i hope she gets run over by the train...
>>
>>55974656
>What's your opinion on ruby on rails
Crap, like all web stuff.
>or ruby in general?
Usable as macro/scripting language for automating task and game events, like every dynamic anything language.
>>
Ruby is one of the best languages around if you use it for the right things, i.e. not performance critical shit.

Rails on the other hand is the cancer killing Ruby, filled with hipster and SJWs, and it's a mess to deal with in general, not composable at all and lives in its own little bubble of cancer.
>>
I hope netbeans reimplements ruby and rails. I'm not crazy about having to use an older plugin for compatibility.
>>
>>55980050

Are you serisous?

There are such nice vim plugins for ruby as well as rails, it would be a shame not to use them..
>>
Anyone know where I can find images of Ruby getting railed?
>>
File: idol framework.jpg (75KB, 700x840px) Image search: [Google]
idol framework.jpg
75KB, 700x840px
>>55981317
I was using netbeans with the ruby plugin on windows, I forgot to install ruby on my linux partition. I'll go ahead and look into that
>>
File: RUBY.jpg (498KB, 938x1080px) Image search: [Google]
RUBY.jpg
498KB, 938x1080px
>>55981429
B-But anon.. Ruby is a pure programming language!!
>>
>>55981525

You can use gvim for windows with the same plugins, works perfectly fine.

No excusese, anon!

(BTW why did you delete your other comment??)

>>55981429

Just type:

rails new xxx
rails g controller rubys_master
rails g view ruby_naked
>>
File: Kurosawa.Ruby.full.2015076.jpg (432KB, 1200x1200px) Image search: [Google]
Kurosawa.Ruby.full.2015076.jpg
432KB, 1200x1200px
>>55981666
Not the same anon as
>>55981525 but I fugged up. I'm sorry /g/. Please forgive.
>>
>>55981666
that wasn't me

I forgot, I'm in a slump right now and can't think of any projects I can use ruby with
>>
>>55974656
I'm grateful it exists because it BTFO'd the PHPturds. It really showed everyone how the backbone of an application should be structured like.

But today it's just past its prime. Frameworks that learned from rails have surpassed it. Ruby is not as awful as PHP or JS, but we have better alternatives like Python or C#.
>>
>>55981429
kys
>>
>>55981852
I wonder if the Rails devs are picking up on what the rest of the web development frameworks are doing
>>
>>55981852

>Ruby is not as awful as PHP or JS, but we have better alternatives like Python

But you can write python-like in Ruby!
There is more than one way to do it.. ;)

# Python
def test(a, b):
for i in range(a, b):
for j in (a+1, b+1):
print([i,j])

test(1, 3)


# Ruby
def test(a, b)
for i in (a..b)
for j in (a+1..b+1)
print ([i,j])

end; end; end

test(1, 3)
>>
>>55981852
>but we have better alternatives like Python
>[4kHDreadykek]
>>
>>55975557
Django is a deprecated shit.
Python is dead just because it exists.
>>
>>55979118
>>55981429
benoit yourself
>>
File: ruby.jpg (62KB, 691x825px) Image search: [Google]
ruby.jpg
62KB, 691x825px
anyone programming anything cool in ruby?
>>
File: 1432747484276.png (116KB, 957x482px) Image search: [Google]
1432747484276.png
116KB, 957x482px
meme.
Thread posts: 58
Thread images: 12


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