22 Apr, 2009 in C++, Java, Ruby by khelll

I got a lot of comments for the previous article, that was explaining how Ruby passes by value, just like Java does.
I thought that showing a simple example implemented in C++, Java and Ruby will clarify the idea. In the following lines, we will make swap functionality in 3 languages, and demonstrate that neither [...]

21 Apr, 2009 in Ruby by khelll

It’s a basic question that I myself had a problem with when i started using Ruby: Does Ruby pass by value or by reference?
Well, if you want a direct answer, then: Ruby passes by value. It’s a similar behavior of what Java does.
Let’s prove it via examples:
Update: this example was passing integers, and it [...]

11 Jan, 2009 in JRuby, Java, Ruby by khelll

It’s true that I’m not the qualified guy to talk about Java’s power,as it has been 2 years since i last practiced it, but i feel like i have to communicate my thoughts to the people that didn’t give JRuby a trial yet, and why they should do so.
If you never worked with Java before, [...]

6 Jan, 2009 in Ruby by khelll

I keep seeing many programmers from different backgrounds are unable to get what Ruby symbols are, and though I do know that there are many great posts regarding this topic, and actually my intent is not to increase them by one , but I feel I have to clear few points regarding them.
So [...]

31 Dec, 2008 in Ruby by khelll

According to wikipedia, Metaprogramming:
is the writing of computer programs that write or manipulate other programs (or themselves) as their data, or that do part of the work at runtime that would otherwise be done at compile time.
Well, nice to hear cause Ruby is a lang that supports Metaprogramming effectively, and might be the best in [...]

30 Dec, 2008 in Ruby by khelll

A Domain-specific language(DSL) is a computer language that’s targeted to a particular kind of problem, rather than a general purpose language that’s aimed at any kind of software problem. Domain specific languages have been talked about, and used for almost as long as computing has been done. Regular expressions and CSS are 2 examples of [...]

28 Dec, 2008 in Ruby by khelll

This blog post is about ruby’s callbacks(hooks): what are the available ones,and how practically we can use them?
method_missing
obj.method_missing(symbol [, *args] ) => result might be the most famous hook in ruby, and is being used a lot by ruby developers :
Invoked by Ruby when obj is sent a message it cannot handle. symbol [...]

26 Dec, 2008 in Ruby by khelll

This is the second post related to ruby’s reflection API, the previous post was an extensive intro to this topic. While the current one will be lighter somehow, it would require you to focus a bit more on the content.
Here we go:
Setting, getting and removing instance variables :

# Define a simple class M
class M ; [...]

19 Dec, 2008 in Ruby by khelll

If you are here, then most probably you want to know more about ruby reflection interface. Well that’s true, but I always find myself in need to explain few things before I get started with my posts, and this time I find myself in need of explaining few things related to ruby’s OOP.
I’m pretty sure [...]

12 Dec, 2008 in Merb by khelll

So many developers from various countries had corresponded to Matt Aimonetti’s article on open merb book, and an early version of the book is out there.
However lot’s of work is still needed in both directions: contribution and translation ,so: dear Arabic developers wherever you are, if you are interested in Merb framework, have the ability [...]