3 ms·
"It’s been very interesting beginning my trajectory in web development in 2012... [PHP] might be the best language to use in gaining an understanding of the fun
by drostie 14y ago
"It’s been very interesting beginning my trajectory in web development in 2012... [PHP] might be the best language to use in gaining an understanding of the fundamentals of web development... No web development language outside of PHP grants you the kind of flexibility to both (a) produce genuine functionality from scratch, outside of an MVC framework, and also to (b) work within the bounds of MVC in deeply sophisticated ways if you wish."
I believe you have overstated your case, perhaps due to inexperience with other languages. In particular, claiming that any modern scripting language is inflexible sounds a bit crazy.
I have attempted explaining how to get a WAMP stack running, with EasyPHP, to an absolutely new-to-web-dev indiviual who was curious about creating a chat room. Let me just say that the situation is ten times better now than when I was the same age and was poring, lost, over Bruce Eckel's Thinking In Java trying to do the same thing, which must have been sometime around 1999/2000.
These efforts to teach a newcomer reminded me that there's a lot I take for granted. There is a step where you are saying "okay, we've got to see where Apache is; what port is it listening on, how can we get you to phpMyAdmin; here's how you set up rows and columns in your tables and think about a database; no the reason it's not working is because you saved as '.html' and not '.php'; I know you've seen URLs that don't end in '.php' but that requires invoking the Rewrite Engine and teaching you about .htaccess files; oh the header modifications can't be the first thing you emit; here's the docs, you basically have to search them because there is no organizing principle and no way to find out what you can do..."
I agree, Python+Django will make you learn a bunch of weird "modeling" stuff first. To me, setting up the data model at the beginning of an app is like inputting a character name at the beginning of an RPG: as some sources testify [1], you can easily waste several hours on purely aesthetic concerns before you even really start to play.
Nonetheless, Python+Django comes with a lightweight dev server and an interactive console and a routing table, as well as a template language. The knowledge of the database is internalized to the language, so that I don't have to teach someone how to use phpMyAdmin but rather when to use a ForeignKey. If we talk purely about learning to develop on the Web then PHP has much, much more useless overhead.
Sure, eventually we will have to get a production-ready web server communicating with the application, but that can be abstracted until later with Django: it occurs as an up-front teaching cost with PHP.
I say this not even as a Python aficionado per se. If anything I like Node, and Node is nowhere near either of them in offering pleasant functionality.
[1] http://www.cad-comic.com/cad/20030630 http://www.cad-comic.com/cad/20030630
- lucperkins 14y agoI certainly didn't mean to say that languages like Python and Ruby are inflexible! What I meant to say is that you can't use either of them in direct conjunction with HTML the way that you can use PHP. This was what I meant when I said "genuine functionality from scratch." Would I prefer Python+Django/Flask for lots of use cases. Absolutely. As for the "useless overhead," there are things like the command line (which Python and Ruby web dev absolutely demand) standing in the way of some of the other languages. Personally, I strongly prefer the command line for almost everything, but for beginners this is another barrier. My argument was not for the superiority of PHP over other languages, but rather against its casual dismissal from consideration.
- spahl 14y agoWhat advantages does this "direct conjunction with HTML" have over templating solutions? Why do most PHP frameworks implement templates then? Also, if command line is a barrier for an aspiring (web) programmer, he/she should start looking for a new career path.
- lucperkins 14y ago1. I wouldn't want to do anything at a meaningful level of complexity without templates. No question about it. And I think that having so many templating frameworks is wonderful (ERB, Jade, haml, etc.). I was only arguing that PHP lets you dive in without NECESSARILY needing to jump through a templating hoop. 2. Is it unthinkable that a person could start learning web dev and pick up the command line along the way? I started out learning PHP/MySQL on my old Windows machine, terrified of the CLI, and now I do almost everything on it (and have converted my old PC to Linux). If the command line were a barrier at all points in the learning trajectory, then you might have a point. But I also don't think that command line mastery should be held up as a sine qua non of learning web dev.
- spahl 14y ago1. Ok so when is it appropriate/useful to use the power of embedded php (in html) instead of templates? Just for learning the first couple of hello worlds? In my experience it becomes a mess to manage when you start having more than one commiter and more than a couple of lines of code. 2. You don't have to be a command line expert to start using it. All the books at http://learncodethehardway.org/ http://learncodethehardway.org/ show that command line can be integrated in the language learning process seamlessly. No reason to be terrified of it, on the contrary, new coders should embrace it as soon as possible.