Design Approach - PHP, ASP, Rails???

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

rukus206
Forum Newbie
Posts: 7
Joined: Wed May 16, 2007 9:43 pm

Design Approach - PHP, ASP, Rails???

Post by rukus206 »

Hi Folks -

I'm new to the forum, but I've been to countless other forums and I know how off-putting newbies can be. So, I'll try yo avoid that. :D

My background is in data warehousing/business intelligence, so I'm pretty comfortable with SQL. However, I don't know web programming. I'm trying to put together a site that is very organic (social networking, web 2.0, etc). Conceptually, I know exactly what I want the site to do and the functionality I'd like to incorporate. And, it's a website with a lot of socially redeeming value, so I'm extremely passionate about it.

For the last few months, I've been trying to decide which technologies to learn/use. I've evaluated WYSIWYG apps like Dreamweaver and Expression Web, HTML editors, and the like. But, like any other application, it's only as good as the underlying code. I've been comparing server-side scripting like PHP/MySQL, Ruby on Rails, ASP, AJAX. I'm partial to the PHP/MySQL combo since it's open-source and free. The problem is that I've never worked with any of these languages. I'm all for taking the initiative and learning it yourself. However, I know there's a pretty steep learning curve trying to pick up any of the aforementioned langauges. I was hoping to get some advice from experienced web programmers before I go wandering off aimlessly and create sloppy or inefficient code. Part of me is considering hiring someone locally to help out as well, but I'd like to decide on the technology I'd like to use first.

Hope that was clear. And, thanks in advance for any constructive advice you can offer.

Cheers,
JR[/syntax][/quote]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

The underlying technology isn't all that important actually. Provided the pages are engineered well (both client-side and server-side) things will generally run smoothly unless the underlying technology doesn't scale well. Honestly, of the ones you've listed, only MySQL (by itself) scales well. Everything else creates bottlenecks when scaled. Sure, massive sites can be run on them, but that usually requires beefy hardware or extremely efficient code. There are certain things each of the technologies provides that help in scaling.

As with everything else in life, there are drawbacks to all choices.

If I were planning a huge site, I would likely go with Java and/or JSP.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

feyd wrote:If I were planning a huge site, I would likely go with Java and/or JSP.
8O

If I were planning a huge site I would still use PHP. I'd eventually address the bottlenecks with compiled C daemons and/or clustering, if and when the need arises.

PHP's biggest advantage is the incredibly large userbase, followed closely by the excellent manual. The fact that it's just plain ubiquitous doesn't hurt, either.

@feyd(ot): what's so long about your spider?
User avatar
kyberfabrikken
Forum Commoner
Posts: 84
Joined: Tue Jul 20, 2004 10:27 am

Post by kyberfabrikken »

Kieran Huggins wrote:If I were planning a huge site I would still use PHP.
As would I. The nice thing about PHP (And it's open source siblings, such as Perl and Python), is that it's very close to the metal.

I agree that the technology isn't that important. All of the major platforms work -- else people wouldn't use them. What matters is, whether they match to your way of doing things. I think you should experiment a bit with two or three candidates, to see which you like the best. One thing to pay attention to, is the communities. PHP and Java both have very good communities, but they are quite different. This is perhaps even more important, than the technological differences of the language.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

kyberfabrikken wrote:PHP and Java both have very good communities, but they are quite different.
I agree with this, but I have yet to find a Java forum that's:

a) Active/Busy
b) Easy to navigate

I've tried Sitepoint's (Java) forum and it's not busy. I've used Sun's own forum most frequently and have always gotten good responses, but the forum software bugs me. I've also used Java Ranch. PHP seems to have a better choice of busy forums.

I'd say in terms of a learning curve PHP is easy, but the problem with starting in a language like PHP which is so incredibly forgiving is that you run the risk of thinking that bad practices are good. You'll see a lot of PHP tutorials and other code which is badly written and when you're new to the language you won't identify badly written code too easily. This can of course happen in any language, but I suspect that if you started with Java you'd be forced into better programming conventions/practices. You would have a significantly steeper learning curve in the early stages though.
rukus206
Forum Newbie
Posts: 7
Joined: Wed May 16, 2007 9:43 pm

Post by rukus206 »

Thanks for all your responses, and honest feedback. Scalability is something I definitely considered, but neglected to put in the post. I like the fact that PHP has an entrenched user community...I'll prolly need a lot of help!!! I just wanted to make sure that I leave no stone unturned. But, it sounds like most folks are just partial to clean, efficient, scalable code...regardless of the technology. Therein lies the rub. I'm sure experience is what creates that lean code. Experience is where I'm lacking.

What books/online resources would you recommend for someone who has no knowledge of PHP (or and server-side languages, for that matter)?
Regarding scalability, are there specific hardware requirements you'd recommend?

Thanks...JR
User avatar
stereofrog
Forum Contributor
Posts: 386
Joined: Mon Dec 04, 2006 6:10 am

Re: Design Approach - PHP, ASP, Rails???

Post by stereofrog »

rukus206 wrote:I've been comparing server-side scripting like PHP/MySQL, Ruby on Rails, ASP, AJAX. I'm partial to the PHP/MySQL combo since it's open-source and free. The problem is that I've never worked with any of these languages.
Well, if you're starting with a fresh background and don't have any lasting legacy you have to support, I'd recommend Rails or Django. Both are mature and actively developed webdev frameworks, written in modern programming languages, with excellent documentation and community support.

http://rubyonrails.com/
http://www.djangoproject.com/
rukus206
Forum Newbie
Posts: 7
Joined: Wed May 16, 2007 9:43 pm

Re: Design Approach - PHP, ASP, Rails???

Post by rukus206 »

stereofrog wrote:
rukus206 wrote:I've been comparing server-side scripting like PHP/MySQL, Ruby on Rails, ASP, AJAX. I'm partial to the PHP/MySQL combo since it's open-source and free. The problem is that I've never worked with any of these languages.
Well, if you're starting with a fresh background and don't have any lasting legacy you have to support, I'd recommend Rails or Django. Both are mature and actively developed webdev frameworks, written in modern programming languages, with excellent documentation and community support.

http://rubyonrails.com/
http://www.djangoproject.com/

Stereofrog - I've read that comparing Rails and PHP is like comparing apples to oranges since Rails is a framework and PHP is a language. I've heard a lot buzz about Rails. As a matter of fact, I have a web programmer friend who suggested Rails for what I want to do. I'd have him help me but, he's tied up on a big project. So, from a functionality perspective, what's the advantage of going with Rails?
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

Smalltalk (Squeak + Seaside) scales beautifully, too Image
User avatar
stereofrog
Forum Contributor
Posts: 386
Joined: Mon Dec 04, 2006 6:10 am

Re: Design Approach - PHP, ASP, Rails???

Post by stereofrog »

rukus206 wrote: I've read that comparing Rails and PHP is like comparing apples to oranges since Rails is a framework and PHP is a language.
That's true, but you don't program "in a language X", you always use a framework of predefined functions and classes. In php you have a choice between its standard library (which is overblown, buggy and inconsistent) and one of 2-3 frameworks, that, ironically do nothing but imitate Rails.
I've heard a lot buzz about Rails.
For you as a project manager buzz is rather a good thing. More buzz means more community and paid support, more good professionals, more choices.
So, from a functionality perspective, what's the advantage of going with Rails?
That's simple. 1 line of Rails code = 10 lines of php (with framework) = 100 lines of php (with standard library).
Begby
Forum Regular
Posts: 575
Joined: Wed Dec 13, 2006 10:28 am

Post by Begby »

The limitation of rails is that it doesn't integrate all that well so I don't think its ready for enterprise or really large apps. Its great if all you are doing is making a web site and can take advantage of the rails model. But what if you had to integrate your data with a C# app? You would not be able to reuse your Ruby models, all your business logic would have to be rewritten and would now be in two places. This would not be an issue with Java or .NET.

As with any framework, you have to give up some flexibility / integration in order to get rapid development.
rukus206
Forum Newbie
Posts: 7
Joined: Wed May 16, 2007 9:43 pm

Re: Design Approach - PHP, ASP, Rails???

Post by rukus206 »


That's simple. 1 line of Rails code = 10 lines of php (with framework) = 100 lines of php (with standard library).
That's what I kinda figured. I'll prolly be doing most of the initial programming myself since this is going to start off as a personal site. And, it's very different from my area of expertise (data warehousing/business intelligence). So, it's def a labor of love from that stanpoint. It may turn commercial if I can recruit a good programmer to help out, however. So, with that in mind, can you recommend books/online resources for Rails? PHP?
User avatar
stereofrog
Forum Contributor
Posts: 386
Joined: Mon Dec 04, 2006 6:10 am

Post by stereofrog »

Programming Ruby
http://www.pragmaticprogrammer.com/titl ... index.html

Agile Web Development with Rails
http://www.pragmaticprogrammer.com/titl ... index.html

are two "official" books about ruby language and Rails.

http://rubyonrails.com/docs is the primary source for online tutorials and documentation.
rukus206
Forum Newbie
Posts: 7
Joined: Wed May 16, 2007 9:43 pm

Post by rukus206 »

stereofrog wrote:Programming Ruby
http://www.pragmaticprogrammer.com/titl ... index.html

Agile Web Development with Rails
http://www.pragmaticprogrammer.com/titl ... index.html

are two "official" books about ruby language and Rails.

http://rubyonrails.com/docs is the primary source for online tutorials and documentation.
Thanks...
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Design Approach - PHP, ASP, Rails???

Post by Christopher »

stereofrog wrote:That's simple. 1 line of Rails code = 10 lines of php (with framework) = 100 lines of php (with standard library).
But what about the other 999 lines in you application that aren't like that. ;)

Honestly, I think Rails is a great framework and have done a couple of sites with it. But you don't do it any service to boast a order of magnitude in code reduction. That is deceptive at best. Do you have, for example, a Rails based app that has the identical functionality in 10-100 times fewer lines? I checked Mephisto and Wordpress -- the both have around 500k of code...
(#10850)
Post Reply