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

7
votes
2answers
793 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 ...
7
votes
1answer
1k views

Open/Closed principle and reopening Ruby Classes

In OOP there is the Open/Closed principle that states that "software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification". Taking in ...
7
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
5answers
696 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
4k 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
297 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
741 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
4answers
840 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
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 ...
6
votes
3answers
865 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
6answers
788 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
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 ...
6
votes
2answers
443 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
3answers
130 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
4answers
476 views

I have a bad memory. Is dynamic typing language+vim appropriate for me? [closed]

I am switching from C#+Visual Studio to Ruby+Vim for a few months. The only thing that I am missing from C#/Visual Studio is intellisense, especially when I have a new ruby gem to familiarize. As a ...
6
votes
2answers
690 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
4k 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
373 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
707 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
3answers
3k 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 ...
5
votes
3answers
613 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
2answers
490 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
491 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
2answers
504 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 ...
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
2answers
4k views

How to execute a Ruby file in Java, capable of calling functions from the Java program and receiving primitive-type results?

I do not fully understand what am I asking (lol!), well, in the sense of if it is even possible, that is. If it isn't, sorry. Suppose I have a Java program. It has a Main and a JavaCalculator class. ...
4
votes
7answers
584 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
5answers
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
2answers
231 views

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

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 ...
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
3answers
1k views

How can web development bootcamps deliver on their promise? [closed]

I came across the concept of web development bootcamps, these 9-10 week intensive crash courses claim to teach beginners web development and help them get 80k starting salary jobs. Many of you might ...
4
votes
1answer
164 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
3answers
255 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
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
338 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
5k 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
3answers
1k 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 ...
4
votes
2answers
246 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
388 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
5answers
615 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
848 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
157 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
319 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
439 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
5answers
356 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 ...
3
votes
7answers
195 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
90 views

What does it mean that file IO binary flag is only relevant on Windows

I was reading a question and one of the comments mentioned that "The binary flag is only relevant on Windows". Given the context of the question and answer, I interpret this statement as on ...
3
votes
1answer
346 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
6answers
5k views

How much Ruby should I learn before moving to Rails?

Just a quick question.. I can never get a definitive answer when googling this, either. Some people say you can learn Rails without knowing any Ruby, but at some point you'll run into a brick wall and ...