News for hackers. Stuff that matters.
Re:I got tired of PHP and Perl, so I tried bash by svnpenn on Friday April 12, 2019 @09:10PM (#19650424)
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.
Re:I got tired of PHP and Perl, so I tried bash by carmate383 on Friday April 12, 2019 @09:38PM (#19650518)
Except 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).
Re:I got tired of PHP and Perl, so I tried bash by TazeTSchnitzel on Friday April 12, 2019 @09:51PM (#19650567)
The 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.
Re:I got tired of PHP and Perl, so I tried bash by taneq on Friday April 12, 2019 @10:50PM (#19650805)
I 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).

Re:I got tired of PHP and Perl, so I tried bash by jes5199 on Friday April 12, 2019 @11:11PM (#19650875)
there 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
Re:I got tired of PHP and Perl, so I tried bash by NightlyDev on Friday April 12, 2019 @11:45PM (#19650995)
Some examples? I can't think of any.
Re:I got tired of PHP and Perl, so I tried bash by fletchowns on Friday April 12, 2019 @10:11PM (#19650645)
At 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.
Re:I got tired of PHP and Perl, so I tried bash by code_duck on Friday April 12, 2019 @11:28PM (#19650936)
True, PHP never made a clean break with its legacy, unlike Python. That’s not positive.
Re:I got tired of PHP and Perl, so I tried bash by Can_Not on Friday April 12, 2019 @11:55PM (#19651038)
PHP consistently deprecates old features at a steady, manageable pace while introducing new features and performance enhancements.
Re:I got tired of PHP and Perl, so I tried bash by reallydude on Saturday April 13, 2019 @02:16AM (#19651383)
> 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.

Re:I got tired of PHP and Perl, so I tried bash by Can_Not on Saturday April 13, 2019 @08:35AM (#19652645)
Steady 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.

Re:I got tired of PHP and Perl, so I tried bash by fetbaffe on Saturday April 13, 2019 @09:24AM (#19652868)
What would a major API cleanup actually give except for major breakage?
Re:I got tired of PHP and Perl, so I tried bash by zwetan on Saturday April 13, 2019 @01:40AM (#19651287)
How about PHP 6? not a fiasco?
Re:I got tired of PHP and Perl, so I tried bash by Can_Not on Saturday April 13, 2019 @08:59AM (#19652764)
They canceled a major break in BC that they weren't sure would have been a good idea and then came out with one of the best releases in PHP history, so kind of the opposite of a fiasco.
Re:I got tired of PHP and Perl, so I tried bash by jes5199 on Friday April 12, 2019 @11:09PM (#19650862)
I 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.

Re:I got tired of PHP and Perl, so I tried bash by xellisx on Friday April 12, 2019 @11:23PM (#19650924)
There 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.
Re:I got tired of PHP and Perl, so I tried bash by code_duck on Friday April 12, 2019 @11:29PM (#19650939)
I determined there’s no point in an ORM... just write logical code using an SQL wrapper like PDO.
Re:I got tired of PHP and Perl, so I tried bash by cutler on Saturday April 13, 2019 @12:03AM (#19651061)
Why not Ruby if you'd just spent a decade with it?
Re:I got tired of PHP and Perl, so I tried bash by h1d on Saturday April 13, 2019 @05:59PM (#19656005)
Sometimes preference doesn't match project choice?
Re:I got tired of PHP and Perl, so I tried bash by todd3834 on Friday April 12, 2019 @10:55PM (#19650818)
I’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.
Re:I got tired of PHP and Perl, so I tried bash by carmate383 on Saturday April 13, 2019 @12:37AM (#19651146)
So, you hated the _work you did with PHP_, not really the language.
Re:I got tired of PHP and Perl, so I tried bash by todd3834 on Saturday April 13, 2019 @09:46AM (#19652982)
I 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.
Re:I got tired of PHP and Perl, so I tried bash by itslennysfault on Friday April 12, 2019 @10:34PM (#19650752)
...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.
Re:I got tired of PHP and Perl, so I tried bash by carmate383 on Saturday April 13, 2019 @12:39AM (#19651153)
Conjecture: 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.
Re:I got tired of PHP and Perl, so I tried bash by sterlind on Saturday April 13, 2019 @03:43PM (#19655306)
I'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.
Re:I got tired of PHP and Perl, so I tried bash by h1d on Saturday April 13, 2019 @06:03PM (#19656024)
I 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.

Re:I got tired of PHP and Perl, so I tried bash by svnpenn on Friday April 12, 2019 @11:02PM (#19650839)
It seems you don't know what REPL means. The P is print, and "PHP -a" doesn't do that.
Re:I got tired of PHP and Perl, so I tried bash by meko on Friday April 12, 2019 @10:26PM (#19650717)
That's true about a few languages actually. Javascript being one, C++ being another.
Re:I got tired of PHP and Perl, so I tried bash by meko on Friday April 12, 2019 @10:28PM (#19650728)
(Last comment didn't post??) To be fair js gets the same bad rap.
Re:I got tired of PHP and Perl, so I tried bash by h1d on Saturday April 13, 2019 @06:05PM (#19656036)
Many users = more vocal minorities and elitist who can't help but bash mass adopted products
Re:I got tired of PHP and Perl, so I tried bash by soperj on Saturday April 13, 2019 @01:43PM (#19654517)
that's because it still has global variables.
Re:I got tired of PHP and Perl, so I tried bash by simula67 on Friday April 12, 2019 @10:25PM (#19650705)
Others have pointed to PHP REPLs. Perl 5 also has a 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.
Re:I got tired of PHP and Perl, so I tried bash by cutler on Saturday April 13, 2019 @12:06AM (#19651072)
Ruby's built-in REPL is irb.
Re:I got tired of PHP and Perl, so I tried bash by nicoburns on Friday April 12, 2019 @09:12PM (#19650433)
Re:I got tired of PHP and Perl, so I tried bash by empyrical on Friday April 12, 2019 @09:40PM (#19650527)
Also, `php-cli` has a very basic REPL which can be accessed using `php -a`.
Re:I got tired of PHP and Perl, so I tried bash by ambicapter on Friday April 12, 2019 @10:20PM (#19650687)
Remember to terminate every line with a semicolon, and enjoy quirks like true printing boolean(true) and false printing nothing at all.
Re:I got tired of PHP and Perl, so I tried bash by peterwwillis on Friday April 12, 2019 @09:42PM (#19650533)
This 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.