SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 30

Hybrid View

  1. #1
    SitePoint Evangelist hpal's Avatar
    Join Date
    May 2005
    Posts
    441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    learn ror vs php vs java?

    Hello, I am graduating in may with a ba in business economics, and to furthure go into an mba of ebusiness I'd like like to learn web programming for advancement as a beginner, shall I learn java or ror or php, because I heared that ruby on rails can perform all their functions and is easier ?
    www.holypal.com
    Christian Social Network
    http://www.KalamArab.com
    Arabic Social Network

  2. #2
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    RoR is easier if you want to do medium/big database applications. Small applications may be easier in PHP. Java is a language, and there are many web development frameworks for it.

    Keep in mind that Ruby is a language, and you have to learn it first, and then Rails (framework). Ruby is very easy, but there are new concepts if you only know standard languages like C or Java. (such as blocks and metaprogramming)

    Here is a list of links about Rails:

    http://ibloggedthis.com/2006/04/16/r...inks-and-more/

  3. #3
    SitePoint Evangelist
    Join Date
    Jun 2004
    Location
    California
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    its hard to say... I learned PHP first and used that for a few years before stepping into the world of Ruby and Rails. One of the benefits of learning and using PHP first was that that language makes you work for what you want. They don't give you anything straight out of the box. Sure, they give you some pretty nifty functions but you have to implement them to get desired results. Nothing is automagical there. But as I stepped into RoR everything was done for me! It cleans out SQL queries, it automatically routes pretty URLs, etc.

    So in my opinion you should learn PHP and use it for a bit first (not a few years like me of course haha) and then pick up Ruby.
    Happy switcher to OS X running on a MacBook Pro.

    Zend Certified Engineer

  4. #4
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Location
    Norway
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think what xmitchx is saying is exactly the reason why you shouldn't learn PHP before Ruby. Because Ruby is a more elegantly designed language than PHP, it is easier to become a good programmer by using it. It's extremely easy to make an app with complete disregard to any kind of software principles with PHP, and it's easy to teach yourself bad principles. Remember that Ruby is a general purpose programming language. PHP was conceived as a domain specific language, and it hasn't really "grown up".

  5. #5
    SitePoint Evangelist
    Join Date
    Jun 2004
    Location
    California
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @Illuminous:

    True, but by learning Ruby and Rails first, you don't get to learn about all those difficulties... and therefore when you move to a more "complex" (though not necessarilly better) language, you neglect to add those features, making your application vulnerable.
    Happy switcher to OS X running on a MacBook Pro.

    Zend Certified Engineer

  6. #6
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Learn Ruby & Ruby on Rails because it is beautifull, after that learn PHP because it is widely used, and after that, if you want to keep going, learn Java because it is powerfull.

  7. #7
    SitePoint Guru
    Join Date
    Feb 2006
    Location
    Pittsburgh, Los Angeles
    Posts
    706
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP was conceived as a domain specific language, and it hasn't really "grown up".
    Almost all the scripting languages were conceived as a domain specific language...
    PHP 4 and PHP 5 are "grown up" languages...which features do they lack that prevent them from being such?


    I really really wish people would stop comparing RoR to PHP and Java...RoR is a framework there are PHP and Java frameworks that will do the same, they just aren't as hyped.

  8. #8
    SitePoint Addict jpease's Avatar
    Join Date
    Jul 2002
    Location
    In the network.
    Posts
    217
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You say your goal is to go for an mba of ebusiness, but I'm not really exactly clear on your purpose in learning to program. Are you interested in learning programming, or it's just kind of a curiousity so you have a clearer picture of the topic?

    Simply want a clearer picture of what "web programming" involves? Then it doesn't really matter which you learn. At the moment PHP is more widely-used than RoR - but a program is a program. There are more similarities between languages than differences. Any language will give you a taste of what programming involves. For a what's programming all about, I think RoR is a bad choice. It's a framework - not a language.

    If you are learning to program with the desire to take your mba knowledge and program a website yourself, then I would recommend RoR - with one caveat - learn Ruby too. RoR is not a language. It is a tool. RoR will help you do things in a best practices sort of way, but it also does a lot of thinking for you - and could possibly be limiting if you never bother to learn the language. It spoon feeds a lot - but knowing the language really adds some power to your toolset.

  9. #9
    SitePoint Evangelist hpal's Avatar
    Join Date
    May 2005
    Posts
    441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jpease
    You say your goal is to go for an mba of ebusiness, but I'm not really exactly clear on your purpose in learning to program. Are you interested in learning programming, or it's just kind of a curiousity so you have a clearer picture of the topic?

    Simply want a clearer picture of what "web programming" involves? Then it doesn't really matter which you learn. At the moment PHP is more widely-used than RoR - but a program is a program. There are more similarities between languages than differences. Any language will give you a taste of what programming involves. For a what's programming all about, I think RoR is a bad choice. It's a framework - not a language.

    If you are learning to program with the desire to take your mba knowledge and program a website yourself, then I would recommend RoR - with one caveat - learn Ruby too. RoR is not a language. It is a tool. RoR will help you do things in a best practices sort of way, but it also does a lot of thinking for you - and could possibly be limiting if you never bother to learn the language. It spoon feeds a lot - but knowing the language really adds some power to your toolset.

    Will I want to learn more about IT, programming, also want to use languages to monitor the code of my employees (when I get one),a nd I'd love t be able to program my ecommerce sites as that would give me that best freedom to choose exactly waht I see the best.
    www.holypal.com
    Christian Social Network
    http://www.KalamArab.com
    Arabic Social Network

  10. #10
    SitePoint Addict jpease's Avatar
    Join Date
    Jul 2002
    Location
    In the network.
    Posts
    217
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by hpal
    Will I want to learn more about IT, programming,
    If you want to learn about programming, in my opinion, PHP or Ruby are a decent place to start. I might recommend PHP simply because it has more of a C-like syntax which will be common in many languages.

    Quote Originally Posted by hpal
    also want to use languages to monitor the code of my employees
    For that it depends on what language your hypothetical employees will be using, though a general programming background will help you decipher regardless of language.

    Quote Originally Posted by hpal
    and I'd love t be able to program my ecommerce sites as that would give me that best freedom to choose exactly waht I see the best.
    For this it is really a matter of taste. For the projects I am currently working on, my language preference is Ruby using the Rails framework. But yours may be different. There are plenty of free beginners tutorials on-line for Ruby, PHP, Java, etc... try a couple out and see which you like best.

  11. #11
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Location
    Norway
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Snaily
    Almost all the scripting languages were conceived as a domain specific language...
    PHP 4 and PHP 5 are "grown up" languages...which features do they lack that prevent them from being such?


    I really really wish people would stop comparing RoR to PHP and Java...RoR is a framework there are PHP and Java frameworks that will do the same, they just aren't as hyped.
    Old thread, but I forgot to answer, so here goes.

    I'm not comparing RoR to PHP. I'm talking about Ruby, the language. I'm not the stereotyped php-basher and rails-praiser.

    One thing I'd love to see in PHP is consistency. First OOP (which I by the way don't claim is the solution to everything) was a slap-on in PHP 4, then in PHP 5 you add interfaces and abstract classes and whatnot, and it still feels like an afterthought. PHP can't decide for itself what it wants to be. The standard library has no conventions whatsoever. There's confusion between references and values. PHP is dynamically, weakly typed, almost the exact opposite of strong typing. And then they go and add type hinting (which doesn't work with builtins)?

    Reflection also feels like an addon. PHP must rely on hundreds of patterns to ensure that programmers to the Right Thing (tm); without, they're totally lost, it seems. Whenever someone complains about how badly many PHP scripts are designed, a bunch of people explain that if they had just used Pattern XYZ, it would all the fine. If these things were obvious and came naturally when using the language, the problem would go away.

    The list just goes on and on. To summarize, PHP doesn't know what it wants to be, and ends up doing none of the alternatives well. I'm not one for language wars (they're fun, but ultimately you've got to choose the right tool for the right job), but I honestly can't see any job for which PHP is the best tool.

    Ruby, Python and friends are great beginner languages, but not PHP.

  12. #12
    SitePoint Evangelist
    Join Date
    Apr 2005
    Posts
    485
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Illuminous
    Old thread, but I forgot to answer, so here goes.

    I'm not comparing RoR to PHP. I'm talking about Ruby, the language. I'm not the stereotyped php-basher and rails-praiser.

    One thing I'd love to see in PHP is consistency. First OOP (which I by the way don't claim is the solution to everything) was a slap-on in PHP 4, then in PHP 5 you add interfaces and abstract classes and whatnot, and it still feels like an afterthought. PHP can't decide for itself what it wants to be. The standard library has no conventions whatsoever. There's confusion between references and values. PHP is dynamically, weakly typed, almost the exact opposite of strong typing. And then they go and add type hinting (which doesn't work with builtins)?

    Reflection also feels like an addon. PHP must rely on hundreds of patterns to ensure that programmers to the Right Thing (tm); without, they're totally lost, it seems. Whenever someone complains about how badly many PHP scripts are designed, a bunch of people explain that if they had just used Pattern XYZ, it would all the fine. If these things were obvious and came naturally when using the language, the problem would go away.

    The list just goes on and on. To summarize, PHP doesn't know what it wants to be, and ends up doing none of the alternatives well. I'm not one for language wars (they're fun, but ultimately you've got to choose the right tool for the right job), but I honestly can't see any job for which PHP is the best tool.

    Ruby, Python and friends are great beginner languages, but not PHP.
    i agree with almost all of what you say, however, i think we need to add that php can be the path of least resistance - even if it isn't the best all around solution.

    iow, php is pretty easy to grasp and program to do useful things. especially simple things. the mind wrap index is high.

    this is good during the initial start up phase. however, as one gets more in depth, the weaknesses of php begin to rear their ugly head.

    i say - start right, even if it is a bit more challenging to learn up front.

  13. #13
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Location
    Norway
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by skeeterbug
    i agree with almost all of what you say, however, i think we need to add that php can be the path of least resistance - even if it isn't the best all around solution.

    iow, php is pretty easy to grasp and program to do useful things. especially simple things. the mind wrap index is high.

    this is good during the initial start up phase. however, as one gets more in depth, the weaknesses of php begin to rear their ugly head.

    i say - start right, even if it is a bit more challenging to learn up front.
    Still, I think Python and Ruby scale down. To the beginner, the difference between
    Code:
    echo "hello world";
    and
    Code:
    puts "hello world"
    is next to none, even though they're really different.

  14. #14
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you want to learn about programming, in my opinion, PHP or Ruby are a decent place to start. I might recommend PHP simply because it has more of a C-like syntax which will be common in many languages.
    Remeber that the semantics of a language are far more important than the syntax. If you have a language feature in language A, and you see it in language B, but with a different syntax, you'll recognise it. If you have a totally new language feature, you will not recognise it. The language features in Ruby which are not in PHP are (among others): first-class-functions/blocks, metaclasses, lexical scoping/closures, continuations a class and everything else is an object. Things in PHP and not in Ruby: inline code/html. (though you can have it with ERB in Ruby).

    If you learn this in Ruby:
    Code:
    if something
      # do something
    end
    and this in PHP:

    Code:
    if(something){
      # do something
    }
    You can see they do the same thing, but:

    This in Ruby:

    Code:
    (1..7).map{|i| i * 2}
    And this in PHP:

    Code:
    $data = array(1, 2, 3, 4, 5, 6, 7);
    $a = array();
    
    foreach($data as $c)
    {
      $a[] = $c * 2;
    }
    
    return ($a);
    Do the same thing. (will return [2, 4, 6, 8, 10, 12, 14])

    Someone who only knows Ruby will understand the PHP version, but someone who only knows PHP will probably not understand the Ruby version, even though it is much simpler. This is true because you can do this in Ruby:

    Code:
    data = [1, 2, 3, 4, 5, 6, 7]
    a = []
    
    for c in data
      a << c * 2
    end
    
    return a
    You could even do this in Ruby:

    Code:
    $data = Array.new(1, 2, 3, 4, 5, 6, 7);
    $a = Array.new();
    
    for($c in $data) #{
      $a << $c * 2;
    #}
    end
    
    return($a);
    (which is really evil)

    You can't translate first Ruby example to PHP (it's not easy, it would involve serious hacks).

    So I think you should focus on semantics instead of syntax, but other assets are important too.

  15. #15
    SitePoint Evangelist hpal's Avatar
    Join Date
    May 2005
    Posts
    441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I picked up a php 4 book, and read the first 50 pages, seem to get the hang of it a little. The thing that you can insert it between html is great. My html skils aren' taht sharp, but I don't think I need to know more with teh newer versions of html editors taht do everything for you. What is teh difference between php 4 and 5 ?

    I looked in the university library and the only book they have was for php 4 and the rest were new books on php (most popular ones in amazon) but were and did not seem to suit me. it is hard to read from teh screen between classes like I'm doing with teh book, but since I am learning php 4 will it be hard to upgrade to php 5 ?
    www.holypal.com
    Christian Social Network
    http://www.KalamArab.com
    Arabic Social Network

  16. #16
    SitePoint Evangelist
    Join Date
    Apr 2005
    Posts
    485
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by hpal
    I picked up a php 4 book, and read the first 50 pages, seem to get the hang of it a little. The thing that you can insert it between html is great. My html skils aren' taht sharp, but I don't think I need to know more with teh newer versions of html editors taht do everything for you. What is teh difference between php 4 and 5 ?

    I looked in the university library and the only book they have was for php 4 and the rest were new books on php (most popular ones in amazon) but were and did not seem to suit me. it is hard to read from teh screen between classes like I'm doing with teh book, but since I am learning php 4 will it be hard to upgrade to php 5 ?
    actually, inserting php within htm is great only for small scripts. for medium scripts, especially when you haven't looked at them in a while and they do things beyond the trivial, it is a pain in the rear. for huge, complex scripts... it is called spaghetti code - and that ain't good for a number of reasons.

    it is simple to understand, but very complex when you have to troll around 3000 lines of code to try and debug issues.

    for large pages... dead man walking.

    as much as possible, keep the logic separate from the presentation separate from the content.

    if one knows php first, they will see the value in ruby on rails almost immediately. if you are interested in RoR, learn it and skip php altogether. once you learn rails, you can still learn php.

    it is rather silly to learn php before rails in order to see the "benefits." did we all learn assembly before we learned php? i didn't think so.

    so much to learn... so little time...

  17. #17
    SitePoint Member
    Join Date
    Mar 2004
    Location
    Germany
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As has been mentioned before, Ruby is a great language to learn programming. The syntax will stay out of your way and let you concentrate on solving problems and getting things done. Although it is possible to write sloppy programs in Ruby and it is possible to write cleanly engineered code in PHP, Ruby will make it easier to pick up good habits and produce well thought-out code. Armed with Ruby knowledge, you can always delve into PHP. PHP is good to have under your belt as there is tons of PHP software out there being used on the web and you'll probably have to at least understand the language to be able to tweak or adapt something, even if you don't use PHP for your own stuff. Yes, there are quite a few PHP frameworks out there (including a lot of Rails-"inspired" ones) so you don't have to write spaghetti code in larger apps.
    If you're mainly going to be doing your own apps from scratch, Rails is a great framework for many uses. You'll be able to use your Ruby knowledge and produce things that would be much more of a hassle to do even in PHP or Java frameworks.

    But, diversity is a good thing. There's always something to learn from other languages and solutions, even if you're not going to use them much in the end. Python is another language that's probably better suited to learn first than PHP. It's got some promising frameworks, too. Ruby is probably the one combining the most power with elegance, that's just my opinion. Take a look around and decide for yourself.

    Quote Originally Posted by hpal
    My html skils aren' taht sharp, but I don't think I need to know more with teh newer versions of html editors taht do everything for you.
    If you want to do any web development, you'll actually need to know HTML. A WYSIWYG editor may help you whack up a static page quickly (with a lot of bloated source code) -- and yes, I know you can insert snippets of PHP in something like Dreamweaver here and there -- but you won't get very far. What if you need to generate certain HTML elements with certain attributes and properties based on some program logic (in other words, routine web dev stuff) ? Hard to tell an editor how to do that. HTML is the most fundamental thing any web designer or developer should know -- in any real-world situation you will be confronted with that layer. Sorry, I'm not ranting against you but the apparently widespread notion that editors will "do it all for you automatically" is seriously problematic in my opinion.

  18. #18
    SitePoint Addict jpease's Avatar
    Join Date
    Jul 2002
    Location
    In the network.
    Posts
    217
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have to strongly agree with zendak. While Ruby / Python / Java do not implicitly require, or even have anything to do with, HTML - if your purpose is learning to program for the web HTML is not optional. That should be your first target. HTML is a cakewalk compared to the other metioned languages, so I can only guess that you haven't bothered to dedicate any time to learning it.

  19. #19
    SitePoint Evangelist hpal's Avatar
    Join Date
    May 2005
    Posts
    441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jpease
    Have to strongly agree with zendak. While Ruby / Python / Java do not implicitly require, or even have anything to do with, HTML - if your purpose is learning to program for the web HTML is not optional. That should be your first target. HTML is a cakewalk compared to the other metioned languages, so I can only guess that you haven't bothered to dedicate any time to learning it.
    actually I'm reading an html book righ now,a n feel that it is pretty simple, I think I might need another book, as I already know half of the codes from before, but need to learn more about executable html that conects to forms, and databases like access.
    www.holypal.com
    Christian Social Network
    http://www.KalamArab.com
    Arabic Social Network

  20. #20
    SitePoint Evangelist
    Join Date
    Apr 2005
    Posts
    485
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by hpal
    actually I'm reading an html book righ now,a n feel that it is pretty simple, I think I might need another book, as I already know half of the codes from before, but need to learn more about executable html that conects to forms, and databases like access.
    first off, html doesn't "execute." that's what php, ruby, java, python, perl, javascript, etc. are used for - to execute scripts.

    html makes up the "scaffolding", to borrow a ruby term, of the presentation layer. css is the blueprint and the paint. the analogy isn't exact, but it is reasonably close.

    horm handling is pretty easy to understand, too.

    this tutorial should get you started...

    http://www.onlamp.com/pub/a/php/2004...mhandling.html

    however, i choose to use a forms class b/c it gives me incredible power i wouldn't otherwise have available. i use Manual Lemos' form generation and validation class from phpclasses.org. Read through the docs and look at his code.

    db access usually depends on the db of choice. i use postgresql due to its generous BSD license and the fact it is an awsome database.

    its awards are listed here...

    http://www.postgresql.org/about/awards

    most folks use mysql, but that gets complicated if you want to resell the product. you may have to buy a license. obviously, though, mysql has filled a very big need - and they deserve major props for doing so.

    instead of using the native postgresql api, i chose to use a db abstraction layer named adob. basically, you send it certain kinds of key information and it does whatever is required to interact with you db of choice, be it postgrsql, mysql, oracle, etc... in theory, one piece of code will work on all the different platforms, enabling code portability. in practice, nothing is perfect.

    you can learn a lot right here...

    http://phplens.com/lens/adodb/docs-adodb.htm

    both classes work within php.

    i'm now moving over to ruby on rails due to its rapid prototype ability and built in best practices (for most apps, anyway).

    this stuff isn't trivial and it will take some time to get up to speed. if you thought you'd spend a weekend and be able to "talk the talk," you will likely be disappointed.

  21. #21
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP5 is a lot like PHP4. If you are learning it, you won't notice the difference until you start doing more advanced things.

  22. #22
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ahh, the same old @MiiJaySung ... back in force.

    Quote Originally Posted by MiiJaySung
    I'm gonna assively throw a spanner in the works here, and I know what I am about to say will irritate the hell out of some members here, but this this my opinion so I don't give a damn about what others think.
    Have you ever thought about the posibility that others don't give a damn about what you think ?

    Quote Originally Posted by MiiJaySung
    Java will never recover from it's flaws because what makes Java a poor platform for web development lies at language level.
    If the language is what gets you wet ... don't you know that Java, the platform, supports multiple languages ?
    Oh yeah ... I know ... Java is so `90 ! Right ?


    And btw ... LISP and Smaltalk ?
    That should get your audience excited.
    Wanna bet you haven't even tried them ?

  23. #23
    SitePoint Guru
    Join Date
    Feb 2006
    Location
    Pittsburgh, Los Angeles
    Posts
    706
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Java is simply wrong because the static nature of the language is not suitable for the dynamic nature of web applications.
    Why are strongly typed languages wrong for web applications?

  24. #24
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Snaily
    Why are strongly typed languages wrong for web applications?
    He gave his answer in the following sentences:
    Quote Originally Posted by MiiJaySung
    When you write a web site you really are not gonna give a monkey's about should this be a string, an int. Likewise you don't want to be spending your day going round in circles with bloated frameworks, and XML configuration hell.

  25. #25
    SitePoint Guru
    Join Date
    Feb 2006
    Location
    Pittsburgh, Los Angeles
    Posts
    706
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    He gave his answer in the following sentences
    Yes I obviously didn't consider that a real answer as its total nonsense. You often care whether something is a string an int...such as when validating data.

    So I was wondering if he had a real justification for what he said.


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
  •