Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
CPColin
Sep 9, 2003

Big ol' smile.
code:
if (!succeed())
{
   while (!try());
}

Adbot
ADBOT LOVES YOU

xzzy
Mar 5, 2009

The real horror is that 'try' is a reserved word in pretty much all modern languages so it will never compile. :colbert:

Soricidus
Oct 21, 2010
freedom-hating statist shill

Dessert Rose posted:

This actually seems fine? Breaks out of the loop if try() returns true, and assigns it to succeed.

I mean, "succeed" is kind of a useless variable there, and I don't think you can call a method try() in a language where that's a keyword, but...

As stupid sayings translated into code go, at least it actually does what it's supposed to do.

keep on doing nothing until you make an effort. all we care about is whether an effort was made, not what was attempted, and whether or not you make an effort depends entirely on external factors beyond our control.

Steve French
Sep 8, 2003

CPColin posted:

Except you're always trying at least once, but the saying says to try only if you don't succeed first.

Are you familiar with the meaning of the word "again?"

CPColin
Sep 9, 2003

Big ol' smile.
Are you familiar with the meaning of the phrase "if at first"?

canis minor
May 4, 2011

xzzy posted:

The real horror is that 'try' is a reserved word in pretty much all modern languages so it will never compile. :colbert:

Works as intended - it clearly means that there's no point in trying

Impotence
Nov 8, 2010
Lipstick Apathy

xzzy posted:

The real horror is that 'try' is a reserved word in pretty much all modern languages so it will never compile. :colbert:

McGlockenshire
Dec 16, 2005

GOLLOCKS!

Yup, perfectly legal in PHP7 thanks to improvements to the lexer to make the reserved keyword list context sensitive.

CPColin
Sep 9, 2003

Big ol' smile.
I was reading a job posting and got to the part that said, "Our code is highly structured PHP." and closed it.

Impotence
Nov 8, 2010
Lipstick Apathy
Some of the world's largest sites (and porn streaming sites) run on PHP. Why the hate? It's not even close to how terrible it was as I remember writing PHP 5.2 in primary school. Now there's things like composer and async and await and future and promise.

KaneTW
Dec 2, 2011

Biowarfare posted:

porn streaming sites run on PHP.

Whoa!

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

Biowarfare posted:

Some of the world's largest sites (and porn streaming sites) run on PHP. Why the hate? It's not even close to how terrible it was as I remember writing PHP 5.2 in primary school. Now there's things like composer and async and await and future and promise.

PHP dev spotted.

xzzy
Mar 5, 2009

php is like living with your parents, if it's all you know it seems fine because everything you need is made available to you and life seems pretty good. Sure you gotta do the dishes and take out the trash, but there's no real responsibility.

But then you go out into the world and experience what life has to offer and it's over.. if you try to move back in it's awkward and you feel like a failure and you hate all the snarky comments.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.




I'm going tot go ahead and take issue with your use of the word "improvements". Or to put it another way, Parse error: syntax error unexpected T_SHFVRM

Impotence
Nov 8, 2010
Lipstick Apathy

xzzy posted:

php is like living with your parents, if it's all you know it seems fine because everything you need is made available to you and life seems pretty good. Sure you gotta do the dishes and take out the trash, but there's no real responsibility.

But then you go out into the world and experience what life has to offer and it's over.. if you try to move back in it's awkward and you feel like a failure and you hate all the snarky comments.

My formal first class intro to cs was python 3 (and scheme), and I've liked that ever since. Tried out clojure, wrote some actual things in python.
But I still occasionally visit with PHP and notice that the house has gotten nicer and they've moved out of detroit. I mean, it's still a mess and overcrowded, but at least they're making an effort. I mean, honestly, there is nowhere else you will get the same amount of language support if you're catering to the lowest common denominator -- 99% of people deploying things like Wp, phpBB, etc have no idea what git, ssh, or anything like that is.

Impotence fucked around with this message at 21:42 on Feb 3, 2016

Kazinsal
Dec 13, 2011


Munkeymon posted:

I'm going tot go ahead and take issue with your use of the word "improvements". Or to put it another way, Parse error: syntax error unexpected T_SHFVRM

Similarly, T_PAAMAYIM_NEKUDOTAYIM is the dumbest, spergiest loving thing to put in an otherwise english-language set of errors. How the gently caress, other than seeing it enough to know what it means or googling it, is anyone who doesn't know Hebrew supposed to know that it means "double colon"?

One of the worst "features" in PHP by far.

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

Kazinsal posted:

Similarly, T_PAAMAYIM_NEKUDOTAYIM is the dumbest, spergiest loving thing to put in an otherwise english-language set of errors. How the gently caress, other than seeing it enough to know what it means or googling it, is anyone who doesn't know Hebrew supposed to know that it means "double colon"?

One of the worst "features" in PHP by far.

I had to google that keyword and found this bit of history. Holy loving poo poo these people are in charge of PHP? :stare:

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Kazinsal posted:

Similarly, T_PAAMAYIM_NEKUDOTAYIM is the dumbest, spergiest loving thing to put in an otherwise english-language set of errors. How the gently caress, other than seeing it enough to know what it means or googling it, is anyone who doesn't know Hebrew supposed to know that it means "double colon"?

One of the worst "features" in PHP by far.

And I think they still haven't removed it because it might confuse/scare people who are used to seeing it :allears:

Impotence
Nov 8, 2010
Lipstick Apathy

Kazinsal posted:

Similarly, T_PAAMAYIM_NEKUDOTAYIM is the dumbest, spergiest loving thing to put in an otherwise english-language set of errors. How the gently caress, other than seeing it enough to know what it means or googling it, is anyone who doesn't know Hebrew supposed to know that it means "double colon"?

One of the worst "features" in PHP by far.

syntax error, unexpected '::' for 4 years now

edit: does stockolm syndrome exist for programming lagnuages

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

CPColin posted:

Except you're always trying at least once, but the saying says to try only if you don't succeed first.

How can you succeed if you don't try in the first place? Trying the first time is implied.

e: oh look, a second page.

CPColin
Sep 9, 2003

Big ol' smile.
Because succeed() and try() are two different functions, obviously!

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe
I'm glad there are people making a concerted effort to make PHP less poo poo but suspect that it's a lost cause.

out of curiosity, one of the more irritating things about PHP (in terms of practical problems using the language) is the overabundance of standard library functions with inconsistent names and argument conventions. is there any fork of PHP or set of custom defs aimed at offering a more consistent package of functions wrapping or replacing the standard library functionality? As in, if you use this fork (or include this file, or whatever) you get a set of global function names (might just be shims around the real standard library) that offer the functionality in the standard library but with better thought-out (or at least more consistent) naming and argument-order conventions.

comedyblissoption
Mar 15, 2006

just a reminder that the php standard library names are inconsistent because rasmus changed the function names to achieve a better hash distribution for his hashing function of string length

Notorious R.I.M.
Jan 27, 2004

up to my ass in alligators
Just a reminder that most plangs are poo poo and 99% of the complaints in this thread about PHP can be solved by using an IDE that will show you function signatures. This basically bring it up to the same tier as python, another poo poo plang.

Cuntpunch
Oct 3, 2003

A monkey in a long line of kings

Notorious R.I.M. posted:

Just a reminder that most plangs are poo poo and 99% of the complaints in this thread about PHP can be solved by using an IDE that will show you function signatures. This basically bring it up to the same tier as python, another poo poo plang.

Uh, I don't think you understand what's wrong with PHP as a language. hth

Notorious R.I.M.
Jan 27, 2004

up to my ass in alligators

Cuntpunch posted:

Uh, I don't think you understand what's wrong with PHP as a language. hth

Good job linking to a 4 year old article about PHP 5.3. Your first homework assignment is to figure out how much is still relevant to PHP 5.6.

PHP has a lot of poo poo problems. Its ecosystem sucks outside of webdev. Writing CLI applications in PHP is a total nightmare compared to Python where you have libraries like Click that make everything easy. In fact, it has no numerics libraries or really any other libraries outside of interacting with a RDBMS and making GBS threads out web apps. It is, however, pretty good at making GBS threads out web apps, and it works for a lot of large sites that have really rigid performance demands on their web applications. HHVM provides a good JIT as well.

A lot of the problems that your link assigns to PHP are problems that show up in pretty much any dynamically typed, interpreted languages. Outside of that we get complaints like "PHP has a === operator" from the same people that for some reason don't complain about Python having both a "==" and "is" operator. If you want to sit in an ivory tower made of Haskell and rant about these warts, then you have a point. But if you aren't similarly going to poo poo on any other plang for their stupid design decisions then you're simply complaining about PHP because someone else complained about PHP and you thought that was a cool thing to do.

Liking to this article instead of talking about PHP's dead-end ecosystem shows that you really don't understand what is wrong with PHP. PHP will die for the same reason Ruby will -- it's failed outside of a few niches and it'll be on life support until those last domain specific use cases dry up. Hell, at least Ruby is still used for Chef and Puppet. PHP doesn't have anything outside of webdev going for it.

Notorious R.I.M. fucked around with this message at 03:28 on Feb 4, 2016

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Just use Hack.

BigRedDot
Mar 6, 2008

Notorious R.I.M. posted:

we get complaints like "PHP has a === operator" from the same people that for some reason don't complain about Python having both a "==" and "is" operator.
It's perfectly reasonable to want to be able test both object identity, and value equality. Here's the thing though: you might actually want to be able to just test one, or the other, but not some bizarre admixture of both. The obvious and sensible solution to that is to, you know, have two district operators for the two distinct operations.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Do you mean value equivalence? PHP's operators let you test for value equivalence and object identity, basically. I don't think having == and eq would really be cleaner, but it would let people point at Lisp in defense.

duck monster
Dec 15, 2004

Subjunctive posted:

Sometimes writing a unit test involves having to hook the OS, or simulate complex hardware. Not everyone is set up to write a dummy USB driver.

Yep. A job I had a bunch of years ago, involved writing device drivers for embedded linux boards in pan tilt camera heads (The hardware needed low level access to DMA so it wasnt as simple as driving a serial line from user space, alas). Boss wanted it all to be unit tested. Good idea, until I realised I had no loving idea how to mock up a god drat operating system kernel.

We kind of fudged it a bit.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Yeah, this time last year I was helping design record+replay for a set of devices that got their signals fused together a couple of hundred times per second, on 3 operating systems.

You know what's "good enough"? Good enough, that's what.

duck monster
Dec 15, 2004

Subjunctive posted:

Just use Hack.

The problem with hack is it solves the wrong problems. Well mostly. I mean the static typing is good. PHP definately needs that. But its focus on performance isnt really that useful unless your running google or facebook. The problem with PHP is its inconsistency. Its the only language I know where despite using it for a decade I have to keep looking up functions because I cant remember what order the parameters go. Its "best" frameworks are symfony which seems like it was designed by twirly moustached Java villains and has serious troubles downscaling and Laravel which has *serious* troubles upscaling and an ecosystem that revolves almost solely on web dev and is composed of horrifically poorly written modules that get spat out in one revision and then abandoned. And Hack cant fix any of that.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

I'm not sure how much of our stdlib is in Hack, but stuff like collections make things more regular. Most of the core PHP API catastrophe is hidden from developers at FB, but I agree that it's a real weakness.

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

Notorious R.I.M. posted:

Good job linking to a 4 year old article about PHP 5.3. Your first homework assignment is to figure out how much is still relevant to PHP 5.6.

PHP has a lot of poo poo problems. Its ecosystem sucks outside of webdev. ... Liking to this article instead of talking about PHP's dead-end ecosystem shows that you really don't understand what is wrong with PHP. PHP will die for the same reason Ruby will -- it's failed outside of a few niches and it'll be on life support until those last domain specific use cases dry up. Hell, at least Ruby is still used for Chef and Puppet. PHP doesn't have anything outside of webdev going for it.

Why would it be surprising that a language that was originally created to handle the dynamic parts of some guy's web page, and which has always been aimed primarily at scripting web pages, doesn't really do anything other than scripting web pages? Who seriously wants to write a command line app in PHP, unless it's as an afterthought to some web app they already have and uses common code? PHP is lovely but being specialised to a particular use case is not, in and of itself, a lovely aspect of it. PHP has never had anything outside of webdev going for it and nobody other than you is surprised by this.

Beef
Jul 26, 2004

Notorious R.I.M. posted:

Just a reminder that most plangs are poo poo and 99% of the complaints in this thread about PHP can be solved by using an IDE that will show you function signatures. This basically bring it up to the same tier as python, another poo poo plang.

You can give a cripple man crutches, but he will still be a cripple.

feedmegin
Jul 30, 2008

xzzy posted:

The real horror is that 'try' is a reserved word in pretty much all modern languages so it will never compile. :colbert:

It's perfectly valid ANSI C :colbert:

Cuntpunch
Oct 3, 2003

A monkey in a long line of kings

Notorious R.I.M. posted:

Good job linking to a 4 year old article about PHP 5.3. Your first homework assignment is to figure out how much is still relevant to PHP 5.6.

PHP has a lot of poo poo problems. Its ecosystem sucks outside of webdev. Writing CLI applications in PHP is a total nightmare compared to Python where you have libraries like Click that make everything easy. In fact, it has no numerics libraries or really any other libraries outside of interacting with a RDBMS and making GBS threads out web apps. It is, however, pretty good at making GBS threads out web apps, and it works for a lot of large sites that have really rigid performance demands on their web applications. HHVM provides a good JIT as well.

A lot of the problems that your link assigns to PHP are problems that show up in pretty much any dynamically typed, interpreted languages. Outside of that we get complaints like "PHP has a === operator" from the same people that for some reason don't complain about Python having both a "==" and "is" operator. If you want to sit in an ivory tower made of Haskell and rant about these warts, then you have a point. But if you aren't similarly going to poo poo on any other plang for their stupid design decisions then you're simply complaining about PHP because someone else complained about PHP and you thought that was a cool thing to do.

Liking to this article instead of talking about PHP's dead-end ecosystem shows that you really don't understand what is wrong with PHP. PHP will die for the same reason Ruby will -- it's failed outside of a few niches and it'll be on life support until those last domain specific use cases dry up. Hell, at least Ruby is still used for Chef and Puppet. PHP doesn't have anything outside of webdev going for it.

This is hilarious. Because your entire premise is 'all languages suck PHP is no worse' - while completely ignoring the major, enormously central point of that entire (infamous) article: Unlike almost every other major language, PHP doesn't come from a place of reasoned design. And they insist on trying desperately maintain some compatibility even between major versions so you *still* end up with things being a convoluted clusterfuck of "well it was like that 10 years ago..." - see things like *Standard Library Functions* having no consistency: strpos(which also has stripos - what's the difference? READ THE MANUAL) compared to str_split; array_map and array_filter both taking the same parameters - but in opposite order! Etc, etc. Even skipping an entire major version(6) to try and 'draw a line' - they *still* refuse to revisit fixing the standard library for these old fuckups.

Look, developer to developer, we have both probably worked with peers who fall into two camps: On one hand you have "I'm going to consider my changes, understand their impact, and then make them." and on the other you have "gently caress it, let's get this change checked in as fast as possible" - PHP's *core functionality* behaves like the latter. It's why it's pretty widely derided - usually there's at least *some* sort of *reasoning* behind the rough edges of other languages - with PHP the answer tends to be "eh, that's how it got implemented. it works. what's your problem?"

ExcessBLarg!
Sep 1, 2001

Notorious R.I.M. posted:

PHP will die for the same reason Ruby will -- it's failed outside of a few niches and it'll be on life support until those last domain specific use cases dry up.
Die? Not really sure how that works. None of the "plangs" are actually dead, Perl 5, Python, Ruby, and PHP are all very much around. As much as I would probably like to see PHP go away, it's so widely used it probably never will. Tcl might be dead.

feedmegin
Jul 30, 2008

ExcessBLarg! posted:

Die? Not really sure how that works. None of the "plangs" are actually dead, Perl 5, Python, Ruby, and PHP are all very much around. As much as I would probably like to see PHP go away, it's so widely used it probably never will. Tcl might be dead.

Not as long as expect uses it, it isn't.

Adbot
ADBOT LOVES YOU

BobHoward
Feb 13, 2012

The only thing white people deserve is a bullet to their empty skull

ExcessBLarg! posted:

Die? Not really sure how that works. None of the "plangs" are actually dead, Perl 5, Python, Ruby, and PHP are all very much around. As much as I would probably like to see PHP go away, it's so widely used it probably never will. Tcl might be dead.

Tcl is integrated into most EDA tools for FPGA and ASIC design. A niche market, but an important one.

We also tend to use lots of Perl 5.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply