|
RonaldMcDonald posted:In my opinion you can see a lot about languages from how they solve simple problems. So, for how would the following PHP code look in RoR? If you want to compare RoR with PHP you would need a framework of some sort, my own combination with adodb and smarty would be... php:<? $db = new Query(); $result = $db->exec( 'SELECT * FROM people ORDER BY lastname ASC' ); $tpl->assign( 'result', $result ); $tpl->display( 'person.tpl' ); ?> code:
On that note, RoR is neat but it's not the solution everyone claims it is. I just don't understand the whole buzz around RoR and why it's so great.
|
# ¿ Aug 9, 2007 03:37 |
|
|
# ¿ Apr 29, 2024 02:11 |
|
floWenoL posted:Because Ruby is just a better language than PHP, and Rails meshes really well with the language. Notice how your PHP framework still requires you to write SQL, assign the result, and name the template manually. Actually I do have a query builder in my framework... that was just a basic example. I'd rather be in control of the queries though, I can imagine inexperienced Ruby developers are writing applications that will easily crumble under heavy load. Not knowing how the framework builds these queries for you and helps you do everything is a sure fire way to write horrible code. From my understanding, a lot of the popular RoR apps override the built ins anyway. I didn't mean to make it a PHP vs. RoR argument, you say "Ruby is just a better language" without stating why. I just wanted to understand why so many people are on this bandwagon because I just can't seem to figure out why I should use this language. I've tried it out but anything that ruby does, perl does better, and the whole rails thing... PHP is more stable and not really a moving target like RoR. edit: I can understand an argument about following proper code ethics, MVC and all of that...
|
# ¿ Aug 9, 2007 06:03 |
|
ryanmfw posted:You keep comparing apples and oranges. Ruby is not an MVC framework, just like PHP. RoR, and PHP along with the several well developed frameworks like CakePHP, Symfony, and CodeIgniter make MVC development easy. Ruby itself does not make it easier, just like PHP itself does not. This is exactly why I don't understand what the big deal about ruby is. Sure it has an "official" framework but other than that I don't see any benefits. Like that other dude said in his argument against perl, the only thing perl excels at compared to ruby is in performance and aesthetics(not sure I agree with that but I'll take it), but what else is there?. I just can't figure out a niche or function that Ruby/RoR fills for me as a developer.
|
# ¿ Aug 9, 2007 18:01 |
|
take boat posted:Ruby is a unix-oriented scripting language with a number of libraries built for it, and it combines a number of programming paradigms and clever language tricks and syntax in a way that many find elegant and usable. Perl, by contrast, is a unix-oriented scripting language with a number of libraries built for it, with a syntax that is nothing short of god awful. Much like Perl and PHP and Python, Ruby has no special domain where only it can ever be used. Alright, that's all I wanted to know, it's just a preference in synax. I guess my issue is just that I'm used to perl, php and other languages that are similar. It's kind of difficult for me to pick up/use ruby because it's quite different and the approach is different than what I'm used to.
|
# ¿ Aug 10, 2007 02:35 |