Here is a blog post linking to a survey on where people migrated to Rails from.
| SitePoint Sponsor |
Here is a blog post linking to a survey on where people migrated to Rails from.
Jason Sweat ZCE - jsweat_php@yahoo.com
Book: PHP Patterns
Good Stuff: SimpleTest PHPUnit FireFox ADOdb YUI
Detestable (adjective): software that isn't testable.

umm, pardon but these two are same except that in Ruby code there's no curly braces & semicolons & you use boring periods(.) instead of stylish arrows(->)!!Originally Posted by Fenrir2
But you can use semicolons in Ruby if you want to, when you want to have more than 1 statement on a single line. I find this comforting as semicolons make code more readable by telling user where a line ends!! But I don't like the periods for referring to object methods!! Its the one thing that I hated in VB & Java & C++ & arrows were the only thing I liked in Perl & what attracted me to PHP, they are kinda informative by telling you visually that the control is flowing from left to right, first object is called & then function is referenced.
And mind you, braces help define a code block, I missed them a lot in VB!!
Yes, this is certainly better in Ruby, its more readable, like in VB. And ofcourse, Rails take Ruby's readability/simplicity further ahead!!Originally Posted by Fenrir2
![]()
Our lives teach us who we are.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Me - My Photo Blog - My Hindi Blog - My Blog
iG:Syntax Hiliter -- Colourize your code in WordPress!!




I agree. Python syntax, without :Originally Posted by KTottE
asp_funda, control is flowing from right to left. You are sending a message to an object. Notice how that sentence reads? The first part is "send a message" the second part is "to an object."
If you want syntax to describe control flow it should look like object<-method.
Or if you want to be cool, use Befunge.
If there is a way to overcome the suffering, there is no need to worry; if there is no way to overcome the suffering, there is no point to worry.
- Shantideva
Okay, how about this instead for less PHP like codeOriginally Posted by asp_funda
Ruby:Code:obj.do_somthing if obj.is_somthing?
Jason Sweat ZCE - jsweat_php@yahoo.com
Book: PHP Patterns
Good Stuff: SimpleTest PHPUnit FireFox ADOdb YUI
Detestable (adjective): software that isn't testable.
Or:
Code:obj.do_something_different unless obj.is_something_else?




FYI ASP.NET was the reason for .NET's success not viceversa. The vast majority of Windows programmers are just happy with VC++ 6 and VB 6 because .NET is not available by default in windows XP. And you completelly missed my point. I am quite familiar with ASP.NET to know it's purpose, thank you very much.Originally Posted by asp_funda
Appearantly friendly people is another distinction to which Ruby can claim.
Jason Sweat ZCE - jsweat_php@yahoo.com
Book: PHP Patterns
Good Stuff: SimpleTest PHPUnit FireFox ADOdb YUI
Detestable (adjective): software that isn't testable.

Ok, I goofed up, hang me!!Originally Posted by KTottE
![]()
Are you talking about this?Originally Posted by KTottE
If yes, then ofcourse I'll try it if using that can get me a gorgeous chick!!
![]()
![]()
yeah that's cool as well. Mind ya, I'm not saying that Ruby ain't cool or easy, what I said was the things that I don't quite like or miss in Ruby!! But then, nothing has everything.Originally Posted by sweatje
Originally Posted by bonefry
Off Topic:
right, you mean to say that these programmers don't ever compile any DLLs etc that they need to install on client PCs that'll run their software & they use only those DLLs that are available in Windows???If that's not the case then is it a big deal packaging the .NET runtime in the installer?? We've done it loads of times, but ofcourse if you are giving away software as a web download, then you gotta think twice, bandwidth ain't cheap!!
Originally Posted by bonefry
Off Topic:
Thanks for telling me that, I thought you didn't know ASP from .NET!!Do me a favour & don't reply to my posts, as you can't bother to read them correctly & get the right meaning!! And to say nothing of the fact that from your posts here, all I've seen is that more than half the time, you don't know what you are talking!!
Our lives teach us who we are.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Me - My Photo Blog - My Hindi Blog - My Blog
iG:Syntax Hiliter -- Colourize your code in WordPress!!





Code:obj.do_somthing if obj.is_somthing?This is nothing exciting for anyone who's done any Perl.Code:obj.do_something_different unless obj.is_something_else?
Neither would first class regexs, but those are a nice borrowing from Perl as wellOriginally Posted by coo_t2
![]()
Jason Sweat ZCE - jsweat_php@yahoo.com
Book: PHP Patterns
Good Stuff: SimpleTest PHPUnit FireFox ADOdb YUI
Detestable (adjective): software that isn't testable.




Please tell me what is this all about. What have I said that offended you without reason and were are those posts were I don't know what I'm talking ?Originally Posted by asp_funda

No but something like this should be:Originally Posted by coo_t2
Code:(4...99).each { |num| puts num }




Actually, although I like Ruby, the above I do not like.Originally Posted by Sgarissta
There is a difference between (4..99) and (4...99), that's one thing I do not like.
Second, things like that and also things like 99.times { ... } don't really add nothing but performance problems. And 99.times it's not even OOP (dare I say it) because the method "times" doesn't have anything to do with an Integer.
In these cases the good old for loop is still good.
Of course times is related to an integer. Its another word for multiply, and what can you do with integers? Multiply things by them. Ruby just happens to let you multiply more than just other integers/numeric objects.
Also, I'm not sure what the problem is with the range notation, other than perhaps that it is a little bit obscure.
I'm not too sure how either of the above causes performance problems either. What exactly do you mean?
this is ironic... a friend showed me ruby today and I was reading alot about it, and am even considering switching to it and stop developing in php but rather ruby.
I then get on the boards and find this post lol.
Anyways, for anyone interested in understanding what it is better, u may want to watch the movie on their site where they make a blog in 15 minutes. It's impressive, but I found 2 issues about it.
1) I'd have to learn it from scratch, wasnt like php where 70% of the code was just like c++.
2) If I wanted to add customized coding, like cron jobs that do very minute things, it seems harder to do with ruby rather than with php


Actually, another amazing thing about ruby is that it's a chameleon. Braces, semicolons and much more are optional.Originally Posted by csmaster2005
Just because you can write:
Doesn't mean you can't write:Code:arr.each{ |p| puts p.title } unless array.empty?
2. Says who? Many times it's easier. The fact that a particular task is smaller or is a cron job has no bearing on the langauge/framework/etc.Code:for (p in arr){ puts(p.title); }
Studio Rockstar's Blog - A journey to quitting the dayjob.


Nah, it proves that there is a desire[ for a framework in those languages.Originally Posted by Luke Redpath
Because it's a different language with different features? Who's to say that any way is better than the others? There are still tons of successful apps out there that get by without a framework, in plenty of languages (not just PHP). The most successful projects that I can think of (open source or otherwise) don't really use a "framework" in the sense that we're talking about frameworks anyway.So why should PHP be any different?
People aren't going to switch to another language en masse just because it has a nice framework. Some might. Others won't. It's really a silly argument.
That's a pretty strict definition. I think it speaks volumes of Ruby that nobody gave a damn about it UNTIL there was a good framework for it. People have been flocking to PHP in ever-growing numbers for years without it. Does this mean that PHP is that much of a superior language to Ruby? Of course not. That's just dumb.My definition of a killer framework is a framework popular and good enough to attract people to use it's underlying language and platform. And that's what Zope and Rails are. And that's what PHP lacks. How many on this forum have been attracted to PHP because of PHP.MVC or Horde or Prado or .... ?
C#, Visual Basic, and C++?And what would .NET be without ASP.NET ?
Originally Posted by Fenrir2
1.) What? They're practically identical. (and why aren't you using the instanceof operator? And I can simpify both into 1 line constructs anyway.
2.) Most major languages use semicolons to end lines and curly braces (C, C++, Java, C#, Javascript, etc.). Which makes this syntax MORE natural to the average programmer who has any level of experience.
I agree that the -> operator is clumsy compared to the ., but for someone with a C or C++ background, it's second-nature (it's the pointer member accessor, whereas the period only works on regular variables).
3.) echo str_repeat('hi',10); (This is getting stupid).
1) Just because you can write it on one line doesn't mean you should.
2) This is optional in Ruby, if you feel like doing it: Do it.
Objects in Ruby are always references, and if you have a C++ background then you would know that you access reference data members and methods with the dot operator.
3) In the second post of this thread I gave two very quick examples of Ruby and PHP (since PHP was what the original poster referenced) and asked which he felt was more natural. The same question still stands, if you think echo str_repeat('hi', 10); feels more natural than 10.times {puts 'hi'} then fine, don't use Ruby. Actually, you could write the first thing in Ruby if you just wrote the echo and str_repeat methods yourself and added them to the Object class.
Are you happy now?PHP Code:class Object
def echo(msg)
puts msg
end
def str_repeat(msg, num)
ret_arr = Array.new
num.times { ret_arr.push(msg) }
return ret_arr.join
end
end
echo str_repeat( 'hi', 10);
If there is a way to overcome the suffering, there is no need to worry; if there is no way to overcome the suffering, there is no point to worry.
- Shantideva




How can times be another word for multiply ? Maybe in your vocabulary but not in ruby. In ruby it's a word for "repeat it this many times" and it's not related to an integer.Originally Posted by Luke Redpath
In the current version of Ruby it doesn't cause performance problems because it's a slow interpreter anyway, but when it will be optimized a little, you will see. Of course it has performance issues. The code block is a function that gets called on every iteration. And function calls are slow. Also, the iteration itself is also a function that increments the internal counter, so that again, is slower that manually writting var = var + 1. And it doesn't matter for 30 or 100 iterations, but what about 1.000.000 ?
We are long gone since the MS-DOS days when knowing some assembly language + C or Pascal (which were both very high languages) made one a good programmer. You can no longer work without APIs. Not even in PHP - in case you haven't noticed, the standard library keeps growing in PHP 5.1 (for example with the addition of PDO) and it will grow further in PHP 6.Originally Posted by Luke Redpath
Of course not. Who ever said that again ?Originally Posted by Luke Redpath
I'm not sure what your point was ... but maybe I was not clear enoughOriginally Posted by Luke Redpath
Please give me one good reason why .NET was succesfull other than ASP.NET.
To make a quick summary: many Windows programmers still use old technologies because .NET is not available in WinXP by default, and to answer to someone else - it has huge issues in Win9X (which is still in use). And it was marketed as the perfect choice for web services. But recent surveys show that Java is still the preferred choice. Is there something else besides ASP.NET that made .NET succesfull ?
Last edited by bonefry; Sep 27, 2005 at 00:52.
bonefry, "times" is a commonly used word for multiplication. "Five times two equals ten" and so forth.
However, this doesn't work in Ruby, because to be semantically correct 5.times 2 should output 10, and it doesn't. It responds with a syntax error (times accepts a block as a parameter). So, you are both correct.
Anyway, performance issues related with calling a function once per iteration is not exclusive to Ruby. The following two snippets would be equally (in)efficient:
PHP Code:10.times do
some_method
end
for ($i = 0; $i < 10; $i++)
{
some_method();
}
If there is a way to overcome the suffering, there is no need to worry; if there is no way to overcome the suffering, there is no point to worry.
- Shantideva

Yes, How to Build a Blog with RubyOnRails in 15 minutes. And I found these three articles on OnLamp.com pretty helpful.Originally Posted by csmaster2005
Rolling with Ruby on Rails -- Part I
Rolling with Ruby on Rails -- Part II
AJAX on Rails
The rolling on RoR series, its a good & starts out with installation of Ruby, RubyOnRails, MySQL & MySQL Front(to manage MySQL). If you have them already, then you can scroll down to start creating the first Rails app. Its pretty good, I built the cookbook in no time without any prior Ruby knowledge!!
Originally Posted by bonefry
Originally Posted by bonefry
![]()
![]()
![]()
Our lives teach us who we are.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Me - My Photo Blog - My Hindi Blog - My Blog
iG:Syntax Hiliter -- Colourize your code in WordPress!!




@asp_funda are you trying to piss me off ?
You actually accused me of not getting the right meaning of your posts ?
What is this then ?
PS: I asked you a friendly question earlier and I demand an answer.


I think you completely missed the point. It's not that you can / can't do something in Ruby / PHP, it's that you can do anything in either language and the argument of one being naturally superior is just downright stupid (ESPECIALLY when it comes to claims about being able to write shorter code). Claiming that something is easier to do in ruby because you pull out some arbitrary one line example is just plain idiocy. I can name a million things that I can do in one language that I can't do in another, but ultimately it doesn't matter, because I can still achieve the same results.Originally Posted by KTottE
Does anyone actually have any real statistical data to show that any given language is "more productive" than any other? I sincerely doubt there's anything other than anecdotal.
I gave you 3. C# is extremely popular, and is now the language of choice for windows desktop development. I see more openings for C# and VB.Net developers on monster than ASP.Net.Please give me one good reason why .NET was succesfull other than ASP.NET.
True, but the msi installer will automatically install it when you install the program anyway, so what does it matter. Not only that, but there is no Java runtime installed by Windows XP by default either.To make a quick summary: many Windows programmers still use old technologies because .NET is not available in WinXP by default,
Oh, and actually all newer versions of XP that ship DO have the .Net framework preinstalled. It was a part of service pack 2, and any copies that shipped with that pre-loaded will have it. Those users still don't have java installed, though.
I've yet to encounter a single common windows application that uses Java, but I'm running 3 right now that use .Net. I haven't even installed a JRE on any of my desktops in years.
When in this thread did I ever mention that Ruby was more productive than any other language?
In fact, my position is exactly the opposite: No language is more productive than another language, it all comes down to who is writing the code.
Actually, I don't think anyone in the thread is arguing that Ruby is naturally more productive than PHP?
If there is a way to overcome the suffering, there is no need to worry; if there is no way to overcome the suffering, there is no point to worry.
- Shantideva
Bookmarks