Ruby Programming

Why do people mainly use it for Rails? I know its a great framework,
but I see no problem with Ruby in general.

Other urls found in this thread:

rubyforadmins.com/
twitter.com/NSFWRedditImage

Rails is dying, while Ruby seems to holding steady.

Hows it dying? if you dont mind me asking

No jobs vs Ruby

>Why do people mainly use it for Rails?
I don't know, it's the reason Ruby is seen as SJW language instead of a better Python.

At my new job I have to maintain several rails apps. The original devs have long since fucked off and nobody who's affiliated with the company knows ruby.
It's a fucking nightmare to understand anything that's going on. Fuck this "easy to use" bullshit. What's easy to write because it doesn't give a flying fuck about syntax is hard to understand years later when you take something that looks like an array, call delete on it because you need to trim some elements and hey, delete is a fucking great name for a function that removes items from arrays, right? Oh also it's the same function that deletes records from the database if you have an activeRecord collection. Which looks and behaves a lot like an array. Good luck finding your backups.

[/rant]

I don't get why mruby isn't used more, now, that it doesn't support Rails (which is good) and was audited (which Lua isn't which burned lots of people when they tried to sandbox their crap).

Are you complaining about objects? I think you have to look at spaghetti with tons of boilerplate from Java and PHP to complain. At least with Rails applications they are mostly all organized the same way.

Good question. I think Ruby is a pretty nice language. Can't stand Rails and its "magic".

So... Ruby and Python are very similar in feature sets. While both are capable of being used for what the other is primarily used for, they are the way they are today because someone looked at one language and thought, "I want to make something out of this!" So a bunch of academics saw Python and decided to make a bunch of math and science libs, while a bunch of webdevs took a look at Ruby and decided to make Rails and a bunch of supporting libraries. The choice between the two languages primarily boils down to what has a better library for what, but there's still a lot of overlap.

also, Ruby has a much bigger standard library, it offers so many things by default and is SO COMFY, literally not comparable to other languages, it's the best scripting language, by far

Of it's myriad of issues the two most infuriating are its inability to scale well and unnecessary levels of "magic" methods. Other frameworks are eating its lunch.

that dependency tree is fucking cancer
also mvc meme can suck my balls, after years i cant even figure out for what exactly i need that model shit.

In its land of origin, Japan, Ruby is not mostly used for Rails, or even for the web!

I was complaining about the complete lack of type definitions or hinting and the retarded nomenclature of their array methods.

People use Rails for a lot of different stuff:

Metasploit
Hombrew
Chef
Puppet

..and of course anything DevOps/SysAdmin related:
>rubyforadmins.com/


Don't mind him. It's just a forced meme by Python fanboys.
There are still plenty of Rails companies out there and they are doing well.


So you are blaming Rails for the bad code some guys have left you? That's bullshit. You can write bad code or use the wrong abstractions in any language.

>you take something that looks like an array, call delete on it because you need to trim some elements and hey, delete is a fucking great name for a function that removes items from arrays, right?

Sorry that you fucked up and deleted your backups, but agin, this is not Ruby's fault. But yours.

How about:

a = *(1..100)

# check if it's an Array
puts "It's really an Array!" if a.class == Array


# delete element/s at start
a.shift
a.shift(2)
a = a[4..-1]

# delete last element/s
a.pop
a.pop(3)
a = a[0..-15]


# delete element in between
a = a - [6, 10, 12]
a.delete_if {|i| i > 60}

There are some fundamental differences between Ruby and other scripting languages.

Ruby offen open classes, duck typing and a pretty advanced meta programming modell.

This facilitates the usage of domain specific languages. For example if you programm Rails, you really have to learn all the "Rails verbs" instead of pure Ruby (i.e. 3.days.ago). Or in Chef you really write "reciepes" about configuration, instead of simple Ruby syntax.

Some consider this overly playful or can't deal with the power level Ruby gives you. Fair enough, don't use it. For me Ruby is still one of the best langauges ever, because it's so powerful and comfy.

But I do agree that I would only use Ruby in small teams with people I trust or alone. Similar like you wouldn't give a Stealth Bomber to everybody with a driving license. That doesn't mean the bomber can't be usefull sometimes.

I guess many people just don't know about it..

It's a meme. Also Rails inspired most modern MVC frameworks out there, so even if it's "dying", learning and using it will be useful for you.

>So you are blaming Rails for the bad code some guys have left you? That's bullshit. You can write bad code or use the wrong abstractions in any language.

I'm blaming ruby for allowing variables to be used without a declared type.
It's not alone in this sin, but it's the one I've most recently encountered.

I'm also blaming rails for naming the delete method for activerecord collections the same as the delete method for arrays. At the very least, something that affects the database should not have the same name as something that manipulates objects in memory.

>slower than PHP7, Node and Python
I admit the syntax is beautiful but Elixir has the same, its way faster.

my man