3 ms·
If you have to go learn what things are dangerous and must be shut off, and what parts of the language to avoid, surely it would be better to just use a system
by loewenskind 16y ago
If you have to go learn what things are dangerous and must be shut off, and what parts of the language to avoid, surely it would be better to just use a system that doesn't have these kinds of issues?
Imagine buying a car where the salesmen was saying "this is a great car, it will get you where you want to go cheaper and faster than anything else out there. The only thing you have to remember is; 40% of the buttons, pedals and handles in the car will actually make it explode into a rolling fireball if used. Don't do that. You'll also need to open the hood and physically remove 2 or 3 things that are even more dangerous. Oh yea, don't ever put anyone or anything in the back seat. If you remember all that, this car will be a dream!". Would you use such a car? I wouldn't and I wouldn't use a language like that either.
- pornel 16y agoAre you talking about C++ perhaps? ;) There's php.ini-recommended in the distribution and it's well-commented. Not using variable-variables, undeclared variables, globals, unsanitised variables in paths, SQL without prepared statements, etc. is common sense and applies to other languages too. PHP might just bite harder if you lack that common sense.
- loewenskind 16y ago>Are you talking about C++ perhaps? ;) C++ very much applies. :) >Not using variable-variables, undeclared variables, globals, unsanitised variables in paths, SQL without prepared statements, etc. is common sense and applies to other languages too. This is a subset of what you have to avoid in PHP. Further, things like globals can have uses. That's the difference with a really poorly designed language: there are things in there that have no good use case. Not things that are only used in rare cases, things that should never be used.
- Niten 16y agoPHP will bite you, common sense or not. The language has serious misfeatures – platform-dependent integer sizes, or cgi.fix_pathinfo=1 by default allowing the interpreter to execute files without a .php extension, just off the top of my head – that require knowledge and action well above and beyond "common sense" to work around. And all of these faults in the language, even the minor ones, just contribute to the unnecessary cognitive load of using the language. So the way I see it, if I'm starting a new project then why not just pick a sane language like Perl or Ruby or Python instead and save myself all the headaches? It's not 2004 any more, we're no longer constrained to languages that have good Apache modules, and with that constraint gone there are very few reasons to pick PHP over the competition.
- bluesnowmonkey 16y agoHow about buying a car with a standard transmission. There is a lot to learn! It actually takes both hands and both feet just to drive it. You can permanently damage the transmission by shifting carelessly. In some cases you can wear out the clutch over time merely by driving with your foot in contact with the clutch pedal. How could you guess that on your own? Yet despite these warts standard transmissions are quite popular in most of the world, and people get around just fine in them.