Do you have numbers to back up this assertion? Sure, Ruby tends to be slower than Perl, for example, but what if you compare OO Perl to OO Ruby (OO Ruby is the natural way to write Ruby of course). OO Perl tends to lose out againt Ruby in performance tests - lots of extra overhead for objects in Perl apparently. Ruby tends to score a bit slower than Python for comparative tasks, true, but it's something like 5 to 10% slower not two or 10 times slower. If that's "incredibly slow", then Python is "incredibly slow" as well. Also, it's quite easy to write C extensions for Ruby (or inline C using RubyInline) for the 10% of your code that is really speed critical.
Note that I said "looks like a natural part of the language" not "the syntax is like natural language".
The number one complaint about Python is the forced use of whitespace instead of block begin and end delimters
This is why a lot of people are choosing Ruby over Python (certainly it was the main reason I chose Ruby over Python 4 years ago - now that I know Ruby better I'm glad I made that choice for other reasons as well).
It's interesting that we're seeing articles about how Python is taking the enterprise by storm just about the same time that Python usage has probably reached it's peak.
In the Python vs. Ruby race, I'd put my money on Ruby. Sure, the number of Python users is probably 4 or 5X the number of Ruby users right now, but I suspect that to turn the other way within 2 or 3 years. Why? Well, the whitespace issue is only one reason, but it does make it difficult to use Python as a templating language (as is commonly done in Ruby on Rails rhtml, for example). Ruby is a more flexible language than Python. Ruby is also more feature-rich (continuations, code blocks which make it easy to define your own constructs which look like a natural part of the language)
Ruby on Rails is generating a lot of excitement and bringing in a lot of new people. It's a great showcase for what is possible in Ruby.
Whitespace-delimited blocks are not the reason to use Python. Dynamic typing is.
Ruby will give you dynamic typing without all of the whitespace issues. Given that the two languages compete in (mostly) the same space, why should I go with Python if I don't like it's whitespace issues?
I've seen many cases where thirty minutes of practice gets rid of the problems people have with the whitespace.
But why do I have to adapt to the tool as opposed to the other way around?
Your reaction is just as the OP predicted.
The truth is that whitepace-delimited blocks can be a source of difficult-to-find bugs. It also makes it quite difficult to easily copy n paste code from one place to another. Add to this that it makes Python a very poor language for templating (embedding in HTML for example) and you start to understand why Ruby on Rails is doing so well.
Paul's a little late coming to the Mac table. The trend of 'hackers' moving towards Macs/Powerbooks was very evident a couple of years ago at OSCON 2003 where it seemed that almost half of the attendents had Powerbooks.
So now that Python is using the '@' character for function decorators the Pythonistas can no longer crticize other languages like Ruby (which uses sigils responsibly) for their use of '@' (I'm not including Perl in the list of languages that use sigils responsibly, btw:)
Welcome to the sigil club! Pandoras box is now open! '$' can't be too far behind:)
Since I read about the Smart car in Wired a few months back I've wanted one (and I am a US Citizen so yes, some of us care about the environment more than our personal comfort). But the article said that while it has the lowest emissions of any car made, the EPA wouldn't approve it. (why is that?)
That article mentioned that the car gets 70MPG, though, so I suspect that the Zap folks had to do something to it to appease the EPA (makes sense, eh? make it consume more gas so the EPA approves it). Really, given the problems caused by our dependence on foreign oil the US government should be falling all over itself trying to get people to drive cars like this. Tax incentives, etc. (instead we give tax breaks to people who by Hummers).
The article also mentioned a diesel version that would probably be exported to the US and Canada. That would be great as it should burn bioDiesel without any modifications.
Actually, it's because Bush is trying to boost U.S. exports and help keep your job.
The Bush admin may be playing along hoping for this outcome, however things at this point are out of their control to a large degree. Well, Bush could try to push for a balanced budget (which would mean raising taxes on someone) but he won't.
The Chinese Central Bank guy today said that Americans need to start saving more and get out of debt. Used to be that the Chairman of the FED would say that about the citizens of other nations - now it's the Chinese saying that about us. They know we're headed for economic disaster if we don't reign in our spending and debt.
Look, basically all jobs are going to the contract model. There is no such thing as a "stable" job anymore.
Hear that sound in the background? That's the sound of our standard of living falling rapidly (and that sound has been there for a few years now).
Hear that other sound? That's the sound of the falling dollar (Euro == $1.31 as of today). There is a relation between these two sounds. Why is the once almight $ now falling? Because the rest of the world doesn't believe that we'll be able to get your fiscal house in order (and they're probably right). We're running record trade deficits and record budget deficits. The US National debt (private and public) stands at about $55Trillion if you include promises made to retirees. What does that mean you ask? It essentially means that the US is a Banana Republic. Just today the Russian central bank wondered out loud if they should continue to hold on to $$s since they're losing value so rapidly. The Chinese and Japanese have to be wondering the same thing. Should these companies beging selling off dollars in a serious way, it'll spell financial ruin for the US.
So what does all of this have to do with your post? Well, it's likely that when it comes to retirement that the money that you're socking away to retire on won't be worth much when you actually retire. Also, it just reinforces the fact that there won't be any such thing as 'job security' anytime soon.
On the bright side: As the dollar plummets it makes us more competitive with India and China (as it basically lowers our standard of living).
Take the contract job. It'll probably last up to a year and you'll probably do pretty well during that year. Let the year after that worry about itself - that's about all you can hope for anyway these days. And it does sound like a pretty good gig as well. Who knows, maybe they will make you permanent after a few months if all goes well - but don't be lulled into thinking that being 'permanent' really means anything.
...by Rage Against the Machine
"The Ghost Of Tom Joad"
Man walks along the railroad track
He's Goin' some place, there's no turnin' back
The Highway Patrol chopper comin' up over the ridge
Man sleeps by a campfire under the bridge
The shelter line stretchin' around the corner
Welcome to the New World Order
Families sleepin' in their cars out in the Southwest
No job, no home, no peace, no rest, NO REST!
And The highway is alive tonight
Nobody's foolin' nobody is to where it goes
I'm sitting down here in the campfire light
Searchin' for the Ghost of Tom Joad
He pulls his prayer book out of a sleepin' bag
The preacher lights up a butt and takes a drag
He's waitin' for the time when the last shall be first and the first shall be last
In a cardboard box 'neath the underpass
With a one way ticket to the promised land
With a hole in your belly and a gun in your hand
Lookin' for a pillow of solid rock
Bathin' in the cities' aqueducts
And The highway is alive tonight
Nobody's foolin' nobody is to where it goes
I'm sittin' down here in the campfire light
With the Ghost of old Tom Joad
Now Tom Said; "Ma, whenever ya see a cop beatin' a guy
Wherever a hungry new born baby cries
Whereever there's a fight against the blood and hatred in the air
Look for me ma'
I'll be there
Wherever somebodies stuglin' for a place to stand
For a decent job or a helpin' hand
Wherever somebody is strugglin' to be free
Look in their eyes ma,
You'll see me! [repeat 8 times]
And the highway is alive tonight
nobody's foolin' nobody is to where it goes
I'm sittin' down here in the campfire light
With the Ghost of Tom Joad.
The American voters, like the proverbial battered wife have decided to stand by their man...
"He took our jobs away and gave us lower paying ones in exchange. He sent our kids to die in a senseless war based on a lie. He's maxed-out the credit card. He's trashing the environment and the constitution. Our friends are wondering what's happened to us....
But he's our president and we just love how he doesn't change his mind!"
Actually, It's a sad, sad day for 100% of Americans.
48% already know this. The other 52% will learn so over the next 4 years.
Exactly. Especially if the bozo-in-chief interprets last night's results as a mandate (winning the presidency and picking up seats in the house & senate); hubris will likely lead him to that interpretation.
If he reaches too far (like invading more countries) as he'll be tempted to do, then you'll see a backlash in a couple of years. This is the typical pattern in a second term. Reagan, popular as he was, ran into trouble in his second term (Iran-Contra) as did Clinton.
Given Bush's track record, though, the next couple of years could be pretty scary.
So now we're going to compare ourselve with Saddam who was supposedly an evil dictator?
"Well, we're not as evil as he was!", you say?
How long was Saddam in power? I think it was a good 30 years. We managed to kill 100,000 in a year and a half. At this rate we'll match Saddam in 9 years.
And why exactly do we need to kill all of those civilians to 'make them free'?
"We're gonna make you free if we have to kill you to do it!"
I found that Ruby usually took twice as long to complete an operation than PERL did
Perl is often faster than Ruby. However, if you compare OO Perl code with OO Ruby (well, in Ruby OO is pretty natural) you'll find that Ruby tends to be faster than OO Perl. So if you want to write object oriented code, you'll have some advantage with Ruby.
Parrot is going to support Ruby so any speed concerns should be eliminated - maybe I'll dive in properly sometime:)
There is a project called Cardinal that aims to produce a Ruby frontend for Parrot.
Also, since it's quite easy to write C extensions for Ruby programs, you can easily speed up things by writing certain time-critical functions in C and then call them from Ruby.
These Guys just hired about 4 Ruby programmers to work with Rails (a Ruby-based web application framework that uses an MVC model that's generating a lot of interest in Ruby)
I suspect that you'll see more small shops using Rails (and thus Ruby) in the coming months.
Ruby isn't the fastest language on the block, but it's so easy to write C extensions for a Ruby program. Usually only about 10 to 20% of your code is speed critical, so this allows you to write that small part of your code which is speed critical in C while writing the rest of your code more quickly in Ruby. Oh and there's a profiling module that comes with Ruby that will help you figure out where your code is spending it's time.
I would also add that if you use Swig, it's quite easy to integrate your Ruby code with your C++ code. I tend to prototype in Ruby to get my design squared away, then I translate methods to C++ while all along using the same unit tests written in Ruby to make sure that everything is still functioning the way I intended.
I got my copy a couple of weeks ago. It's a great followup to the first edition - much more information. I've already learned new things from it even though I've been programming in Ruby over 3 years now.
I also think that the philosophy espoused in the chapter on 'Duck Typing' could apply to other agile languages like Smalltalk and Python. I haven't really seen these ideas come out as strongly in other language communities as they have in the Ruby community.
I don't think there is any one thing about Ruby that's truly revolutionary, but the combination of features (code blocks, very consistent and complete standard libraries, OO'ness, etc.) make it very compelling. Do yourself a favor and buy the book - learning Ruby can help you think differently about how you approach problem solving in your day-to-day programming work (even if you don't program in Ruby for pay).
Can I get any advice? Is Ruby really "more powerful than Perl
That's really difficult to quantify. How do you define 'more powerful'?
Personally, I prefer Ruby's clean syntax to Perl's (especially when compared to OO programming in Perl, which is just a disaster from an aesthetic viewpoint, as well as the amount of work that is required from the Perl programmer to do OO). There are a few features that Ruby has that Perl doesn't: continuations, code blocks and exceptions.
and more object oriented than Python" - is this what I'm looking for, or should I put it off and learn Python first?
This tends to be an area where there is a lot of dispute between the two camps. I've already revealed my bias toward Ruby, so take that into consideration regarding the following comments: In Python I get the feeling that object orientation was tacked on. Granted it was tacked on much earlier in the language's development than it was in Perl where OO programming is essentially a do-it-yourself project. There are a couple of nagging issues in Python which give me this idea: 1) why do I need to include 'self' as the first parameter of each method definition? 2) In Python people tend to prefer, for example, to find the length of an array by saying: length( array ) instead of array.length (the latter being the way you would do it in Ruby). Of course Pythonistas are now screaming that you can also say: array.__length__ (or something similar) in Python as well.
Python now also has something similar to Ruby's iterators (though they're a bit different), but something to keep in mind is that Ruby's standard libraries and built-in classes were built from the ground up with iterators in mind - I think that's a big advantage that Ruby has over Python.
I suggest that you try to write a smallish program in each language (pick a project that might take an hour or two) and see how each language 'fits' with the way you think. I find Ruby fits my way of thinking much better than Python does, but as they say, YMMV.
RoR is a cool concept, but definately not ready for any kind of real deployment.
Here, Here! And since the earth is flat we can't have crazy people going out and sailing off the edge of it because they think it might be spherical.
Ruby is first of all, incredibly slow.
Do you have numbers to back up this assertion? Sure, Ruby tends to be slower than Perl, for example, but what if you compare OO Perl to OO Ruby (OO Ruby is the natural way to write Ruby of course). OO Perl tends to lose out againt Ruby in performance tests - lots of extra overhead for objects in Perl apparently. Ruby tends to score a bit slower than Python for comparative tasks, true, but it's something like 5 to 10% slower not two or 10 times slower. If that's "incredibly slow", then Python is "incredibly slow" as well. Also, it's quite easy to write C extensions for Ruby (or inline C using RubyInline) for the 10% of your code that is really speed critical.
Note that I said "looks like a natural part of the language" not "the syntax is like natural language".
The number one complaint about Python is the forced use of whitespace instead of block begin and end delimters
This is why a lot of people are choosing Ruby over Python (certainly it was the main reason I chose Ruby over Python 4 years ago - now that I know Ruby better I'm glad I made that choice for other reasons as well).
It's interesting that we're seeing articles about how Python is taking the enterprise by storm just about the same time that Python usage has probably reached it's peak.
In the Python vs. Ruby race, I'd put my money on Ruby. Sure, the number of Python users is probably 4 or 5X the number of Ruby users right now, but I suspect that to turn the other way within 2 or 3 years. Why? Well, the whitespace issue is only one reason, but it does make it difficult to use Python as a templating language (as is commonly done in Ruby on Rails rhtml, for example). Ruby is a more flexible language than Python. Ruby is also more feature-rich (continuations, code blocks which make it easy to define your own constructs which look like a natural part of the language)
Ruby on Rails is generating a lot of excitement and bringing in a lot of new people. It's a great showcase for what is possible in Ruby.
Whitespace-delimited blocks are not the reason to use Python. Dynamic typing is.
Ruby will give you dynamic typing without all of the whitespace issues. Given that the two languages compete in (mostly) the same space, why should I go with Python if I don't like it's whitespace issues?
I've seen many cases where thirty minutes of practice gets rid of the problems people have with the whitespace.
But why do I have to adapt to the tool as opposed to the other way around?
Your reaction is just as the OP predicted.
The truth is that whitepace-delimited blocks can be a source of difficult-to-find bugs. It also makes it quite difficult to easily copy n paste code from one place to another. Add to this that it makes Python a very poor language for templating (embedding in HTML for example) and you start to understand why Ruby on Rails is doing so well.
Paul's a little late coming to the Mac table. The trend of 'hackers' moving towards Macs/Powerbooks was very evident a couple of years ago at OSCON 2003 where it seemed that almost half of the attendents had Powerbooks.
What are the legalities of this?
Could blood cells, blood vessels, etc. last in a flexible state for 70 million years?
I kind'a doubt it.
How else will anyone find them excpept through google.
Idiots. They're getting what they deserve.
Ruby on Rails is where it's at now. There's a quote on that page that compares php to programming in assembly compared to using RoR.
So now that Python is using the '@' character for function decorators the Pythonistas can no longer crticize other languages like Ruby (which uses sigils responsibly) for their use of '@' (I'm not including Perl in the list of languages that use sigils responsibly, btw :)
:)
Welcome to the sigil club! Pandoras box is now open! '$' can't be too far behind
Since I read about the Smart car in Wired a few months back I've wanted one (and I am a US Citizen so yes, some of us care about the environment more than our personal comfort). But the article said that while it has the lowest emissions of any car made, the EPA wouldn't approve it. (why is that?)
That article mentioned that the car gets 70MPG, though, so I suspect that the Zap folks had to do something to it to appease the EPA (makes sense, eh? make it consume more gas so the EPA approves it). Really, given the problems caused by our dependence on foreign oil the US government should be falling all over itself trying to get people to drive cars like this. Tax incentives, etc. (instead we give tax breaks to people who by Hummers).
The article also mentioned a diesel version that would probably be exported to the US and Canada. That would be great as it should burn bioDiesel without any modifications.
Actually, it's because Bush is trying to boost U.S. exports and help keep your job.
The Bush admin may be playing along hoping for this outcome, however things at this point are out of their control to a large degree. Well, Bush could try to push for a balanced budget (which would mean raising taxes on someone) but he won't.
The Chinese Central Bank guy today said that Americans need to start saving more and get out of debt. Used to be that the Chairman of the FED would say that about the citizens of other nations - now it's the Chinese saying that about us. They know we're headed for economic disaster if we don't reign in our spending and debt.
Look, basically all jobs are going to the contract model. There is no such thing as a "stable" job anymore.
Hear that sound in the background? That's the sound of our standard of living falling rapidly (and that sound has been there for a few years now).
Hear that other sound? That's the sound of the falling dollar (Euro == $1.31 as of today). There is a relation between these two sounds. Why is the once almight $ now falling? Because the rest of the world doesn't believe that we'll be able to get your fiscal house in order (and they're probably right). We're running record trade deficits and record budget deficits. The US National debt (private and public) stands at about $55Trillion if you include promises made to retirees. What does that mean you ask? It essentially means that the US is a Banana Republic. Just today the Russian central bank wondered out loud if they should continue to hold on to $$s since they're losing value so rapidly. The Chinese and Japanese have to be wondering the same thing. Should these companies beging selling off dollars in a serious way, it'll spell financial ruin for the US.
So what does all of this have to do with your post? Well, it's likely that when it comes to retirement that the money that you're socking away to retire on won't be worth much when you actually retire. Also, it just reinforces the fact that there won't be any such thing as 'job security' anytime soon.
On the bright side: As the dollar plummets it makes us more competitive with India and China (as it basically lowers our standard of living).
Take the contract job. It'll probably last up to a year and you'll probably do pretty well during that year. Let the year after that worry about itself - that's about all you can hope for anyway these days. And it does sound like a pretty good gig as well. Who knows, maybe they will make you permanent after a few months if all goes well - but don't be lulled into thinking that being 'permanent' really means anything.
...by Rage Against the Machine "The Ghost Of Tom Joad" Man walks along the railroad track He's Goin' some place, there's no turnin' back The Highway Patrol chopper comin' up over the ridge Man sleeps by a campfire under the bridge The shelter line stretchin' around the corner Welcome to the New World Order Families sleepin' in their cars out in the Southwest No job, no home, no peace, no rest, NO REST! And The highway is alive tonight Nobody's foolin' nobody is to where it goes I'm sitting down here in the campfire light Searchin' for the Ghost of Tom Joad He pulls his prayer book out of a sleepin' bag The preacher lights up a butt and takes a drag He's waitin' for the time when the last shall be first and the first shall be last In a cardboard box 'neath the underpass With a one way ticket to the promised land With a hole in your belly and a gun in your hand Lookin' for a pillow of solid rock Bathin' in the cities' aqueducts And The highway is alive tonight Nobody's foolin' nobody is to where it goes I'm sittin' down here in the campfire light With the Ghost of old Tom Joad Now Tom Said; "Ma, whenever ya see a cop beatin' a guy Wherever a hungry new born baby cries Whereever there's a fight against the blood and hatred in the air Look for me ma' I'll be there Wherever somebodies stuglin' for a place to stand For a decent job or a helpin' hand Wherever somebody is strugglin' to be free Look in their eyes ma, You'll see me! [repeat 8 times] And the highway is alive tonight nobody's foolin' nobody is to where it goes I'm sittin' down here in the campfire light With the Ghost of Tom Joad.
The American voters, like the proverbial battered wife have decided to stand by their man...
"He took our jobs away and gave us lower paying ones in exchange. He sent our kids to die in a senseless war based on a lie. He's maxed-out the credit card. He's trashing the environment and the constitution. Our friends are wondering what's happened to us....
But he's our president and we just love how he doesn't change his mind!"
Actually, It's a sad, sad day for 100% of Americans.
48% already know this.
The other 52% will learn so over the next 4 years.
Exactly. Especially if the bozo-in-chief interprets last night's results as a mandate (winning the presidency and picking up seats in the house & senate); hubris will likely lead him to that interpretation.
If he reaches too far (like invading more countries) as he'll be tempted to do, then you'll see a backlash in a couple of years. This is the typical pattern in a second term. Reagan, popular as he was, ran into trouble in his second term (Iran-Contra) as did Clinton.
Given Bush's track record, though, the next couple of years could be pretty scary.
Would you buy a Mac if you could play Counterstrike Source and Half-Life 2?
How about: Whould you by a PPC based XBOX if you could run OS X on it?
So now we're going to compare ourselve with Saddam who was supposedly an evil dictator?
"Well, we're not as evil as he was!", you say?
How long was Saddam in power? I think it was a good 30 years. We managed to kill 100,000 in a year and a half. At this rate we'll match Saddam in 9 years.
And why exactly do we need to kill all of those civilians to 'make them free'?
"We're gonna make you free if we have to kill you to do it!"
Or at least he led us to believe he was.
Rails.
You'll be hearing a lot about it in the coming months.
I found that Ruby usually took twice as long to complete an operation than PERL did
:)
Perl is often faster than Ruby. However, if you compare OO Perl code with OO Ruby (well, in Ruby OO is pretty natural) you'll find that Ruby tends to be faster than OO Perl. So if you want to write object oriented code, you'll have some advantage with Ruby.
Parrot is going to support Ruby so any speed concerns should be eliminated - maybe I'll dive in properly sometime
There is a project called Cardinal that aims to produce a Ruby frontend for Parrot.
Also, since it's quite easy to write C extensions for Ruby programs, you can easily speed up things by writing certain time-critical functions in C and then call them from Ruby.
These Guys just hired about 4 Ruby programmers to work with Rails (a Ruby-based web application framework that uses an MVC model that's generating a lot of interest in Ruby)
I suspect that you'll see more small shops using Rails (and thus Ruby) in the coming months.
mod the parent up!
Ruby isn't the fastest language on the block, but it's so easy to write C extensions for a Ruby program. Usually only about 10 to 20% of your code is speed critical, so this allows you to write that small part of your code which is speed critical in C while writing the rest of your code more quickly in Ruby. Oh and there's a profiling module that comes with Ruby that will help you figure out where your code is spending it's time.
I would also add that if you use Swig, it's quite easy to integrate your Ruby code with your C++ code. I tend to prototype in Ruby to get my design squared away, then I translate methods to C++ while all along using the same unit tests written in Ruby to make sure that everything is still functioning the way I intended.
I got my copy a couple of weeks ago. It's a great followup to the first edition - much more information. I've already learned new things from it even though I've been programming in Ruby over 3 years now.
I also think that the philosophy espoused in the chapter on 'Duck Typing' could apply to other agile languages like Smalltalk and Python. I haven't really seen these ideas come out as strongly in other language communities as they have in the Ruby community.
I don't think there is any one thing about Ruby that's truly revolutionary, but the combination of features (code blocks, very consistent and complete standard libraries, OO'ness, etc.) make it very compelling. Do yourself a favor and buy the book - learning Ruby can help you think differently about how you approach problem solving in your day-to-day programming work (even if you don't program in Ruby for pay).
Can I get any advice? Is Ruby really "more powerful than Perl
That's really difficult to quantify. How do you define 'more powerful'?
Personally, I prefer Ruby's clean syntax to Perl's (especially when compared to OO programming in Perl, which is just a disaster from an aesthetic viewpoint, as well as the amount of work that is required from the Perl programmer to do OO). There are a few features that Ruby has that Perl doesn't: continuations, code blocks and exceptions.
and more object oriented than Python" - is this what I'm looking for, or should I put it off and learn Python first?
This tends to be an area where there is a lot of dispute between the two camps. I've already revealed my bias toward Ruby, so take that into consideration regarding the following comments: In Python I get the feeling that object orientation was tacked on. Granted it was tacked on much earlier in the language's development than it was in Perl where OO programming is essentially a do-it-yourself project. There are a couple of nagging issues in Python which give me this idea:
1) why do I need to include 'self' as the first parameter of each method definition?
2) In Python people tend to prefer, for example, to find the length of an array by saying:
length( array ) instead of array.length (the latter being the way you would do it in Ruby). Of course Pythonistas are now screaming that you can also say: array.__length__ (or something similar) in Python as well.
Python now also has something similar to Ruby's iterators (though they're a bit different), but something to keep in mind is that Ruby's standard libraries and built-in classes were built from the ground up with iterators in mind - I think that's a big advantage that Ruby has over Python.
I suggest that you try to write a smallish program in each language (pick a project that might take an hour or two) and see how each language 'fits' with the way you think. I find Ruby fits my way of thinking much better than Python does, but as they say, YMMV.