Random Etc. Notes to self. Work, play, and the rest.

Ruby on Rails? PHP + Smarty? C# / VB.NET? Something Java-esque? Python? Perl?

There's been a great deal of fuss recently about Ruby On Rails. Is it just hype, or is it really so simple?

I've got a few ideas for simple web-apps, and I'm looking to learn something new (you know, for fun). I like to code. I like elegance and neatness. I wouldn't mind being able to leave the graphic design to a real designer. I think I know what I'm doing, but I don't know where to start.

I'm not a databases person, but I know a reasonable amount about SQL Server, and I think I know how it differs from MySQL. I don't really know how things talk to databases - when I've done it in PHP/MySQL or ASP/SQL Server it's just been magic. I've played around with phpmyadmin (if that's what it's called).

I know what code-injection is. I know what session variables are. I know the difference between POST and GET. I know about HTTP headers and meta tags. I know why not to use client-side VB, and I'm pretty handy with javascript. I know the difference between HTML and XHTML. I know what a socket is. And a port. I've never really understood CGI. I don't really know what XSLT does to XML, and I don't think I want to either. I like the look of xpath. Unicode is pretty good, and essential.

I'm very Java-literate - that's my day job, and my hobby with Processing - but I've never looked into JSP seriously. Somebody said something about a TomCat. I can write proper C++ with templates and namespaces and exceptions and everything, but I probably write it like a Java programmer (and I never understood all the arguments about strings, and pointers). Would I like C#? If I'm familiar with ASP and VBscript, would I like VB.NET? I'm not a Microsoft person.

I've done a bit of bad C programming using cURL and OpenGL. I know a bit of Python, but I've never done anything serious with it. I know a bit of Perl, but it gives me the creeps. I know a bit of VBScript, but much of it seems back-asswards. I know a bit of PHP, but it likewise seems a bit messy (though intuitive, and I like the look of Smarty). LISP isn't out of the question. If someone wrote web-apps in Prolog, I would probably find it fascinating but it too would give me the creeps.

So... What are you using, and why? If you were learning from scratch, what would you choose, and why?

Why shouldn't I use Ruby On Rails? And what should I use instead?

Bear in mind you have to get me away from Why's Poignant Guide To Ruby...


11 Comments

Go with Python. Perl sucks, as you mentioned. Ruby is too Perly in its syntax for me to get past, although it certainly looks to have much merit. You mentioned “elegance and neatness,” and you aren’t going to beat Python for those. I use it for cgi web stuff with MySQL back ends, very easy to work with.Good luck!Chrishttp://www.fetidcascade.com/ (handcrafted with Python)

Posted by Anonymous on 24 January 2005 @ 9pm

Well.. I haven’t used Ruby on Rails a whole lot, but I am seriously looking at it right now. I’m a PHP programmer by trade with very similar set of computing experiences/interests as you.So let’s talk about what makes Ruby on Rails interesting…1) Ruby - Ruby is a very elegant OOP that feels very comfortable. Dynamically typed and very flexible/open. Ruby on Rails especially is leveraging it’s power from the language. If you like Python, you’ll love Ruby. Extremely fast prototyping and very powerful.2) MVC - It implements a MVC pattern that makes code separation and modular programming a breeze. ROR really is that simple. I’m sure you’ve heard of MVC since you’ve programmed with Java/python. It’s very different when one does web programming because the web is inherently stateless. You don’t have persistent objects but being stateless is probably the biggest strength of web programming… Scalability. 3) Action Records - It’s a DAO(Data Access Object) described in Fowler’s Enterprise pattern book… The concept of an Active Records is pretty simple, but Ruby’s ability dynamically bind methods to objects in run-time makes it this implementation very elegant and easy to use. I highly doubt you’ll find an implmentation in C#/Java/PHP that rivel’s ROR’s Active Record. Checkout the 10 min movie and you’ll see the why people are getting so excited about ROR.3) Great community and support. ROR is attracting an unbelievable following… People are extremely nice in the IRC channels and the documentation on the ROR site is superb. It’s rare to find this level of participation for a project so young.So, having said all that what do I think of ROR? It’s a great framework and I would definately recommend using it for your future projects. Especially since you’re not experienced with web programming. (once again i’m assuming) ROR is probably the easiest MVC framework to work with right now and it would be a great learning tool for understanding design patterns in a web programming environement.However, MVC is nothing new. ROR’s style of MVC is already implemented in a PHP project called Mojavi which is already in it’s 3rd version and does far more than what ROR is capable of doing now.Personally, I’m not so excited about ROR… Except for the Active Record DAO, there’s really nothing new about ROR. Mojavi and other MVC frameworks in PHP are several iterations older and much more mature. And I’m not talking about Struts style MVC… Mojavi and ROR implement a directory based dynamic loading page controllers which makes managing the site structure a breeze.I really like PHP as a language, but I think Ruby is more elegant. When it comes to web programming, the speed at which PHP and Ruby/Rails allows me to program is the biggest reason to use PHP/ROR. If I use PHP, I use Mojavi. PHP is everywhere, but Ruby is hard to find on most ISPs or Web Hosts. Due to client needs, I tend to use PHP. If I’m developing a new app and I’m not concerned with clients/users, then I would definately consider ROR first.BTW, I also program with ASP.NET/C#… it’s clunky and there’s way too much overhead to keep track of to get a decent site running.It comes down to your preference in language. Python with zope/plone is also a great choice. Some might say that this is the best choice. ;^)I hope this helps… Sorry for going on and on…

Posted by Anonymous on 24 January 2005 @ 9pm

The combination of PHP and Smarty is absolutely brilliant. PHP is tailor-made for web applications. It can talk to databases, filesystems, http servers, ftp servers, and is almost completely cross-platform from Windows to Unix.Smarty is a templating library that allows complete separation of business and display logic. It is readily extendable, and is being incorporated into more and more open-source projects.One of the huge attractions to Smarty is that it compiles the templates into PHP code, so you don’t suffer the overhead of templates including other templates, etc. Which means that if your code will be more elegant by including templates from other templates, then go right ahead — there is no performance penalty!Mike van Lammerenmike-spam@emerge2.com

Posted by Anonymous on 1 March 2005 @ 3pm

I’m a fairly experienced web application developer (it’s been my job for 5 years).I started with Frontier, became a WebObjects developer, and have also worked extensively with PHP/Smarty (We developed our own action-controller-based in-house application framework based around Smarty, SmartyValidator, adoDB)I’m not deep into RoR yet, but I am incedibly excited with it. Why? It automates all the the tedious things that I already know how to do, have done many times over and over, and wish I would never have to do again.Already, after only a few hours playing with it, it would be my first choice for developing a new project (assuming I have the choice of dev environment)

Posted by Last Obelus on 6 March 2005 @ 7pm

I say JAVA. You’re never going to beat JSP, Struts and Java in the areas of functionality, flexibility, power, scalability, and documentation.Bottom line: anything but php.

Posted by Anonymous on 30 March 2005 @ 3am

This post has been removed by the author.

Posted by PHP on Trax on 16 July 2005 @ 6am

So much controversy between PHP and rails. There are at least two groups I know of that are putting PHP on rails. Sure it’s not the same, but I forsee this as a bridging to get PHP developers to transition to ROR. The one that is further along and more closely follows the ROR design is PHP on Trax. I believe it is an open source project and documentation is in the works, but it follows ROR to the T. You can get centrailzed documentation at RailDock

Posted by PHP on Trax on 16 July 2005 @ 6am

php on Rails?http://bennolan.com/biscuit/http://www.cakephp.orghttp://www.phpontrax.com

Posted by ynzheng on 29 September 2005 @ 6am

I agree with most of the points of anonymous above. The biggest one being Active Record. After looking at a bunch of MVC frameworks for PHP, ROR’s active record keeps me going back. It’s simplicity and power is amazing.So far, only PHP on trax has a comparable active record class.I’ve been contemplating a PHP on Trax/Smarty hybrid. Unless I find a Smarty-based framework that has an active record clone.

Posted by Anonymous on 21 February 2006 @ 10pm

Perhaps you would be interested in the following Yet Another Personal Opinion article. The author has concisely summed up his opinions and I think, having similar development experience to him, that he has several very good points. http://www.cabochon.com/~stevey/blog-rants/tour-de-babel.htmlIn response to another anonymous poster, I disagree with the notion that Perl sucks. Step away from all those academic and “elegant” notions about programming. If you want to get some work done and need huge community support, give Perl or PHP a good look-see. PHP is the easier side of your two options to pick up and for smaller to mid-size projects it makes a good fit. Use Perl if you want to actually get anything done; it’s the ultimate glue language and it’s been around long enough to become one of the more practical languages.If you really want elegance, though, give Lisp a serious try. It’ll change the way you look at languages. And yes, there’s always mod_lisp for Apache.Happy hunting.

Posted by Anonymous on 15 March 2006 @ 4am

Well from a personal perspective I’m a “Use the right tools for the job” kinda person. Be it Perl, ASP, JSP, actionscript or whatever (just rarely PHP). Now the thing about ROR is that it heavly leans on Ruby as a core part of it’s identity ans style, now I’m finding that a shock to the system but much more pleasurable than using any of the PHP frameworks out there. Working in ROR feels like you’re working in something clean and crisp even when there are bugs. Wheres I always come away from PHP feeling frustrated (I always fely that PHP was too “Microsoftian” in it’s overall feel)Anyway to summerise, I think you’re going to come across problems and limitations with any framework you choose but IMHO I think the ones in ROR will most likely annoy you the least.

Posted by Curtis Fletcher on 6 June 2006 @ 8am