News for hackers. Stuff that matters.
Re:What programming language should I start with? by brlewis on Tuesday August 21, 2007 @09:12AM (#44766)
How exactly did PHP ever make it "very easy" to do web programming? Was that when register_globals was on? Was it that there was plenty of example code to cut and paste?

I hear this "easy" term applied to PHP by many people, but when I look at the language itself, I don't see it. PHP is easy for me because I did C for 12 years, but I look at the comp.lang.php newsgroup and see newbies tripping over all sorts of things.

Re:What programming language should I start with? by mechanical_fish on Tuesday August 21, 2007 @10:35AM (#44787)
There is a well-worn path for beginners in PHP, with baby steps and encouragement all along the way. You can gradually mix PHP into your HTML site, line by line and file by file, and make your site better with each step. (Look, I've got the date in my Web page and it actually updates!)

There's a tradition of building simple CRUD apps in PHP - a handful of database tables, and a PHP file for each URL that acts as a thin glue layer between raw SQL and HTML presentation. These are some of the easiest Web apps to understand - which is not to say that they are actually easy - and they are a good place to start.

By contrast, learning something like Rails requires a big up-front investment. There are objects. There's a database and an ORM. There's an MVC framework. There's an abstract mapping between URLs and the methods of your controller objects. All of this makes great sense once you can see the big picture, but to a brand-new programmer PHP must look a lot less intimidating.

Re:What programming language should I start with? by SwellJoe on Tuesday August 21, 2007 @04:07PM (#44942)
"There is a well-worn path for beginners in PHP, with baby steps and encouragement all along the way."

Down that path lies madness. I've seen the newbie-focused tutorials for PHP, and it explains a lot of the garbage that passes for software in the PHP world. It is entirely possible to write good software in PHP (I'm reasonably impressed by the Dokuwiki and Flyspray code, for example), but you have to learn the language at least twice to get to that point. You learn it as a newbie, and learn horrible practices from the vast collection of misguided "help" in the Internet. You produce lots of code with those horrible practices...like no DB abstraction, inappropriate or no use of objects and encapsulation, and "gradually mix PHP into your HTML" design. And then you realize you've built an unmaintainable mess and start rewriting it with all of the better practices that have since been bolted on to PHP.

Of course, despite all of that I still recommend PHP for a large classes of application because it is pervasive, hard to make pathologically slow (whereas Ruby and Python can be made pathologically slow even by really good developers--see Plone for an example), and has a pretty large selection of libraries (some are so bad as to be counter-productive, but many are good). But as a newbie language it's rather toxic.

Re:What programming language should I start with? by davidw on Tuesday August 21, 2007 @09:45AM (#44773)
Compare to mod_perl circa 1997/8/9, any of the Java stuff... Python didn't have anything that great. ASP was probably fairly easy, but limited to Microsoft. The Tcl guys could have competed, but screwed things up and didn't release much as open source until after I created mod_dtcl, which turned out to be too little, too late.

With PHP, it was and is very easy to get started. I wrote about it here some:

http://www.welton.it/articles/scalable_systems.html