6 Replies - 2554 Views - Last Post: 02 February 2014 - 04:12 PM Rate Topic: -----

#1 Lemur  Icon User is offline

  • Pragmatism over Dogma
  • member icon


Reputation: 1361
  • View blog
  • Posts: 3,433
  • Joined: 28-November 09

[AMA] Working with Ruby

Post icon  Posted 01 February 2014 - 10:08 AM

Much akin to the Reddit Ask me Anything, this thread is for asking questions about Ruby in general. Why did we choose it, what's it like working professionally with it, you ask it and we'll answer it. This is a month long thread.

To introduce our leaders:
http://www.dreaminco...-forum-leaders/

Some extended background on myself: I work Rails and Javascript professionally for a large corporation in the KC area.

So what do you want to know about Ruby?

Is This A Good Question/Topic? 1
  • +

Replies To: [AMA] Working with Ruby

#2 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3459
  • View blog
  • Posts: 11,717
  • Joined: 12-December 12

Re: [AMA] Working with Ruby

Posted 02 February 2014 - 08:46 AM

Why Ruby? What are its sexy features?

What does it do well that is handled poorly in other languages?
Was This Post Helpful? 0
  • +
  • -

#3 blankwavercade  Icon User is offline

  • D.I.C Head

Reputation: 30
  • View blog
  • Posts: 115
  • Joined: 13-December 11

Re: [AMA] Working with Ruby

Posted 02 February 2014 - 10:40 AM

Why does it seem like everyone is running away from rails and moving to frameworks like sinatra? Is it mainly to seperate the api from the front end? Im assuming it is for that reason and being able to incorporate from end frameworks much easier such as angularjs and ember.

This post has been edited by blankwavercade: 02 February 2014 - 10:40 AM

Was This Post Helpful? 0
  • +
  • -

#4 Lemur  Icon User is offline

  • Pragmatism over Dogma
  • member icon


Reputation: 1361
  • View blog
  • Posts: 3,433
  • Joined: 28-November 09

Re: [AMA] Working with Ruby

Posted 02 February 2014 - 11:10 AM

View Postandrewsw, on 02 February 2014 - 09:46 AM, said:

Why Ruby? What are its sexy features?

What does it do well that is handled poorly in other languages?


It was literally made to make programmers happy, and I tend to agree that it does. Probably the most useful features of the entire language are the Enumerable library and the use of blocks / anonymous functions to transform them.

Ruby, to me, is like all the good parts of Perl without the cryptic names, just enough lisp to be dangerous, and anonymous functions that won't make you cry like in Python.

Python is too rigid and stiff, with anonymous functions and various other functional aspects being very annoying to use. Ruby allows you to be free, to have fluid syntax, and supports a ton of functional power and anonymous functions. Sure, you can do it in Python but not nearly as cleanly.

Languages like C# and Java just have too much boilerplating and cruft throughout. When speed isn't a consideration I tend to avoid them at all costs. Ruby lets me do the same thing in normally 10% of the time and 10% of the lines of code. Note that it's also normally ~10x slower. The best solution to this I found have been Elixer or JRuby.


View Postblankwavercade, on 02 February 2014 - 11:40 AM, said:

Why does it seem like everyone is running away from rails and moving to frameworks like sinatra? Is it mainly to seperate the api from the front end? Im assuming it is for that reason and being able to incorporate from end frameworks much easier such as angularjs and ember.



Rails is no doubt a heavyweight in most cases, but with the trend towards Service Oriented Architectures both are definitely still being used. I wouldn't say that front end framework incorporation is necessarily difficult in either case, that's another matter entirely that I'll cover in a second.

In terms of Rails vs Sinatra, some people just don't need the huge feature set of Rails. It's about the same as NginX vs Apache, Apache will normally be better for dynamic pages with heavier loads and NginX will normally be better with static pages with heavy loads

On terms of frontend frameworks, it's an organization methodology. When you start doing more than trivial jQuery it may be wise to consider it, because it's a nightmare to migrate once you make a mess out of it.

The two are mutually exclusive though, you can use one with any framework.
Was This Post Helpful? 2
  • +
  • -

#5 blankwavercade  Icon User is offline

  • D.I.C Head

Reputation: 30
  • View blog
  • Posts: 115
  • Joined: 13-December 11

Re: [AMA] Working with Ruby

Posted 02 February 2014 - 11:27 AM

Thanks for the reply! I've been dabbling with ruby web frameworks lately and do enjoy using sinatra specifically for the ease of use. Although rails is pretty appealing for learning it. With scaffolding and such that is.
Was This Post Helpful? 0
  • +
  • -

#6 Lemur  Icon User is offline

  • Pragmatism over Dogma
  • member icon


Reputation: 1361
  • View blog
  • Posts: 3,433
  • Joined: 28-November 09

Re: [AMA] Working with Ruby

Posted 02 February 2014 - 11:40 AM

View Postblankwavercade, on 02 February 2014 - 12:27 PM, said:

Thanks for the reply! I've been dabbling with ruby web frameworks lately and do enjoy using sinatra specifically for the ease of use. Although rails is pretty appealing for learning it. With scaffolding and such that is.


Amusingly most pros avoid scaffolding and instead tend to write things out or make their own scaffold generators. Scaffolding is great for a quick one-off, but for serious development you really need to write your own scaffold generators.
Was This Post Helpful? 0
  • +
  • -

#7 xclite  Icon User is online

  • LIKE A BOSS
  • member icon


Reputation: 905
  • View blog
  • Posts: 3,167
  • Joined: 12-May 09

Re: [AMA] Working with Ruby

Posted 02 February 2014 - 04:12 PM

View Postblankwavercade, on 02 February 2014 - 12:40 PM, said:

Why does it seem like everyone is running away from rails and moving to frameworks like sinatra? Is it mainly to seperate the api from the front end? Im assuming it is for that reason and being able to incorporate from end frameworks much easier such as angularjs and ember.

Just to add to Lemur's good points:

Rails is still in heavy use. another way to look at it is that rails is "cursed" with actually being mainstream - some people just liked the newest thing, which is reflected in the push for all these relatively new javascript frameworks. I'm sure those will get the job done as well.

Where I work, we have a framework that generates internal site frameworks, and the de-facto internal framework is rails (though interestingly, they're moving to JRuby on Rails recently). Investing in rails will still generate great returns.

I prefer Sinatra because it is way simpler - convention over configuration is really only good for me when I know the convention, and rails just does Too Much ™.

View Postandrewsw, on 02 February 2014 - 10:46 AM, said:

Why Ruby? What are its sexy features?

What does it do well that is handled poorly in other languages?

I think a great example of Ruby doing things well is the Enumerable module - being able to each or map anything and pass in a block of code is just awesome. Obviously some languages do similar things, but in Ruby it's trivial to set up a class and make it work in the same paradigm.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1