Easy to get started, then what? I didn't learn how to structure big projects until I moved to better languages that encourage (through defaults) better practices.
Predictable !== well defined. If you have to look through a chart for equivalence, it's unpredictable to the programmer. But this is a theme for all of PHP, you can't deduct equivalence, function names and function arguments orders, you have to memorize or peruse the manual. Sure, it works, but it has drawbacks.
I don’t have anything objective to back this up, but in my experience it requires a lot more discipline and initial knowledge from the devs. Much of the existing documentation for PHP is just plain wrong, or horrible advice. It’s difficult for new devs to learn these practices. PHP let’s you be ‘lazy’ and hack in shortcuts to solve problems - lots of discipline required there.
If you have a solid team and some people with a good background in the framework and PHP that can mentor effectively, then it probably won’t be bad. It still would not be my first choice though.
PHP definitely has its annoyances: the function naming scheme alone still drives me mad after nearly 15 years of PHP experience.
That said though, like most IT projects, the more you put in at the start, the more you get out in the end. If you rush into a project and don't plan out even the basics, it only stands to reason that you'll end up in a mess.
Along these lines, I have to wonder how many problems the quick-fix tutorial-style articles cost after developers copy-and-paste in an attempt to hurry through a project. My guess: lots.
Personally, I think it's an exciting time to be in PHP. It's possible to put together complicated, scalable sites in what is really an incredibly short amount of time.
Yep. It's just easier to start a basic site in PHP when you're new. The typical tutorial is "write these four lines in a file and upload it to any host." You're good to go.
Now they shouldn't, but people jumping on JS often spin their wheels until they get pointed to a boilerplate project. It doesn't make for a fair comparison, but it doesn't matter.
Now they're trying to wrap their heads around six major libs with loosely overlapping concepts, four build and orchestration tools, and ten-plus scattered files... for "hello world." Then comes the generally miserable process of figuring out how to put it online.
Throughout this process the reference material is all at least three weeks old, making it hopelessly out-of-date.
I mean, this stuff is often referred to (even here) as a kind of dumpster fire. I can't? imagine what a truly new person would think. So while I'm not starting any new PHP projects these days, it isn't hard to see the general appeal.
PHP is "easy" because anyone can grab some code snippets, rewrite some mysql_query's and have a terrible little my first dynamic website doing in a couple of hours.
Developing something on a large scale or even developing something of a normal size while maintaining good programming techniques and structure can be difficult.
Yes I know but if you want to pickup "web development" as a beginner then chances are you're going to start with PHP unless you are getting trained by someone who happens to be using a different technology.
At least that's how it was back in 2006ish when I started. Its low barrier of entry is exactly why it's easy to make mistakes. You are given 5000 functions and no guidelines other than the ones you make yourself.
One problem I can see with that is, it is very hard for a beginner to see the real flaws of PHP. So after he/she starts to get shit done in PHP, they will have their head so far up their asses that it will take a large amount of your time and effort to convince them to move away to a better language.
For eg, take the case of PHP arrays. If you are a beginner, you will probably have fallen in love with this thing. And when you show them a better language, and they finds out that it doesn't have arrays like PHP, they might feel very unsure about your claims that what ever you are introducing is the better language. If they have found /r/php, then it becomes almost impossible to convince them. You will have to counter the vague bullshit fed by 50 guys from /r/php to make any progress with the matter.
So while the author point about getting your feet wet is important, it is also important that you are not doing that be entering into a swamp that can suck you all the way down.
Interesting point, and I agree that PHP has some properties that make it easier for beginners to get started with (which doesn't necessarily make it the best language to learn with, but definitely an easy one). I wrote my first few programs in BASIC before I graduated to C. Like BASIC, PHP makes it easy to get something running quickly, and horrible to do anything more complex.
The problem comes in when people don't quickly figure out that the language that they started out in should not remain their primary language for any serious project.
The only thing I agree with here is that it is indeed easy to get started with PHP. It's also easy to get started with BASIC. You should not be using either to write a serious application in 2014.
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.
I don't think it is so obvious that almost everyone should choose to base their projects on PHP. The only time it should be an obvious choice is if you have lots of PHP talent.
If all someone knew was PHP, maybe they would struggle to learn something else, but in my case, if I immerse myself in something and learn it and use it, it's not going to take me years to get productive with it. Especially given the limited things that PHP can do, learning to do those in python/ruby/C#/Go took... trivial amounts of time. With the benefit of more functionality and a sane API. (and in two cases, static typing)
Alternatively, if all I knew was PHP, I would understand why someone would be scared of learning something new. I mean, look up and down this thread. Everyone thinks a one-liner hello world is the pinnacle of the ultimate web dev language. Because real web frameworks require an http handler, they assume it's more work or harder. To me, it seems that many in the "PHP is easier!" crowd are too scared or lazy to take the time to learn something else and realize that better separation of concerns and tooling actually allows for faster and safer development.
I think I can explain the problem. I taught PHP for a semester at the college level to Web designers. I had 3 months (1 class a week) to get them from no programming experience at all to having a small web application (a contact list). Mostly they all managed to accomplish the task but obviously there's only time to cover the minimum functionality necessary. In that sense, PHP is easy.
Now, here's the problem, absolutely nothing they learned is useful for building a reasonable-sized long-lasting web application. They didn't use any classes. They didn't use a template engine. They didn't use a database abstraction. They learned PHP but they didn't learn to use PHP to build real applications. So all that easiness of PHP is all wrong. If you want to do it right, it's not easy.
It's only easy to start up to hello world kind of projects.
To build anything useful you quickly discover that it's hard to build from source (both the lang and extensions), some parts unmaintained for years. There are many counterintuitive idiosyncrasies you must deal with to be productive. The ecosystem suffers from the overuse of indirection and reflection. Php only looks easy, but the rabbits hole goes deeper than most other langs.
To be fair, PHP is kinda dangerous, especially in the hands of novices. Honestly, a world with fewer people-who've-never-written-code writing PHP doesn't sound like a bad start to me.
Don't get me wrong, it's possible to write great code in PHP, it's just a language that makes it easy for you to shoot yourself in the foot.
Yup. If I were picking up side work, I'd be very wary of PHP projects - not because of the language, but because I'd be afraid of inheriting a tremendous, unreadable, unmaintainable mess.
That's not to say that it doesn't happen in other languages, but I've never seen PHP code written by a stranger that didn't make me squirm.
Predictable !== well defined. If you have to look through a chart for equivalence, it's unpredictable to the programmer. But this is a theme for all of PHP, you can't deduct equivalence, function names and function arguments orders, you have to memorize or peruse the manual. Sure, it works, but it has drawbacks.
reply