SitePoint Sponsor

User Tag List

Page 8 of 9 FirstFirst ... 456789 LastLast
Results 176 to 200 of 202
  1. #176
    SitePoint Guru silver trophy Luke Redpath's Avatar
    Join Date
    Mar 2003
    Location
    London
    Posts
    794
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bonefry
    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.

    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.


    Of course not. Who ever said that again ?


    I'm not sure what your point was ... but maybe I was not clear enough
    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 ?
    Not sure why you were quoting me there except the first quote.

    Like somebody already said, times is a common word for multiply. It certainly is in the UK. 2 times 2 is 4 etc.

  2. #177
    SitePoint Guru silver trophy Luke Redpath's Avatar
    Join Date
    Mar 2003
    Location
    London
    Posts
    794
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by KTottE
    Actually, I don't think anyone in the thread is arguing that Ruby is naturally more productive than PHP?
    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.

    Ruby, the language, doesn't make me more productive, but I enjoy using it much more than anything else.

  3. #178
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Etnu
    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.

    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.

    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.
    Can't you people read English ?
    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.

  4. #179
    Put your best practices away. The New Guy's Avatar
    Join Date
    Sep 2002
    Location
    Canada
    Posts
    2,087
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Why is a framework important?
    "A nerd who gets contacts
    and a trendy hair cut is still a nerd"

    - Stephen Colbert on Apple Users

  5. #180
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by The New Guy
    Why is a framework important?
    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.

  6. #181
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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) 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) 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.

  7. #182
    SitePoint Zealot bronze trophy
    Join Date
    Jun 2004
    Location
    Stockholm, Sweden
    Posts
    148
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  8. #183
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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?

  9. #184
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Fenrir2
    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 {} 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).

    Quote Originally Posted by Fenrir2
    Could Ruby-code be compiled and be almost as fast as Java (5 times slower is ok too)? Is that possible without static typing?
    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.

    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.

  10. #185
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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:
    Code:
    (define fac
               (lambda (n)
                       (if (= n 0)
                              1
                              (* n (fac (- n 1))))))
    Should we dismiss Scheme because it's ugly ? Once you get used to a language it's not.

  11. #186
    Web developer Carl's Avatar
    Join Date
    Sep 2003
    Location
    sweden
    Posts
    320
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by The New Guy
    Why is a framework important?
    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".

  12. #187
    ********* Victim lastcraft's Avatar
    Join Date
    Apr 2003
    Location
    London
    Posts
    2,423
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi...

    Quote Originally Posted by vgarcia
    I'd say you should know at least two really well (one compiled language like Java or C#, one scripting language like PHP or Perl)
    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.

    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

  13. #188
    SitePoint Zealot
    Join Date
    Nov 2004
    Location
    Yakima WA.
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  14. #189
    SitePoint Member
    Join Date
    Sep 2005
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    php Frameworks like Ruby on Rails

    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.

  15. #190
    SitePoint Member
    Join Date
    Oct 2005
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bonefry
    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.
    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.

    a = 100
    a.class #=> Fixnum
    a.class.superclass #=> Integer
    a.integer? #=> true
    100.0.integer? #=> false

    Quote Originally Posted by bonefry
    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).
    Um, ok...

  16. #191
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by +_-
    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.
    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" ?

  17. #192
    SitePoint Addict Brak's Avatar
    Join Date
    Jul 2004
    Location
    Central Coast, CA
    Posts
    321
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  18. #193
    SitePoint Zealot bronze trophy
    Join Date
    Jun 2004
    Location
    Stockholm, Sweden
    Posts
    148
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  19. #194
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Brak
    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.
    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 wrong

    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.

  20. #195
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by KTottE
    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.
    Good answer

  21. #196
    SitePoint Zealot bronze trophy
    Join Date
    Jun 2004
    Location
    Stockholm, Sweden
    Posts
    148
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

    PHP Code:
    class Fixnum
        def times
    (*args, &block)
            
    unless args[0].nilthen
                
    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 
    As you can see it only operates on Fixnums for the time being, but you can multiply by any kind of number
    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

  22. #197
    SitePoint Addict Brak's Avatar
    Join Date
    Jul 2004
    Location
    Central Coast, CA
    Posts
    321
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bonefry
    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 wrong

    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.
    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.

    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.

  23. #198
    SitePoint Zealot bronze trophy
    Join Date
    Jun 2004
    Location
    Stockholm, Sweden
    Posts
    148
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  24. #199
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Brak
    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.
    You are mistaking J2EE with Java and Ruby with Rails. 100x faster ? Could you care to argument ?
    The most beautifull or fastest language in the world won't save you from design mistakes.

    Quote Originally Posted by Brak
    Ruby is one of those languages that make people stay after work to finish a project on
    I stayed after work lots of times with PHP and Java and I find pleasure mostly in things I do.

    Quote Originally Posted by Brak
    - then come home and contribute to open source apps
    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.

    Quote Originally Posted by Brak
    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.
    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.

  25. #200
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by bonefry
    The most beautifull or fastest language in the world won't save you from design mistakes.
    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.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •