SitePoint Sponsor |
|
User Tag List
Results 1 to 25 of 30
Thread: learn ror vs php vs java?
-
Apr 16, 2006, 22:42 #1
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 ?
-
Apr 17, 2006, 01:48 #2
- 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/
-
Apr 17, 2006, 07:20 #3
- 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.
-
Apr 20, 2006, 16:41 #4
- 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".
-
Apr 20, 2006, 17:13 #5
- 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.
-
Apr 20, 2006, 17:27 #6
- 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.
-
Apr 23, 2006, 15:39 #7
- 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".
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.
-
Apr 24, 2006, 18:25 #8
- 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.
-
Apr 24, 2006, 19:41 #9
Originally Posted by jpease
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.
-
Apr 25, 2006, 07:47 #10
- Join Date
- Jul 2002
- Location
- In the network.
- Posts
- 217
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by hpal
Originally Posted by hpal
Originally Posted by hpal
-
Apr 25, 2006, 12:19 #11
- 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.
If you learn this in Ruby:
Code:if something # do something end
Code:if(something){ # do something }
This in Ruby:
Code:(1..7).map{|i| i * 2}
Code:$data = array(1, 2, 3, 4, 5, 6, 7); $a = array(); foreach($data as $c) { $a[] = $c * 2; } return ($a);
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
Code:$data = Array.new(1, 2, 3, 4, 5, 6, 7); $a = Array.new(); for($c in $data) #{ $a << $c * 2; #} end return($a);
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.
-
Apr 25, 2006, 20:01 #12
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 ?
-
Apr 26, 2006, 04:56 #13
- 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.
-
Apr 26, 2006, 23:34 #14
- Join Date
- Apr 2005
- Posts
- 485
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by hpal
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...
-
May 4, 2006, 15:14 #15
- 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.
Originally Posted by hpal
-
May 5, 2006, 05:35 #16
- 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.
-
May 5, 2006, 08:31 #17
Originally Posted by jpease
-
May 5, 2006, 10:41 #18
- Join Date
- Apr 2005
- Posts
- 485
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by hpal
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.
-
May 5, 2006, 16:10 #19
Originally Posted by skeeterbug
also what other uses are there for the forms in html ? since they do not execute ?
-
May 8, 2006, 15:00 #20
- Join Date
- Apr 2005
- Posts
- 485
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by hpal
first, google is your friend. say "hi" and get to know google and google groups. "* tutorial" is a good search start. * might be html, css, php, forms or anything else that interests you. eg, go to google and search for "html tutorial". you will learn a lot and save on the book money.
complex layout with cross browser support via css is incredibly difficult for a newb - just about impossible. the best resource i've found is right here on sitepoint - inthe css section. Paul is "da man." be nice to that guy.
why are forms important? how else are my users going to enter data to configure the products that use my web interface?
how is a shop keeper going to know where to ship a product?
how is a customer going to enter praise/complaints?
what did you use to enter your question on sitepoint?
forms.
forms pass data from the user to the program. it is up to the programmer to take that data and do something useful with it. this is usually done with server side code (php is a great example).
there are 3 basic layers... logic (php, ruby, python, etc), content (html and its contents - text pictures, etc...), presentation (css).
i found all this out on google when i first started. it has been reinforced since.
you have to want to learn this stuff. it isn't easy and it isn't fast. if you want, you can start fast and learn as you go. i did. but i still have a lot to learn, and i've been at this for over a year.
the first step is to install apache and php on your computer. have you done this yet?
-
May 12, 2006, 20:32 #21
- Join Date
- Jul 2004
- Location
- Gerodieville Central, UK
- Posts
- 446
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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.
First of all, let me say as far as web programming environments go, both Java and PHP are not worth even worth considering. They are yesterday's technology. Both might be mature, but both are riddled in annoyances.
Java is simply wrong because the static nature of the language is not suitable for the dynamic nature of web applications. 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. Java will never recover from it's flaws because what makes Java a poor platform for web development lies at language level.
I used PHP for 3 years, and I now hate the language. The language is riddled in bugs and quirks which now haunt the language, such as inconsistent naming of methods, magic quotes, safe mode etc. When bugs are reported the PHP development team are hardly helpful when it comes to fixing things, and PHP has a nice track record of security holes. The only advantage with learning this patched up language lies in the fact most web development companies are still too ignorant to see the faults in PHP.
I know I sound like one of these stereotyped Ruby advodcates here, but at this current point in Time, RoR is the best thing to learn. It's got a large user base and is specifically designed to make you efficient when it comes to writing most types of web apps.
Ruby, and Rails however are not the golden answer to everything. Rails and Ruby are just the start of a new approach to web development. Rails has become popular because it cuts out the tedious parts of web proramming found in older platforms like Java, PHP, ASP, etc. Likewise Ruby is popular because while it's syntax is different from PHP and Java, it is easy for people with PHP and Java knowledge to migrate as the Rails and Ruby platform does not alienate them. Likewise Rails is a more-less complete web-stack, it unifies things like test driven development, doc generation etc.
People seem to be quick to compare PHP/Java to Rails. It's like comparing Apples to oranges tbh.
Where I think Rails fails is outside Database driven apps, and complex workflows. Rails is heavily biased round active record, and the CRUD model most web apps use. Once you get outside this relam, Rails offers a lot less in terms of productivity and tools. This is where frameworks like Seaside (based on smalltalk) seem to come into their own.
If I were you, I would rather look at Rails, along with keeping your eyes open at other frameworks such as Seaside. The one thing that holds seaside back at the moment is that it's too alien for most mainstream programmers who have a PHP/Java backing. This is probably also why Rails has succeeded over Nitro. You should also look at other languages like LISP or io. I think the protoype / continuation based concepts will start to play a big role in web programming further down the line in the future.
-
May 13, 2006, 11:12 #22
- Join Date
- Nov 2004
- Location
- Romania
- Posts
- 848
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Ahh, the same old @MiiJaySung ... back in force.
Originally Posted by MiiJaySung
Originally Posted by MiiJaySung
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 ?
-
May 13, 2006, 14:57 #23
- 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.
-
May 13, 2006, 16:02 #24
Originally Posted by Snaily
Originally Posted by MiiJaySung
-
May 13, 2006, 20:52 #25
- 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
So I was wondering if he had a real justification for what he said.
Bookmarks