4 ms·
Who cares if it's in a "standard library", as long as it's available in a library?
by ablerman 15y ago
Who cares if it's in a "standard library", as long as it's available in a library?
- PaulHoule 15y agobut you have know about it, and Java programmers have a lot of things clamoring for their attention. Programmers in all languages, including PHP, fail to escape characters correctly. But PHP programmers have no excuse: you can tell them what to do and they don't have to mess with the build system, think about licenses, all that. In a large Java system, you might find you're using 4 different JSON libraries... because 2 of them are used by other Open Source projects your project uses and 5 of your subteams picked 2 different JSON libraries.. Now you've got to deal with bugs in 4 different libraries and if you're doing cross-functional coding you've got to know the idiosyncratic APIs and you can always get your panties in a knot about which library you should use in who's turf. PHP programmers use json_encode() and json_decode() and avoid bugs and wasted time.
- jshen 15y agorails 3 makes strings safe by default. PHP doesn't.
- SaltwaterC 15y agoRails 3 is a web framework. PHP isn't. I am always puzzled by the apple to oranges comparison: Rails vs PHP.
- thenduks 15y agoI normally would agree. But I think this is a unique discussion because the OP is asking why he should use something other than PHP. One might use Ruby because of Rails. So it's not a comparison of PHP and Rails directly, just reinforcing the point that languages/platforms other than PHP (and it's frameworks) are just as useful for web work as PHP is.
- thenduks 15y agoModern frameworks and platforms have incorporated and improved a lot of ideas (some would consider) made popular by PHP. Spend some time getting to know Rails for instance and you'll find that none of the problems you just described apply, and they've solved the same problems -- but better. No need to manually escape strings, no build system, 4 different JSON libraries!? Seamless (you don't even need to call it most of the time) to_json. The list goes on. Yes, you have to know about appropriate libraries to use Ruby for webapps, just like you have to know about the functions available in PHP. It's fortunate that PHP has some of that core stuff built in, because it's package manager blows. If I need to encode json I just incant `gem install json` (but it's probably installed already, or maybe I would have to start right at the beginning with `gem search -r json`?) and call `to_json`. The point is, use what makes you productive. Not being 'designed for web scripting' is meaningless today.
- brown9-2 15y agoand Java programmers have a lot of things clamoring for their attention This seems like a great problem to have.