5 ms·
That's exactly how I read it. Php and Perl are really from a time gone by. neither have REPL. php doesn't even have to a proper print command, you have to add y
by svnpenn 8y ago
That's exactly how I read it. Php and Perl are really from a time gone by. neither have REPL. php doesn't even have to a proper print command, you have to add your own newline. Granted they are both quite fast, but with perls "write only" syntax I would only use either of them for the most basic of scripts.
- nicoburns 8y agoPHP has a repl https://github.com/bobthecow/psysh https://github.com/bobthecow/psysh
- empyrical 8y agoAlso, `php-cli` has a very basic REPL which can be accessed using `php -a`.
- ambicapter 8y agoRemember to terminate every line with a semicolon, and enjoy quirks like true printing boolean(true) and false printing nothing at all.
- carmate383 8y agoExcept that PHP does have a REPL, and using PHP_EOL is hardly a big deal. PHP induces an undeserved gag-reflex for most Ruby / Python / JS devs because they read some "why php sucks" post on someone's blog ten years ago, but really the language is quite modern now (not to mention faster).
- TazeTSchnitzel 8y agoThe fundamentals of why PHP is disliked have not changed. It is still covered in annoying problems, though there have been substantial improvements in some areas. It's less painful, but it's still the infamous PHP.
- taneq 8y agoI thought PHP was disliked because its flexibility can lead to horrible code if it's used without discipline, and for a long time its default settings were completely insecure? I don't recall hearing any serious criticism claiming that it was hard to get things done with (unless you count security).
- jes5199 8y agothere are some design decisions, in the core language, that cause pervasive weirdness that’s hard to code around. It’s worse that “too permissive” - it’s like there are bad defaults that you have to constantly fight against
- NightlyDev 8y agoSome examples? I can't think of any.
- fletchowns 8y agoAt least PHP doesn't have the whole Python 2 vs. Python 3 fiasco. And a gazillion different ways to package and install dependencies. Don't get me wrong, I love Python but every language has its warts.
- code_duck 8y agoTrue, PHP never made a clean break with its legacy, unlike Python. That’s not positive.
- Can_Not 8y agoPHP consistently deprecates old features at a steady, manageable pace while introducing new features and performance enhancements.
- reallydude 8y ago> PHP consistently deprecates old features at a steady, manageable pace Manageable is subjective. There's no evidence that it's "just right" or even "timely". Major API cleanup would be appropriate for php 8 but there's still too many people clinging to the idea that PHP would be damaged because someone can't look up how to solve PHP problems with specific versions (ie are stuck in the late 90s). There's so much that could be done in one fell swoop, the steering council of neckbeards (PHP neckbeards are as bad as it sounds) are responsible for the stunted development of the language. To suggest they are the progressive face of PHP is, at best, revisionist.
- Can_Not 8y agoSteady might mean too slow, but there's no 2/3 schism. There's plenty of features in the docs that say at the top "deprecated in x, removed in y, see also alternative z", so I'm unsure of what problem you're referring to.
- fetbaffe 8y agoWhat would a major API cleanup actually give except for major breakage?
- meko 8y agoThat's true about a few languages actually. Javascript being one, C++ being another.
- meko 8y ago(Last comment didn't post??) To be fair js gets the same bad rap.
- itslennysfault 8y ago...or they're like me. I spent over a decade making a living on PHP and now it gives me major P(HP)TSD. I'd have to be REALLY desperate to consider a job that involved PHP.
- carmate383 8y agoConjecture: Anyone that spends over ten years making a living writing the same programming language will have major P(LANGUAGE)-TSD. I feel like the deeper concern is more a psychological fear of moving your career in a backwards direction. PHP just happened to be a part of that.
- sterlind 8y agoI'm not sure... I've spent six years with C# and I still love the heck out of the language. I keep learning new things about it, too! Most recently, stackalloc and unsafe blocks. I've burned out on other, less comfortable languages though.
- h1d 8y agoI think it's more from being forced to use some framework you didn't like for too long. I've done PHP for more than 10 years and got no problem using it if I have to. OTOH, I don't want to touch stuff like rails because I don't like it being in the way but love Ruby. I'd prefer TypeScript these days though.
- ErotemeObelus 8y ago> because they read some "why php sucks" Poor souls. It must be pretty awful having your mind be a walking trashcan of everyone else's blog posts.
- todd3834 8y agoI’ve never read a blog post about why PHP sucks. I wrote PHP for many years and it wasn’t that bad but compared to the alternatives I would never go back. Also tormented by all of the Wordpress plugins and template hacks that I got paid to write over the years. Yuck, no thanks I don’t want to do that anymore.
- carmate383 8y agoSo, you hated the _work you did with PHP_, not really the language.
- todd3834 8y agoI never said I hated the language but I do think almost every other alternative language I’ve used since doing full time PHP has been a better experience.
- svnpenn 8y agoIt seems you don't know what REPL means. The P is print, and "PHP -a" doesn't do that.
- jes5199 8y agoI honestly tried to come back to PHP after most of a decade in ruby. I couldn’t find a decent ORM! And after trying to write one, I think I see why. We ended up rewriting the entire product in Python.
- xellisx 8y agoThere are tons of ORMs for PHP. Of course, I find ORMs in the end, just get the way of getting the most from a DB and SQL isn't that hard for most things.
- code_duck 8y agoI determined there’s no point in an ORM... just write logical code using an SQL wrapper like PDO.
- cutler 8y agoWhy not Ruby if you'd just spent a decade with it?
- h1d 8y agoSometimes preference doesn't match project choice?
- peterwwillis 8y agoThis position only really holds up if you don't know either language well. For example, I guess you didn't know there are PHP and Perl REPLs? And robust OO code is not only possible in Perl, but there's tens of thousands of very reusable Perl modules that have stood up over time much better than Python or Node modules have.
- simula67 8y agoOthers have pointed to PHP REPLs. Perl 5 also has a REPL : https://metacpan.org/pod/Devel::REPL https://metacpan.org/pod/Devel::REPL. Perl 6 comes with a REPL built-in. Unlike Python/Ruby, Perl does not have a GIL and with some discipline it can be used in large programs.
- cutler 8y agoRuby's built-in REPL is irb.