Email validation & quick Rails vs. PHP
Date: 12/16/06
(PHP Community) Keywords: php, software, database, web, apache
Was playing with the idea of regEx'ing out the domain of an email address and then doing a gethostbyname() to verify that the email address is valid. I know in some cases this won't work, but was curious if anyone has ever tried something similar. Just trying to come up with more validation measures to protect my employeer and their customers from malicious users.
As for Rails VS. PHP
Rail cons
I am on the final stage of deploying a website built in rails and it's been a fun/frustrating learning experience because I've had to build it with a legacy schema that was mangled along the same lines as scope creep (non-standard keys, non-uniform structure (integer keys here, varchar keys there, variables inside join tables, and a lot of orphaned tables forcing the client software to do what the database should be doing [out of query joins or excessive join tables]). For the most part there is a lot of good things about Rails but it's not an end all, be all tool like some people make it out to be. Multi-page/multi-object (ex. user data mixed w/ purchase data) forms are difficult, breaking the rails way of data validation. Debugging has some nice benefits, but is poorly documented and so far I have not found a Rails equivalent to DBG symbolic debugging.... the best appears to be a rails inline assert/breakpoint object that halts the entire system to allow you a glimpse of the system state at that moment but not the ability to step in/out/over.
Lastly there is no mod_perl or mod_php like Apache component so getting Rails on a current server implementation is somewhere between entertaining to unbelievably frustrating. Further more, though rails has a couple different natively supporting webservers (light, webbrick, mongrel) they aren't as well tested or as versatile as Apache. And lastly there is little to no documentation or guidelines, so if you got to do something out of the ordinary, life gets interesting.
Rails pro's
On the plus side, Rails is rich in features, its easier to write C binary packages then PHP, the ActiveRecord & ActiveMailer packages are extremely versatile and thanks to standard Obj. Oriented mantra's, base/parent methods can be supplemented or completely overridden. Otherwise it's a great rapid development platform and practically promotes itself to being used in series with another scripting language if Apache 2.0's mod_proxy or similar httpd proxy service is used. `httdoc/{rails sub-dir/ &| php sub-dir/ & /static content dir}` Prototype and Scriptalicious (spelling) being embedded and wrapped by Rails helpers make Ajax/Web 2.0 stuff a breeze as well. So if you got a simple project on queue and the time to burn stumbling through Rails, I'd recommended checking it out to see if it can compliment and augment your portfolio. Just be prepared to earn your paycheck for the first couple projects. So for speed and minor enhancements to static content, PHP dominates while for complicated, Ajax heavy applications, Rails feels like a good choice.
Source: http://community.livejournal.com/php/522413.html