5 ms·
Give us a break, as a language PHP is a terrible language, and yes I do develop and get paid because of PHP, and I do so for the same exact reason you listed.
by segmondy 10y ago
Give us a break, as a language PHP is a terrible language, and yes I do develop and get paid because of PHP, and I do so for the same exact reason you listed. It pays the bills and does so handsomely too.
I have 20 yrs of programming experience in various languages than I care to count, as much as 20! So I do know my languages. From an academic perspective, PHP blows! But from a practical standpoint, it's a tool. It get's the job done, so long as you know it's quirks, you can avoid them. It's much better now with the OOP support and with PHP7 supporting scalar type and return types declaration. It's going to even make it possible to develop more robust software.
I'm indifferent to hearing about PHP sucking. So people say it as a put down. Perhaps they groovy or scala. I really don't care. It pays and that's all I care about. When I engage in my own personal projects, I never use PHP. PHP's documenation is not bad, but best-in-class? Please! With that said, I agree with your last sentence, in the sense that a good programmer can get more done with a bad language like PHP than a bad programmer can get done with whatever the hell one chooses to consider a good language.
- ams6110 10y agoIs it any worse than Javascript, if we're honest?
- bduerst 10y agoBoth have their issues, but js is probably a little more advanced with prototyping.
- pdpi 10y agoYes it is, and I really don't like JS much to begin with. There's seriously wonky things in there like the associativity on ?: being wrong, and == being even more broken than in js. There's order of arguments on array_map and array_filter being inconsistent. It's not that there's a massive flaw in there that kills it, it's death by a thousand paper cuts.
- mywittyname 10y agoPHP's massive flaw is that it does one thing very well (web-dev), but does everything else rather poorly. It becomes the default choice for projects that start out as a web front-end, but then gets used in other situations where it's ill-suited. A lot of PHP projects have components that are hacked together and work, but are confusing and less-than-ideal from a design perspective. Threading/asynchronicity comes to mind. I've worked on a few projects that started out as a web-front end, but then needed to do some background processing. Eventually the background process needs to be multi-threaded and the choices are: rewrite your code to support pthread's wrappers classes, use fork and shared memory segments, asynchronous web requests. All those solutions work, but they are much more complicated than the same task would be in most other languages with native threading support.
- LoSboccacc 10y agoJavascript ain't that bad, it's interacting with browser exposed api variants that sucks but there are many wrappers to solve that issue. The real annoying part is that by nature it will never have the same amount of IDE niceties you'd get with more typed languages
- piva00 10y agoNo, JavaScript has a lot of quirks like the '==' vs '===', empty arrays equalling to false or this kind of stuff: http://stackoverflow.com/a/1995298/398142 http://stackoverflow.com/a/1995298/398142 I understand JS having its place as being ubiquitously supported in browsers but, just as PHP, it's bad and its problems are not about niceties from IDEs or static typing.
- wtbob 10y ago'Not worse than JavaScript' is a low bar to clear. JavaScript has exactly two advantages: it is deployed everywhere, and it is dynamic. The latter means that with sufficient pain one can accomplish whatever one needs to. It's not quite bad enough to count as a Turing tarpit like INTERCAL or brainf*ck, but it's one of the closest mainstream languages to the tarpit.
- kahnpro 10y agoI like to call JavaScript "the PHP of the 2010's"
- nuncanada 10y agoI prefer PHP to Javascript... And PHP does sucks.
- qihqi 10y agoPHP is like Javascript in that both languages are now being used to do what they were not designed for.
- spitcode 10y agoIn my opinion JavaScript is being used exactly what it was intended for now more than ever. It was originally supposed to be based on Scheme (an elegant functional language) and after many years the trend of functional reactive programming has finally become mainstream. I find it quite sad that most PHP developers seem to think that writing code that looks more like Java is the "correct" thing when its greatest features have always allowed loose types and first class functions. After all that's what makes it so easy to work with? Perhaps PHP could have been more like Scala a few years back already.. the perfect combination of Objects and Functions...
- segmondy 10y agoNo, they are both the same, where else can you evaluate '5' + 2?
- frik 10y agoPHP is more or less a dynamic typed C++ especially tailored for web development, that's how I see it. PHP originally borrowed a lot from C (syntax and function names) and later borrowed a lot from C++, Java and even JavaScript. I like PHP and JavaScript a lot. They are not perfect but these organically grown languages tend to be better from my experience.
- VoidAgent 10y agoWOW... i mean PHP is nothing like C++. It is closer to some sort of dynamically typed C with classes. C++ is not just C with classes it is much much deeper language. That being said, C with classes for web is not bad thing to be. And yeah I HATE inclusion in PHP... it's a mess
- vorg 10y ago> Perhaps they groovy or scala You're using Apache Groovy as a counter-example to PHP blowing? Groovy's the PHP equivalent in the JVM world, the sloppy partner to the more exacting Scala, Clojure, and Kotlin. Since its first release in late 2003, Groovy's been extended and repurposed so many times it's not really one unified language anymore. The MOP stuff was added for Grails in 2006, the half-baked types when generics were added in v 1.5, the pluggable annotations in v 1.6, the command syntax in v 1.7 to appeal make Gradle builds look nicer, the static typing in 2.0, traits in 2.2, the unsuccessful switch to Android deliverables after that, with backwards incompatibilities between minor versions. And then there's the stuff that silently got dropped, like interceptors and empty try statements. Groovy's OK for quick'n'dirties scripting Java classes and defining builds, but for actually building systems use a language built from the ground up for that purpose, e.g. Java, Scala, or Kotlin.