SitePoint Sponsor |
|
User Tag List
Results 151 to 175 of 202
-
Sep 26, 2005, 10:14 #151
- Join Date
- Jun 2003
- Location
- Iowa, USA
- Posts
- 3,749
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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.
-
Sep 26, 2005, 10:15 #152
- Join Date
- Jun 2003
- Location
- ether
- Posts
- 4,497
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
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!!
Originally Posted by Fenrir2
Our lives teach us who we are.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Me - Photo Blog - Personal Blog - Dev Blog
iG:Syntax Hiliter -- Colourize your code in WordPress!!
-
Sep 26, 2005, 10:19 #153
- Join Date
- Aug 2005
- Posts
- 986
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by KTottE
-
Sep 26, 2005, 10:31 #154
- Join Date
- Jun 2004
- Location
- Stockholm, Sweden
- Posts
- 148
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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
-
Sep 26, 2005, 10:36 #155
- Join Date
- Jun 2003
- Location
- Iowa, USA
- Posts
- 3,749
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally 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.
-
Sep 26, 2005, 11:27 #156
Or:
Code:obj.do_something_different unless obj.is_something_else?
-
Sep 26, 2005, 11:46 #157
- Join Date
- Nov 2004
- Location
- Romania
- Posts
- 848
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by asp_funda
-
Sep 26, 2005, 11:49 #158
- Join Date
- Jun 2003
- Location
- Iowa, USA
- Posts
- 3,749
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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.
-
Sep 26, 2005, 12:53 #159
- Join Date
- Jun 2003
- Location
- ether
- Posts
- 4,497
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by KTottE
Originally Posted by KTottE
If yes, then ofcourse I'll try it if using that can get me a gorgeous chick!!
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 - Photo Blog - Personal Blog - Dev Blog
iG:Syntax Hiliter -- Colourize your code in WordPress!!
-
Sep 26, 2005, 12:55 #160
- Join Date
- Feb 2003
- Location
- Dog Street
- Posts
- 1,819
- Mentioned
- 1 Post(s)
- Tagged
- 1 Thread(s)
Code:obj.do_somthing if obj.is_somthing?
Code:obj.do_something_different unless obj.is_something_else?
-
Sep 26, 2005, 13:36 #161
- Join Date
- Jun 2003
- Location
- Iowa, USA
- Posts
- 3,749
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally 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.
-
Sep 26, 2005, 13:52 #162
- Join Date
- Nov 2004
- Location
- Romania
- Posts
- 848
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by asp_funda
-
Sep 26, 2005, 14:26 #163
- Join Date
- Jul 2004
- Location
- Oklahoma
- Posts
- 119
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by coo_t2
Code:(4...99).each { |num| puts num }
-
Sep 26, 2005, 14:35 #164
- Join Date
- Nov 2004
- Location
- Romania
- Posts
- 848
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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.
-
Sep 26, 2005, 18:30 #165
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?
-
Sep 26, 2005, 19:12 #166
- Join Date
- Aug 2004
- Location
- texas
- Posts
- 0
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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
-
Sep 26, 2005, 20:06 #167
- Join Date
- Jul 2004
- Location
- Central Coast, CA
- Posts
- 321
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by csmaster2005
Just because you can write:
Code:arr.each{ |p| puts p.title } unless array.empty?
Code:for (p in arr){ puts(p.title); }
Studio Rockstar's Blog - A journey to quitting the dayjob.
-
Sep 26, 2005, 21:08 #168
- Join Date
- May 2005
- Posts
- 255
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Luke Redpath
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.
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 .... ?
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).
-
Sep 26, 2005, 23:02 #169
- Join Date
- Jun 2004
- Location
- Stockholm, Sweden
- Posts
- 148
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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.
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
-
Sep 26, 2005, 23:19 #170
- Join Date
- Nov 2004
- Location
- Romania
- Posts
- 848
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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 ?
Originally Posted by Luke Redpath
Originally Posted by Luke Redpath
Originally 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.
-
Sep 27, 2005, 00:39 #171
- Join Date
- Jun 2004
- Location
- Stockholm, Sweden
- Posts
- 148
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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
-
Sep 27, 2005, 02:48 #172
- Join Date
- Jun 2003
- Location
- ether
- Posts
- 4,497
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
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 - Photo Blog - Personal Blog - Dev Blog
iG:Syntax Hiliter -- Colourize your code in WordPress!!
-
Sep 27, 2005, 02:57 #173
- Join Date
- Nov 2004
- Location
- Romania
- Posts
- 848
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
@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.
-
Sep 27, 2005, 03:14 #174
- Join Date
- May 2005
- Posts
- 255
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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.
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,
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.
-
Sep 27, 2005, 03:26 #175
- Join Date
- Jun 2004
- Location
- Stockholm, Sweden
- Posts
- 148
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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