Hacker Newsnew | past | comments | ask | show | jobs | submit | greiskul's commentslogin

The @ operator of php. In languages like Java, to silently catch all exceptions and do nothing with them requires at least some boiler plate.

PHP has an operator for something you should never do in a sane codebase.

You know that python wants good good to look good?

PHP was written in a way that makes bad code look good. And if we want Software Engineering to be a serious field that evolves, we have to be able to be honest with ourselves. It is a bad tool. Good programmers can even write good programs with bad tools. Doesn't mean you shouldn't avoid bad tools given the option.

There probably is a "PHP the good parts". But Javascript actually had a pretty nice core, and an utility of being in all web browsers that no other language could replicate. What niche does PHP have where it brings more value there other nicer languages can't be used instead?


You absolutely can use @ in sane codebases. And you give the example yourself: In other languages you often enough see that boilerplate where thrown exception is discarded, because there is no sane reaction to some edge case and you just want the program to continue, because you know it will work anyway. And that's @.

Note though that @ was already neutered in some earlier recent PHP releases.


This.

One common use case for the @ operator, is when "destructuring" array members into variables. In some cases, you can't know if the member will be available, but it's not important if it's missing. In that case, you can silence the warning.

$array = ['apple', 'pear']; @list($mainFruit, $secondaryFruit, $tertiaryFruit);

Since I suppress the warning that would occur due to the third member not being present, the program will continue executing instead of halting.


> The @ operator of php. In languages like Java, to silently catch all exceptions and do nothing with them requires at least some boiler plate.

The @ operator doesn't get rid of exceptions it get rids of "warnings" which are basically built in log messages.

It used to get a bad wrap for also silencing fatal errors, but it stopped doing that a while ago.

The @ operator is something that should only be rarely used, but it is no way comparable to catching exceptions and doing nothing with them. There are sane uses for it.


The claim was "PHP invites bad code" - but your point is for "bad code can be written in PHP" which is really not the same thing. A quick google for the @ brought up https://stackoverflow.com/questions/136899/suppress-error-wi... where the highest voted response is ~"NO, don't use it please". No use case I've come across during the past 10 years has required or even nudged me in the direction of @. It's an ancient relic that the whole community considers a no-no. I'd be curious if you really want to argue that this state of affairs "invites" using the @.


The reason Microsoft held the web back is because it saw it has a potential threat to it's dominance as the main platform for applications.

And if you are actually concerned about the future of the web, instead of it's past, I would more concerned with Apple holding back development on Safari, to make people focus on writing native apps for mobile. There are so many apps that in the past would be websites, but end up being natively coded because that's the only way to get a good customer experience in mobile.


You're worried about Safari in the browser space? It's the only browser that's holding back a near 100% monopoly from Google at the moment.

If Apple gets forced to allow other browser engines on iOS, it's game over. Google wins the web forever.


> And if you are actually concerned about the future of the web

>I would more concerned with Apple holding back development on Safari

I think they are more concerned with the future of the web due to Google and so am I.


And it's also kind of hard to restrict shoplifting, people can just take products and hide it in their clothes. Doesn't mean that as a society we can't do anything, we can make it clear through regulation what is legal or not for manufactures to make and sell.


A lot of Americans don't consider countries in South America to be part of "The West".

Which is wild, cause Americans also love Rome and it's influence in western culture, and Latin America literally speaks languages that are direct descendants of Latin.


In that conception it's Anglos and the historic roots of Anglo thought. Latin America is a different branch, so it's not on the Anglo branch. But the common root (Rome, Western Europe) is on it. Seems straightforward.


Great point about web3. People always talk about during gold rushes, selling shovels instead of being the ones digging for gold. And it might be a reasonable idea, but there needs to be actual people getting rich from the gold to be an actual gold rush, if everyone is just selling shovels, it is probably a sign of a bubble.


A "Shovel Rush"


There is formal recognition, and real world recognition. Although few countries formally recognize Taiwan, I would say that most of the world recognizes it in practice. Just look at things like countries that accept Taiwanese passport https://en.m.wikipedia.org/wiki/Visa_requirements_for_Taiwan...


Brazils pix system as a similar mechanism, where a website can generate a code for payment, that you can copy or scan a qr code into your bank app, and then approve the payment.

Individual merchants barely get any information from you this way, and have no way of even trying to charge you more later.


And what projects do they have besides buying BTC like the parent comment mentioned? What tech have they built?

And yeah, BTC went up huge amounts, but certainly they were a large part of the buying pressure to get it there. But like you asked, how do they realize anything? Unless they get US government to start buying and shift their bags to the US tax payer, how do they do anything with their BTC? Besides using it as collateral to borrow even more money to inflate a even higher bubble?


It's the main reason Brazil has invested so much in trying to use open source software for goverment institutions. There is a number of reasons, but digital sovereignty is probably the argument that actually convinced our politicians that it is important. Even Lula visited the international free software forum back in 2009: https://www.linux.com/training-tutorials/brazilian-president...


Metadata about the file like modification time.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: