5 ms·
Eh, I don't really get your question here. Why would you rewrite all your apps with something other than PHP? You wouldn't, of course. Why would you consider
by thenduks 15y ago
Eh, I don't really get your question here.
Why would you rewrite all your apps with something other than PHP? You wouldn't, of course.
Why would you consider a language that wasn't "designed specifically for web scripting"? Because that's an irrelevant criteria for choosing a platform. It makes no difference if something was(n't) designed for a single purpose, only that it is effective for the purpose you require.
A third language worth considering -- how about JavaScript w/ Node.JS?
Benefits to writing web apps in a language other than PHP? Well, you get the benefits of that language - whatever those might be. Benefits might include anything from technical superiority (and what 'technical superiority' means is based a lot more on the application than the fact it's web-based) to it being easy to find developers who know a platform in your city when you need to hire, availability of documentation, or even the general progressiveness of the whole ecosystem (is new stuff happening? is there community interest?).
I think that discounting everything but PHP just because they aren't pigeonholed into web apps (of course, PHP can be used for more than just the web, but let's gloss over this fact) is pretty... close minded.
A counter question: if you like PHP and are productive/happy/etc using it, why would you go out looking for new languages to replace it? You will only discover that they aren't PHP.
- PaulHoule 15y ago"designed specifically for web scripting" is worth a lot. PHP's standard library has a function called htmlspecialchars() which escapes special characters in HTML. If you don't use a function like this, your HTML forms can be destroyed by ' and " characters and crackers can f- up your web site by putting <script> elements on your pages. There is no function like this in the Java standard libraries. Nothing like this comes with JSP or JAX-RS. You can get one in the Apache commons lang project, but a Java web developer who doesn't know this (or write his own) is in deep trouble. PHP is a great tool; it's creators have gotten many details right, and it offers developers the chance to get started without running into gotchas. On the other hand, other languages have things going for them too. Ruby gems and Java's maven are incredible package managers that put PEAR to shame. There's a lot of junk software written in Java, but some of the best open source projects are there too. People are doing interesting stuff in web frameworks in Python, Ruby, Java, C# and many other languages, even PHP.
- ablerman 15y agoWho 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.