Not sure why you were quoting me there except the first quote.Originally Posted by bonefry
Like somebody already said, times is a common word for multiply. It certainly is in the UK. 2 times 2 is 4 etc.
| SitePoint Sponsor |
Not sure why you were quoting me there except the first quote.Originally Posted by bonefry
Like somebody already said, times is a common word for multiply. It certainly is in the UK. 2 times 2 is 4 etc.
I think he may be getting confused because people often talk about using Rails as being more productive than using plain PHP, which I think is quite true.Originally Posted by KTottE
Ruby, the language, doesn't make me more productive, but I enjoy using it much more than anything else.




Can't you people read English ?Originally Posted by Etnu
I am no native English speaker, but please enlighten me were have I got it wrong.
#1. The question is as you correctly highlighted "Please give me one good reason why .NET **WAS** succesfull other than ASP.NET.". There is no present tense in there.
#2. Where the hell have I compared in that post Java to .NET ? All I said was web services are still prefered on top of Java and I think that means **SERVER-SIDE** not client-side, don't you ?
Do you really think that Win9X (which you so conveniently ignored from your quote) was abandoned ? And what about old WinXP and Win2000 licenses ? Yeah, I see customers really happy when they have to make a 20 MB download, especially if they don't have Internet connection.
And BTW: Java runs without problems on Win9X, and on WinXP 64, and on any other OS in use.
ALL I TRIED TO SAY IS THAT IN OUR DAYS APIs AND FRAMEWORKS ARE **IMPORTANT** AND CONTRIBUTE HUGELLY TO A LANGUAGE/PLATFORM SUCCESS. AND THAT'S WHAT RAILS IS.
What's so wrong with my statement ? Please proove to me I am wrong. All I got up until now was stupid arguments.





Why is a framework important?
"A nerd who gets contacts
and a trendy hair cut is still a nerd"
- Stephen Colbert on Apple Users
Ideally a framework will save you time because lots of the low-level coding (i.e. database abstraction, basic architecture) will be done for you. Imagine how crappy ASP.NET would be if you had to write all the Web Form and server control stuff yourself.Originally Posted by The New Guy




1) Because i'm not checking classes here. Maybe $obj is a house, and is_something() would be is_big(). So is_big() is checking whether the house is big or not, it doesn't check the class.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) In PHP, I see 15 strange characters: "-> { } ( )" etc. The Ruby-code only contains two of them: 2x "." That makes it more readable for me, plus you can type that faster.
2) Are you saying that if one language has strange syntax, other languages should have that too? Ruby was designed to be a good language, not a C++ clone. And Javascript doesn't require semicolons either.
3) Yes it is. The print("hi"); is an example, but anyway, I showed this code to compare readability. What is more readable, echo str_repeat('hi',10); or 10.times { print "hi" }?? Plus you have to remember that the first argument is the string, and second the integer.
And I think 10.times {} is faster than for($i = 0; $i < 10; $i++){}, because in the for-loop, you're creating a script-variable, checking and incrementing that, and this is slower than an internal variable.
10.times {} is slower than for(){} because the Ruby interpreter is heaps slower than the PHP interpreter.
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




OK, that's true, but in theory times {} could be faster because C is faster than a scripting language.
A quick summary: (+ = positive; - = negative ;-))
+ You can do things faster in Ruby, with readable code
+ Rails is a very good framework for web apps, good Ajax support
+ Ruby is OO
+ Ruby has iterators / blocks / continuations
+ Ruby has a large standard library, and regex support at language level
+ Clean syntax
+ Ruby isn't focused on a single thing, like PHP is. You can do a lot of things with it.
- Ruby programs execute slow (this could change if the interpreter is optimized
- There are more PHP tutorials than Ruby tutorials
- More PHP host than Ruby on Rails hosts
Could Ruby-code be compiled and be almost as fast as Java (5 times slower is ok too)? Is that possible without static typing?




10.times {} should be way slower than for($i = 0; $i < 10; $i++){} because in 10.times {} you do exactly 10 method calls which are slow and in for($i = 0; $i < 10; $i++){} you do no method calls. Also, I didn't get that part about the internal variable (since you still need to run the script code inside the block).Originally Posted by Fenrir2
I've heard of a project called ruby2c that converts ruby to C code but I don't think it is finished. Well, Matz did promised a JIT VM for Ruby 2.0 and apparently that is going to be Yarv but it has a slow progress.Originally Posted by Fenrir2
Performance can't be almoust as fast as Java unfortunatelly without big money pumped into a new VM or without making it run on an existing VM (Parrot/CLR/Java/Squeak?). But lets hope it will get fast enough for most tasks pretty soon. In maximum a half an year from now we will know for sure which way Ruby is heading.




A word about syntax.
People with a C-like background sometimes may find the Ruby syntax ugly.
But that's only because you have that C background. And anyone can adapt. What if you had to write something like:
Should we dismiss Scheme because it's ugly ? Once you get used to a language it's not.Code:(define fac (lambda (n) (if (= n 0) 1 (* n (fac (- n 1))))))
It's important to me because I can go behind the last guy and find things. A framework is like that of a packaged house. Doesn't matter what it looks like on the outside or inside the kitchen is always in the same place. Where as nowadays in PHP every other opensource application looks like its own rendition of "The Winchester Mystery House".Originally Posted by The New Guy
![]()
FHQK ed UP - It's a really FHQK ed UP world we live in!
Hiveminds Magazine
Search Engine for Drupal
Search Engine for Students





Hi...
I'd go further and say add some languages which make you learn things and some which are commercially useful. Ruby for me is amixture of both. I can use it for routine scripting (rake is just nice) and learn stuff too (metaclasses, blocks). Learn a compiled language if you are using a scripting language, learn a functional language if you are using OO, etc.Originally Posted by vgarcia
Commercially: C, C++, Java, C#, Perl, PHP, SQL
Make you think: Smalltalk/Ruby, Prolog, Haskell/Scheme/LisP
yours, Marcus
Marcus Baker
Testing: SimpleTest, Cgreen, Fakemail
Other: Phemto dependency injector
Books: PHP in Action, 97 things

FYI RubyConf is in about two weeks. And at said RubyConf there will be a 'state of the YARV union' so to speak. So there should be some much more available information as to the YARV ruby VM's progress. I have used the current yarv and it speeds some things up very much. Like case statements are around 30 times faster. Also regarding speed... if you are doing web and network programming, most of the time the network latency far outlasts any slowness of ruby compared with php. It is my hope that YARV will be done soon as ruby needs a faster VM. But the current branch of ruby 1.9 is quite a bit more optimized and more performant than the 1.8.2 branch.
Earlier in this thread several questions were asked if theyre are any PHP clones of the Ruby on Rails Framework.
I've currently been researching though I have not tried any of these but this is what I have found so far.
Cake: http://cakephp.org/
Runs on php 4/5
currently seems to be under active developement and seems to have the most community support.
Biscuit: http://bennolan.com/biscuit/
Runs on php 4/5
developed by Ruby on Rails users who have needed a php version at times
minimalist, their vision is to keep it to the mininum and let users expand as needed.
phpontrax: http://phpontrax.com/
Runs on php5 only
Probably most developed and rails like but I haven't seen much community support
and here's an really intersting one in javascript:
http://trimpath.com/project/wiki/TrimJunction
Last edited by terryg; Sep 28, 2005 at 19:17.
Nope, because there are not native types in Ruby. If you haven't got it yet: everything is an object. In this case the number 99 is an instance of class Fixnum.Originally Posted by bonefry
a = 100
a.class #=> Fixnum
a.class.superclass #=> Integer
a.integer? #=> true
100.0.integer? #=> false
Um, ok...Originally Posted by bonefry




Originally Posted by +_-
Fixnum < Integer < Numeric < Object. My question was: what does the times{} method has to do with Fixnum ? And what does "primitive types" have to do with the word "Integer" ?


It seems pretty simple to me. You can do something a fixed number of times, hence Fixnum#times
You can run around the block 5 times (a fixed number)
5.times{ run_around_block }
I think a lot of people criticizing Ruby/SmallTalk/etc are those stuck in the C++ world - refusing to believe any new paradigm of programming exists.
People should stop comparing CPU performance charts and start comparing Programmer performace charts. What good is a language that is 10% faster if the programmer is 20% less efficient/happy? A server costs $3k... a programmers salary easily makes up $3k per month.
Studio Rockstar's Blog - A journey to quitting the dayjob.
I don't know if anyone caught my reply regarding the times-method (message) on Page 7 of this thread, but the point was that it is semantically incorrect in Ruby.
Fixnum times Fixnum should be the same as Fixnum multiplied by Fixnum, but it's not in Ruby. Which makes it semantically incorrect.
In Ruby, it's Fixnum times Proc with the intention of running Proc Fixnum times. This probably violates the philosophy about the Least Amount of Astonishment, but I think code using the method is clear enough without it.
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




Well, I don't want to dismiss Ruby because I like it. But you see, if your statement about the 10% slower was right, you were right. But you are wrongOriginally Posted by Brak
First of all, Ruby is not 10% slower than the rest.
You see, the alioth benchmarks states that Ruby is 50 times to 200 times slower than Java.
Now, there are many that don't trust the alioth benchmarks, but from my own experience, Ruby is at least 10.times slower than Java and that's on simple alghorithms. And it's a comparisson you can do by yourself at home
So, in conclusion, when the Ruby VM is at least (not 10% but) 1000% slower than Java, I think there is reason to worry, don't you think ?
People also say, well, you can always drop to C code when detecting botlenecks. But if you have to drop to C code, where is that productivity gain ?
Also, people should stop playing the productivity card so often, because, anyone can be productive in Java/.NET/PHP/Python. Main advantage Ruby has, like PHP, is that it is cheap. It is also beautifull, and that means we get bored less. Truth is Ruby right now is only usefull for applications were it is fast enough. I can accept that, but if you won't, you will hit a wall.




Good answerOriginally Posted by KTottE
I thought so too
As for the performance of Ruby - any language will be too slow at some point. The fact that Ruby is quite slow most of the time indicates that it is best suited for task automation/scripts as opposed to computationally intensive applications.
I only use Ruby for these tasks so the performance of Ruby is not something I am bothered by. Languages have certain areas where they are useful, and when stepping outside the bounds for that area you are going to run into some problems.
You could write an OS in Perl, but it doesn't mean it's a good idea
Edit
I'm bored at work, so I solved the whole bit about Ruby being semantically incorrect
As you can see it only operates on Fixnums for the time being, but you can multiply by any kind of numberPHP Code:class Fixnum
def times(*args, &block)
unless args[0].nil? then
return self * args[0]
else
super(&block)
end
end
end
5.times { puts "This is a block!" } #=> Prints "This is a block!" five times
puts 5.times(2) #=> Prints 10
puts 5.times(10.5) #=> Prints 52,5
![]()
Last edited by KTottE; Oct 4, 2005 at 06:26.
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


I personally work with (on the user-end) a J2EE platform at work. It's slow as mud. I've used similar Ruby applications (feature-wise) and they're easily 100x faster.Originally Posted by bonefry
I'm sorry, but I just don't care about benchmarks at all. It's about the programming methodologies used. The quality of the code. Not the language you're coding in. (Granted, there is always a language for a given application; I'm not speaking in generalities. You wouldn't write a program to model the Earth's wind patterns in Ruby. That would be foolish)
And, as far as productiveness, I'm really talking about that 10% of 110%. Ruby is one of those languages that make people stay after work to finish a project on. It's one of those languages where developers spend all day at work on it - then come home and contribute to open source apps. It's more a drive than productiveness - and that's what I'm talking about.
Studio Rockstar's Blog - A journey to quitting the dayjob.
You don't care about benchmarks? Your customers must be really pleased.
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




You are mistaking J2EE with Java and Ruby with Rails. 100x faster ? Could you care to argument ?Originally Posted by Brak
The most beautifull or fastest language in the world won't save you from design mistakes.
I stayed after work lots of times with PHP and Java and I find pleasure mostly in things I do.Originally Posted by Brak
I think that if you look on SourceFourge you will find hundreds, even thousands of opensource java projects. PHP I think is well known on this forum.Originally Posted by Brak
The customers do care. And it's important to care about what the customers care. And it is a problem when O(n) in Ruby is slower than O(n^2) in C.Originally Posted by Brak
Truer words were never spoken. As a matter of fact, I'd say the better the language, the more obvious your design mistakes will be.Originally Posted by bonefry
Bookmarks