Questions about Ruby, dynamic, reflective, general-purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.

learn more… | top users | synonyms

6
votes
5answers
689 views

Ruby isn't a PHP generator, right? [closed]

My boss was looking down on me about learning Ruby because "It's just a PHP generator" which I can't find anything about it being so. Is this the case? I understand that the Rails framework can be ...
6
votes
6answers
3k views

What language to use for prototyping and creating quick scripts? [closed]

Right now, I use Python for my quick scripts and prototypes (e.g. algorithms, my pseudocode is very Python-like as well). The oher languages that I am familiar with include Java, C, x86 Assembly and ...
6
votes
3answers
263 views

Is there any situation in which it would be appropriate to use unless… else?

This construction is considered wrong unless #.. else #.. end This is for the general reason of double-negative confusions. It translates to: if not #.. if not not #.. end We all agree ...
6
votes
7answers
691 views

What should someone learn to become a great web-app builder by 2015 [closed]

My brother just started learning some html/css at school and he loves it. He asked me to give my advice on what languages to learn in order to build great web-apps by the time he leaves school. (2015 ...
6
votes
1answer
2k views

Why did Microsoft abandon IronRuby and IronPython? [closed]

Several years ago, Microsoft announced that Ruby and Python were coming to .net. The projects were called IronRuby and IronPython, respectively. Microsoft said that the projects would be built on ...
6
votes
4answers
664 views

How does one learn to program (and think) the Ruby way? [closed]

Why I Ask this Question: I've just starting to learn Ruby (and by extension IronRuby since I work in the Microsoft world). I picked up IronRuby Unleased to teach me the basic syntax of Ruby, and any ...
6
votes
3answers
734 views

What do you think about gems and eggs? Alternatives? [closed]

I've read recently some criticism (see 1, 2, 3) about the packaging distribution system of two popular programming languages: Ruby gems and Python eggs. The most important argument stated against them ...
6
votes
2answers
537 views

Is it considered bad practice to compile into Javascript as a matter of language preference? [closed]

I understand that compiling into Javascript is sometimes necessary and even in some cases results in a faster application. However I'm wondering if compiling into Javascript, for building web ...
6
votes
2answers
434 views

Ruby Koans: depth and usefulness? [closed]

Several people have suggested Ruby Koans to me over just following a book, and this seems like a much better prospect. As there is no question regarding the entirety of Ruby Koans, what do SO users ...
6
votes
5answers
612 views

Is it okay to define a [] method in ruby's NilClass?

Ruby by default does not include the method [] for NilClass For example, to check if foo["bar"] exists when foo may be nil, I have to do: foo = something_that_may_or_may_not_return_nil if foo ...
6
votes
3answers
128 views

Books to learn to develop Rails Plugins [closed]

I am using Ruby on Rails 3.0.7 and I would like to learn to write "advanced" plugins for the current versione of the framework. In order to do that I would like to buy some books but what I have seen ...
6
votes
2answers
2k views

Why if statements do not introduce scope in ruby 1.9?

if statements do not introduce scope in Ruby 1.9, what is the rationale behind this change from ruby 1.8?
6
votes
2answers
601 views

Ruby on Rails Development Process

We are a small team that is about to start developing a localized version of a successful US web app in Korea, using RoR. Our question is: What process would you recommend we use to go about ...
5
votes
10answers
3k views

Newbie, deciding Python or Erlang [closed]

I'm a Administrator (unix, Linux and some windows apps such as Exchange) by experience and have never worked on any programming language besides C# and scripting on Bash and lately on powershell. I'm ...
5
votes
3answers
316 views

Generalized VS Specialized technical solution; what to take into account?

We recently had a discussion in the office because of conflicting views between developers. One side (side S) argued technical solutions -generally- need to be a specific as possible, while the other ...
5
votes
2answers
204 views

Third-party open-source projects in .NET and Ruby and NIH syndrome

The title might seem to be inflammatory, but it's here to catch your eye after all. I'm a professional .NET developer, but I try to follow other platforms as well. With Ruby being all hyped up ...
5
votes
2answers
547 views

How relevant is UTF-7 when it comes to parsing emails?

I recently implemented incoming emails for an application and boy, did I open the gates of hell? Since then every other day an email arrives that makes the app fail in a different way. One of those ...
5
votes
1answer
1k views

Ruby Shoes for non-trivial apps [closed]

I've been taking a look at Ruby Shoes for GUI development with Ruby. So far, it's been a pretty good experience for making simple apps. However, I am quite worried about being able to write large ...
5
votes
3answers
591 views

What benefits for the developer does the Ruby language offer that C# does not have?

What benefits for the developer does the Ruby language have that are not available in C# (preferably with code examples)?
5
votes
1answer
1k views

How do I learn Concurrency in Ruby?

Yesterday I read this great article about Concurrency in JRuby from EngineYard and I realise I need to leverage my skills about concurrency in Ruby, by mentioning Ruby here I mean it could be all ...
5
votes
2answers
440 views

What can procs and lambdas do that functions can't in ruby

I've been working in Ruby for the last couple weeks, and I've come to the subject of procs, lambdas and blocks. After reading a fair share of examples from a variety of sources, I don't how they're ...
5
votes
3answers
815 views

How should I go about learning Ruby and Rails? [duplicate]

Possible Duplicate: Is there a canonical book on Ruby on Rails? I really want to change my PHP specialization to Ruby. I have some Ruby/Rails experience, and I've already created a few Ruby ...
5
votes
3answers
398 views

Distributed transactions and queues, ruby, erlang

I have a problem that involves several machines, message queues, and transactions. So for example a user clicks on a web page, the click sends a message to another machine which adds a payment to the ...
4
votes
3answers
967 views

Which framework should a ruby beginner start with: rails or sinatra?

What is the best framework for start: rails or sinatra? I heard that sinatra is more flexible but rails has a lot of documentation and tutorials. What's your choice?
4
votes
2answers
2k views

Do you think F# and Python might rule the future market? [closed]

I am seeing that Microsoft is concentrating too much on F#. What type of language it is going to be and will it replace the C# user base? In the last few months I am noticing Ruby posts in some ...
4
votes
7answers
540 views

Getting my younger brother started on programming [closed]

My younger brother is 13 years old, I started programming when I started to develop Android applications when I was 15, last year my brother gained an interest in it and he would always pestering me ...
4
votes
4answers
2k views

What is a practical way to debug Rails?

I get the impression that in practice, debuggers are rarely used for Rails applications. (Likewise for other Ruby apps, as well as Python.) We can compare this to the usual practice for Java or ...
4
votes
5answers
1k views

How can I move from Java and ColdFusion to Ruby on Rails?

Currently I work with ColdFusion 9+ and some Java in a Windows environment. Prior to ColdFusion, my background was in Java and JSP. I'm considering a move towards Ruby on Rails, as I think it would ...
4
votes
5answers
345 views

Simple approach to Rails [closed]

I recently got into web development through the PHP framework, CodeIgniter. I knew some PHP before I started learning that framework and overall I found it very easy to learn. The CodeIgniter ...
4
votes
2answers
1k views

Ruby IDE code completion

I just started writing some ruby in my spare time and am currently using Netbeans 7 with the Ruby and Rails plugin v0.111. I'm primarily a Java programmer coming from IntelliJ and Eclipse. One ...
4
votes
1answer
151 views

Order collisions in ecommerce

Suppose I have a web app where sellers add their products and set them as available for sale. Then I show a list of products in my mobile app, where I get products via my REST API. My problem: suppose ...
4
votes
1answer
389 views

Is it possible to write a code without class methods, globals, and class variables? [closed]

I'm designing my own programming language for fun, and I'm thinking of making it fully Object-oriented (no statics, no globals, no class variables, no class methods), so I need to find a way to ...
4
votes
3answers
237 views

Is there an idiom for a loop that executes some block of instructions between iterations? (In Ruby in particular)

I often need to do some operations in a loop and some other operations between the iterations. A simple example would be collecting words from an array into a string, spelled backwards and separated ...
4
votes
3answers
2k views

What can I use instead of Interfaces in Ruby (or any other dynamic language)?

My goal is to define contracts between classes. I like duck typing and all but I'd like also to define an interface between different layers of my application to clearly define which are the method ...
4
votes
1answer
5k views

Ruby Sinatra best practices for project structure

Many people praise Sinatra's ability to create simple projects in a single file. This is great and all but what if I want to use Sinatra for slightly larger project? I'm fairly new to Ruby as a ...
4
votes
2answers
254 views

Is using static-typing the solution to domain-driven design and decreasing the number of errors?

We are using PHP (a dynamically-typed language) in our project. However, I have found my colleagues asking questions such as ...
4
votes
1answer
4k views

Why do people suggest not to use instance variable for views in Ruby on Rails

Why do I hear that it is not good to share instance variables between controllers and views. I kind of like it because I can see immediately via the @ that something is coming from the controller. I ...
4
votes
2answers
221 views

How to deal with variables when extracting methods in to smaller methods?

This is an abstract question to clarify a refactoring concept in the ruby language. Assume in the real world that there would be many more variables and method in the Furniture Class and Refinish ...
4
votes
1answer
341 views

Best practice for organizing third-party integration code in ruby

I have a rails app. I'm writing code to integrate it with a third-party service, "Foo Bar". The integration affects many parts of the system -- models, controllers, and an API wrapper. Thus far I've ...
3
votes
4answers
2k views

What is better done in Ruby and what is better done in Haskell? [closed]

If you have experience with both Ruby and Haskell, which of the following best describes the applicability and comparative power of the two languages? The two languages better suit different kinds ...
3
votes
2answers
327 views

Why does Clojure neglect the uniform access principle?

My background is Ruby, C#, JavaScript and Java. And now I'm learning Clojure. What makes me feel uncomfortable about the later is that idiomatic Clojure seems to neglect the Uniform access principle ...
3
votes
5answers
577 views

Any other guides out there like Why's Guide to Ruby and Learn You Haskell? [closed]

I was looking for some guides to start programming with, I'm a college student and I'm learning Ruby as my first language (Side-question, is that something good to start with?). I found _Why's guide ...
3
votes
2answers
787 views

Why do ruby and python seem to have more community contribution than PHP? [closed]

In a recent blog post by Roy Osherove, it is pointed out that his switch from primarily .Net development to ruby development has seen a huge difference in community involvement and really enjoys it. ...
3
votes
4answers
3k views

What is ActiveRecord in Rails?

Today I interviewed with a big-ego VP for a Rails and Rails position at a profitable company in my city. He asked me to explain what ActiveRecord is in Rails. I told him the following: ...
3
votes
2answers
152 views

Do system background services affect languages benchmarking?

Today I was looking at some blogs on Ruby and Python. A Python loyalist wrote a few lines of code with a loop to show how Python is faster than Ruby, with a similar code. I also found a blog of a Ruby ...
3
votes
2answers
281 views

Why does assigning a variable to false return false?

Why does: something = false always return false? Since it is an assignment and not a comparison, it seems it would make more sense to return the result (success/failure) of the assignment (like ...
3
votes
1answer
329 views

Is the puts function of ruby a method of an object?

I'm trying to understand how the puts function fits in Ruby's "Everything is an object" stance. Is puts is the method of a somehow hidden class/object? Or is it a free-floating method, with no ...
3
votes
7answers
192 views

Test code that will be changed soon

My question is whether I should test code that I know will be changed in a short time. I'm doing TDD in ruby, and I often meet with this question. I'm interested about best practices about this, pro ...
3
votes
1answer
255 views

What do goroutines, Ruby Fibers, etc. look like to the OS/Kernel?

In process concurrency and thread concurrency it's quite obvious how the kernel sees these as they map directly to real things that the kernel manages. When it comes to Golang goroutines and Ruby ...
3
votes
2answers
634 views

How to match responses from a server with their corresponding requests?

There is a server that responds to requests on a socket. The client has functions to emit requests and functions to handle responses from the server. The problem is that the request sending function ...