4 ms·
It's hard for newbies who want to master the language. It's not hard for people who have no interest in learning a programming language and just wan't to make t
by Schlaefer 11y ago
It's hard for newbies who want to master the language. It's not hard for people who have no interest in learning a programming language and just wan't to make the thingy in their HTML do some stuff.
Register globals,
<?php
if ($category == 2) {
echo 'Foo';
}
?>
and be done.
We have to remember the PHP origins and audience from way back to understand why this was considered easy to use.
- Killswitch 11y agoshhhhh, people don't realize PHP started out as just a tool for Rasmus and ended up evolving. No, to them, PHP was DESIGNED this way on purpose from the ground up.
- eropple 11y agoDo you consider that an acceptable excuse for its behaviors fifteen years after the fact? Because I do not.
- Killswitch 11y agoOf course not, but everyone keeps comparing PHP to languages that were designed and developed to be languages, not a toolset that some crappy developer (his own words) created for his personal site that ended up evolving and becoming a real language. It's got quirks, we get it. Let's keep improving the language as we go instead of constantly bashing it. I mean PHP is one of the most widely used languages on the web today.. Clearly it's doing something right.
- eropple 11y agoPeople compare PHP to other languages regularly used in 2015 for web development. In that light, it compares very poorly. McDonald's is super popular, too, and deserves even more of a ration of shit than they get for feeding people slop.
- tormeh 11y agoThat's actually interesting. It's not obvious to me that "2" should be parsed as an int and not a string. Perhaps we should either be explicit about what we want "2" to be parsed as (int, long, float, double, bigint, bigfloat, string...) or let the parsing of a number be determined in a more dynamic way. If you're comparing a string with an integer literal, then you probably want the string interpretation of the literal, right? Not that this is particularly important, I guess.
- Schlaefer 11y agoWe are pretty sure what the literals mean. On the other hand we have many string channels: get/post/cookie/persistent storage¹/… Given that environment its probably natural that you try to convert a string into its "intended" type. ¹no DB, but the "just write your visitor counter into a plain text file" back then
- tormeh 11y ago>We are pretty sure what the literals mean. News to me. You have to enter a really high-precision number as a string in Java so it won't be rounded off to fit within a double. This is an unsolved problem.