18 ms·
I started freelancing in my area doing Ruby on Rails, and found it far harder to maintain a project. I also found it harder to acquire clients in my area for ne
by trebor 10y ago
I started freelancing in my area doing Ruby on Rails, and found it far harder to maintain a project. I also found it harder to acquire clients in my area for new RoR development.
More work was available locally with PHP. Clients were more willing to pay. I've done a ton of things in WordPress that shouldn't have been, "to save money". And I've done greenfield development with CodeIgniter, Laravel (v3 and v5), and a customized set of the Symfony components. I've also maintained and improved brownfield projects that were outsourced.
I'm very tired of hearing that PHP sucks. PHP is a good language. And in my opinion, it has fewer ways to sabotage your own project than any language with monkey patching. PHP7 looks really awesome, and the community has been upgrading quickly toward it. PHP has always had best-in-class documentation in my opinion.
More often it's the programmer who sucks, not the language.
- Moru 10y agoAmen to the above
- arenaninja 10y agoCurrently working on a PHP7 project with Slim 3. I can confirm, it's the bee's knees
- spriggan3 10y ago> And in my opinion, it has fewer ways to sabotage your own project than any language with monkey patching. It's not like rails is the only alternative.
- trebor 10y agoRight, and who's paying me to work with one of those alternatives? No one. My reference for what you quoted was a Rails project written by a Python dev who thought he needed to make Ruby more like Python. The resulting code was so horrendous that I literally cannot tell which of 2-3 parts that compose one feature (all heavily monkey-patched together) is responsible for what. It's like 2-3 complete implementations, but depending on load order any piece of the 2-3 implementations could be handling it. The client didn't have the time required for me to fix it. ... to quote myself: > More often it's the programmer who sucks, not the language.
- spriggan3 10y ago> Right, and who's paying me to work with one of those alternatives? No one. Give me a break, it's not like there are only PHP jobs out there. If you can't find anything else then it's because you're not capable of coding something that is outside PHP domain, IE basic CRUD apps ..
- trebor 10y agoAd hominem attacks won't get you anywhere.
- burnstek 10y agoA lot of software developers are are also business people. They focus and make decisions based on the needs of the organization, given the local job market, current staffing, past investments, the future roadmap of whatever product they are working on, etc. If PHP is the best route, then that's not something a business person is going to spend a lot of time worrying about. In many ways, if a "coder" comes in and starts wanting to change a bunch of things purely because they are opinionated about languages, then that person is not going to go very far.
- nikdaheratik 10y agoUmm... outside of R&D or the valley, the breakdown is something like: PHP: 30%; .NET for finance/enterprise: 25%; Java for finance/enterprise: 20%; Java for android: 10%; iOS: 10% (~5% overlap); Everything else: 10%. And as far as payscales go, PHP is nearly always > the "Everything else" unless it's super specialized. But clearly everyone paying median or above for PHP is getting conned and they should convert their entire business to [flavor of the month] language. [edit]And I'm leaving js off there on purpose as there are very few web devs who are expected to only work in PHP and never touch the js. And in those other orgs, you usually have a specific "front end" developer that probably doesn't deal with any other kind of code and makes less than the "full stack" devs.
- spriggan3 10y ago> Umm... outside of R&D or the valley, the breakdown is something like: citation needed, I don't believe one second these figures are accurate.
- bluedino 10y ago>> More often it's the programmer who sucks, not the language. Or the client sucks.
- segmondy 10y agoNah, the client might not know how to explain what they want, but that's okay. Plenty of people go to the hospital and can't explain what is wrong with them. It's your job as a professional to extract what the client wants, just as it's a doctor's job to perform correct diagnosis and not blame you for poorly explaining your symptoms.
- willejs 10y ago| More often it's the programmer who sucks, not the language. Whilst it is possible to write structured, elegant php, its very hard, and thats the languages fault. The barrier to entry to write bad PHP is very low, thats what makes people think it 'sucks', because 90% of PHP codebases do. :(
- trebor 10y agoI disagree. Namespaces help hugely, as do Traits, etc. It used to be difficult back in the pre 5.4 days, but we have come a long way since then. Older projects will suffer till they're brought up to spec, true.
- ajmurmann 10y agoI don't think what you say really invalidates his point though. Namespaces and traits might help a lot, but that still doesn't make them used wide spread or introduced them to the overwhelming amount of terrible legacy code bases that have no namespaces and untested functions that are hundreds of lines long. You can write bad code in any language, but PHP used to be a much worse language and many developers got socialized with that. When you are leaning PHP it's easy to pick up bad habits because the code base tut are using is likely full of them. You are likely to look at code examples using old versions of PHP that don't teach you good practices. That of course doesn't mean you can't error awesome code in PHP it just means it's easy to write bad code.
- adimitrov 10y agoIn which ways do Traits of all things help write good, disciplined code bases? I think traits, and their Java equivalent, are OK to touch up legacy APIs (as they did with the Java collections API) but I have found no good place to stick them in a new project. Not to say PHP hasn't been introducing functionality for writing good, stable code bases (type hinting in function signatures, namespaces, better garbage collection, an actual AST — as an aside: how ON EARTH did they do without an AST pre-PHP7?) but traits don't strike me as the feature to think of when designing a new code base. They're not extendable, they're not overridable, they're monolithic, and classes expose their implementation details to them, which makes traits super fragile.
- nine_k 10y agoI suspect that a decent amount of people saw PHP 10 years ago, decided that PHP4 sucked (it did), and do not pay close attention to further PHP development ever since. Newer PHP is a much nicer language than it used to be. Newer frameworks can be reasonable and elegant. OTOH RoR has its own bunch of problems, and exploits a number of anti-patterns "in the name of simplicity", and Ruby as an ecosystem has its own set of pain points (e.g. deployment).
- ransom1538 10y agoI graduated in 2003. I haven't been able to stop coding php. Why? Because of the amount of work. I know other languages, but the pay for php these days is totally astronomical. (I live in sf, pacific-heights / WELLL over 6 figs / wife doesn't work). Currently I feel like I have a massive technical advantage (I wont share). Right now I work on iphone/android backends - at massive scale, top 10 (PHP is fast). When people say PHP sucks, I actually encourage them. We can't even employ a new graduate these days because they are pre-programmed to like node.js (cool! let's rewrite everything!) and to hate php. So yeah! PHP SUCKS!!!
- kreeves 10y agoI've mostly tried to fight the anti-PHP movement because I WANT new developers to come on board and create great things. I want new packages to pop-up as soon as some new tool/api/widget becomes available. I've felt for quite some time that most of the anti-PHP sentiment is an effort of other developers to justify the language they've selected to focus on. "Yeah, I'm doing Javascript and Node.js and yeah it's got it's sharp edges, but at least it's not PHP!" The problem is, if the negativity continues, the next step is that business WONT want PHP in their ecosystem... And not because it can't get the job done for them, but just because "ew PHP. I heard that was bad."
- ransom1538 10y agoI disagree. Wanting to get new grads into PHP is bizarre. They would be ostracized. They don't have the technical experience to know WHY it is a good language (CI/unit testing/years of libraries/API support in everything/bla bla). They should be working on things that are new and untested. That is what a twenty something should be working on. Check please?
- nikdaheratik 10y agoI think this criticism is missing the biggest problem most new grads have: how to work well with others. Version control, documentation, checking their work before committing and sending to QA, documentation, and learning how little they actual know about development on a real timescale >> which language they use. I'd rather start out in a well run IT shop that uses PHP than a quirky single dev small shop (or god-forbid an academic ivory tower of babel) with the most cutting edge startup blessed tool set.
- gear54rus 10y ago> More often it's the programmer who sucks, not the language. Catchphrase so ironic I laugh every time I hear it. The language also is written by a programmer, who sucked in PHP's case IMO.
- krapp 10y ago>The language also is written by a programmer, who sucked in PHP's case IMO. Yes, I am a terrible coder, but I am probably still better than you :) - Rasmus Lerdorf Modern PHP is written and maintained by a team of programmers. It hasn't been the language Rasmus wrote (badly, as a hack he never intended anyone else to use) for years.
- ajsalminen 10y agoI wonder about the origin and context of all these quotes. This one was apparently tweeted by him and the full version is: "For all the folks getting excited about my quotes. Here is another - Yes, I am a terrible coder, but I am probably still better than you :)" That is, unless there is actually a prior instance of him saying it but there could well not be.
- krapp 10y agoHe's right, though. Most people who rant about how terrible PHP is and how incompetent a programmer Rasmus is couldn't come up with anything better themselves.
- segmondy 10y agoGive 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.
- deleted 10y ago[deleted]
- vesak 10y ago>I'm very tired of hearing that PHP sucks. PHP is a good language And I'm quite tired of hearing this silly, totally meritless defense in every single thread that discusses PHP. Can't we just agree that it's not a very good language, but people are still doing cool stuff and lots of money with it? So many pointless fights could be averted like this.
- trebor 10y agoI'll agree that what makes a good language is subjective, and that most all languages have their problems. There is a certain threshold where "good enough" is what matters. Personally, I'd rather everyone just stop the good/bad language debates entirely.
- VeejayRampay 10y agoProgramming has to be the only environment where the voices of academia don't seem to matter because "my language gets shit done". Deep inside, what do you think those researchers in the PL community, the people that know the ins and outs, that theorize about languages, the people who spent years and years learning about the theory behind it all, who created the OCamls, the Haskells, the Coqs, the Idrises and so forth, what do you reckon their opinion of PHP is? So really I don't think "good language" is subjective. PHP is not fast, it's not well-designed, it's not particularly terse, it doesn't have particularly great tooling (Facebook has made that better with their HHVM initiative in all fairness), it isn't consistent and easy to reason about and the worst offender of all, it doesn't offer a dramatically different or original model of thinking about programs. What is has going for it has nothing to do with the language itself: jobs, ecosystem and easy hosting. I totally agree that a good language is whatever works for you, but in the meantime, "whatever is good enough" is a mindset that doesn't help us strive for something better, which does matter if we're going to collectively spend decades in this line of work.
- Shorel 10y ago> PHP is not fast Actually, it is. https://benchmarksgame.alioth.debian.org/u64q/php.html https://benchmarksgame.alioth.debian.org/u64q/php.html
- smileysteve 10y ago> More often it's the programmer who sucks, not the language. In the context, it's also a common occurrence that I can tell when developers came from the php (non framework) world. When I see them move to Rails (or in javascript), I often see an obvious lack of understanding / adaptation of MVC, Single Responsibility, asynchronicity, testing, and variable scoping - I've seen Senior PHP Developers come out with less of these concepts than codeschool graduates. That's not to say that PHP has this, or that every Rails/JS developer writes tests and understands these things (it still confounds me how companies choose rails and don't implement any tests, despite testing being a core idea)..
- ransom1538 10y ago"Single Responsibility, asynchronicity, testing, and variable scoping" Asynchronicity is this generations goto statment. How you need that in 99% of projects is beyond me. Mental masturbation?
- edem 10y agoHave you ever heard of the Blub paradox? [1] [1][http://c2.com/cgi/wiki?BlubParadox http://c2.com/cgi/wiki?BlubParadox]
- redmaverick 10y agoWhich area do you live in? How did you get your first 3 clients?
- pmontra 10y agoWhat's beautiful and what pays our bills are unrelated. If I have to do a beauty contest of the programming languages I used a lot, from uglier to most beautiful, I'd sort them like this: PHP, Perl and C (no ++), Java, JavaScript, Ruby. I didn't use Python a lot and I'm undecided if it should be placed before or after JS. That silly method(self) looks as useless as PHP's silly $this->attribyte. They're just bad designs and other languages knew better. I'm starting to use Elixir and it goes between JS and Ruby so far. Java has its own way to make me feel like wanting to wash my hands at the end of the day (the language and the tooling) but not as much as PHP, even if I agree that PHP7 is somewhat more sane than it used to be. Why didn't they do it at version 2? And if I have to sort them about what pays more... We could sort them by looking at the salary stats but eventually it's a matter of where we live and which opportunities we have. Any language will earn us money. No hard feelings.
- deleted 10y ago[deleted]
- qihqi 10y agoPython's method(self) is very useful. It gives the ability to call methods in the same way you use functions, which is what they really are. It allows you do things like map(str.strip, list_of_strings).
- pmontra 10y agoBut why can't the interpreter/compiler implicitly add that argument to each instance method definition? There is no need for the programmer to type it. I understand that self plays also a role in the declaration of class methods but other languages found ways to do without method(self) and still have class methods. Java's static (coming from K&R) or Ruby's def self.method Anyway, that is the way of Python. A lot of people is happy with that and will never be changed. It's beauty contest matter :-)
- edavis 10y ago> But why can't the interpreter/compiler implicitly... "Explicit is better than implicit" -- PEP 20 Python was the first language I ever learned and I just took it for granted that you had to manually specify "self" like that. When I see code with implicit self, it reads strangely to me. Like, "Where does 'this' come from? Oh yeah."
- pmarreck 10y agoI will say this: I whipped out the backend of a site in 1 night that had most of eBay's functionality... in PHP. But I quickly moved away from it and I'll explain why. I think that many programmers are starting to realize that the less "cognitive load" your language demands of you as a programmer, the better (the fewer bugs, etc.) Simple example, the recently-maligned "==" comparison operator has a very complex table of possible outputs (note that Javascript is also implicated here): http://stackoverflow.com/questions/7615214/in-javascript-why-is-0-equal-to-false-but-when-tested-by-if-it-is-not-fals http://stackoverflow.com/questions/7615214/in-javascript-why... I mean, as a PHP programmer debugging code that used ==, you'd have to basically have that table memorized in order to successfully debug it. Contrast this with, say, Ruby, where only nil and false evaluate to false and everything else evaluates to true. While there are of course "PHP best practices" that suggest === (which has a MUCH more sensible truth table), I find that much of the language is still simply not well thought-out and therefore is unsuitable for any large codebase. Sure, you can "get by" (see: Facebook), but you'd "get by" a hell of a lot better in a different (possibly a functional) language. If you can't grasp all the cognitive load mentally, then you are invariably going to introduce unexpected states into your code (read: "bugs"). Lastly, a language should be 100% deterministic. Last time I checked, PHP didn't even consistently pass its own test suite. It literally has so-called "flagging" and "known-fail" tests which are just marked as such (and not fixed). I cannot explain how bad this is to build something else on top of. So, yeah. If you're a great programmer, you can code almost anything in PHP (since you can handle the cognitive loads it introduces), just like you could code almost anything in, say, Brainfuck, or assembly. But as a great programmer, you'd be far better served by another high-level language (speaking as someone who knows and has worked with dozens of computer languages) which demands less cognitive load and therefore naturally reduces the number of bugs you will introduce. I'll also plug John Carmack's piece on functional programming in object-oriented languages, because it's relevant: http://www.gamasutra.com/view/news/169296/Indepth_Functional_programming_in_C.php http://www.gamasutra.com/view/news/169296/Indepth_Functional...
- pbreit 10y ago"most of eBay's functionality" Do you realize what a ridiculous statement that is?
- Glyptodon 10y agoPHP, as a language, particularly since somewhere in the 5.x series, is basically "flawed, but still more than adequate." The real problem is that so many people who use it are utterly incompetent. When someone says they work in/with PHP you immediately wonder if they're in the "let's duplicate a 900-line function across dozens of files just to give various pages a different icon" camp, the "I call myself a PHP Developer, but all I really do is Drupal Templates" camp, or in the "using Composer and everything is pretty much like you'd expect it to be in any web app built with Ruby or Python or Node" camp. Until you know, you fear acknowledging them or associating with them. But you can't really ask them up front. So it's easier to just avoid them. And I say this as someone who occasionally works in PHP.
- deleted 10y ago[deleted]
- deleted 10y ago[deleted]
- yedpodtrzitko 10y agoRoR is chronically known for having issues with a maintenance of projects in a long term, so using this comparison is a very weak defense of PHP.
- kentt 10y agoCitation please. Not at all disagreeing with you, I'm just interested.