From: Robert Klemme Date: 2010-11-17T17:40:44+09:00 Subject: Re: Ruby vs PHP for the web On Tue, Nov 16, 2010 at 8:30 PM, lkfken wrote: > On Nov 3, 5:49 pm, Ruby Me wrote: >> I am not here to say that PHP is better or the opposite, I am here to >> ask, how web development in Ruby compared to PHP. Does Ruby use the same >> tools? for example MySQL and Apache? >> >> And the most interesting point, which language can create a web >> application with less code? (I am talking about the languges not the >> frameworks). > I wrote programs in Assembly. > I wrote programs in BASIC (i know...but it was considered IN during > the 70s/early 80s), then PASCAL, JAVA, and now Ruby. > > If you have develop programs in Assembly before, then you'd know you > have write so many lines in order for it to do so little... > > Thus comparing number of lines is really pointless, because if you > want, you could add a lot more lines yourself by not using any > "standard libraries" Interesting tidbit: research has shown that developers have roughly the same productivity in lines of code per day _independently of programming language_. From that automatically follows that with more preproduced code at your hands (either in libraries, interpreters or compilers) your overall performance increases. > This is one of the reasons why OOP is the mainstream now -- re- > usability. > But the trade off of this re-usability is "performance".  This is due > to all the overheads you added by using the "standard libraries"  But > this could be neglected with better hardware performance... I am not sure this analysis is correct: typically, if you have a library with a good implementation efforts have gone into it to provide a good interface and to optimize it. While it might be relatively easy to implement the same functionality yourself, doing so in a robust, bug free *and* efficient way typically involves significantly more efforts. Of course, if one uses a library in unintended ways it might perform poorly - but then you are using the wrong tool anyway. > So to answer your question, you have to tell us WHY you want to create > a web application with less code?  If you answer is "Performance," > then you picked a wrong measurement (# of lines).  Instead you should > use "number of cycles" Absolutely! And: /first/ measure, /then/ judge. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/