by nkozyra · 11y ago · 0 comments
And what makes them bad is they permit, induce or even explicitly teach bad habits.
I agree to not discourage someone if they're doing it, but if you have a chance to steer them in a position where they'll be better programmers, you should do that.
The reality is almost any language allows you to create a single file and run it and see a web page these days. That's not something unique to PHP at all.
PHP wasn't the first language I learned, but it absolutely was the language that got me hooked on programming by giving me the power to create things, visual things, interactive things, and more importantly, let me do so without following a step by step tutorial (I had basic html knowledge prior).
> And what makes them bad is they permit, induce or even explicitly teach bad habits.
Very true, I had some bad habits from php that took me a while to kick, but for me it was a small price to pay.
> The reality is almost any language allows you to create a single file and run it and see a web page these days. That's not something unique to PHP at all.
These days that may be the case, but many commenters here are referencing when they were learning to program, and a decade ago it was something incredibly unique to PHP.
This is not what the parent means. In PHP you get a crappy shared hosting account, and copy a file up to the server via FTP and it works. This is not possible with Python, Ruby, etc... you need to do more server setup in most cases. Sure this is due to historical reasons and maybe not specific to "PHP the language", but that is the situation that most beginners face. It's a very simple mental model as well. Services like Heroku kinda/sorta make it simpler for Ruby/Rails/etc., but understanding how those work and getting the command line tools set up is mentally more complex to a beginner.
Well let's be fair, it's what the parent says. Even so, that's a largely outdated piece of "common knowledge" in 2014.
Five years ago? Sure. Today? Not as much.
With PHP: 1. log in to server via FTP or CPanel "File Manager" 2. find the publicly-accessible document root (htdocs, public_html, etc) 3. upload an "index.php" file to that directory with "<?php echo 'hello world';" in it 4. visit http://yoursite.com/
How would I achieve this most-basic web page on a common shared host in ruby or python?
Bad habits can be induced by a language, but if you are still at the point where you're learning the concept of variables, you're way before the point where you'll begin to pick up bad habits.
Do we have a set of good habits defined? That seems no different a question than "What's the best programming language?" and backed by just as much opinion and authority as "Language X sucks! Use language Y!"