When a php file is loaded at runtime, it runs through a very basic JIT compiler that does statically check a few things before continuing with execution. Syntax, for example, is checked for the entire file during this step.
Most type checking happens at runtime (this might not be true for interfaces at some level, but I can’t say for 100% certain - I just know I tend to see interface related errors earlier during code execution…). It’s perfectly valid syntax to declare a private method as returning an integer and then for the body of the method to return a string (explicitly cast as a string even). As long as you never call that method at runtime, no exceptions will be thrown.
With a half decent IDE or LSP, these sorts of runtime exceptions can be easily avoided but technically they still exist and if you don’t know about that, it can be argued to be confusing. PHP has made a lot of trade-offs to largely maintain backwards compatibility and many of them live in decisions that happen at runtime.
Modern PHP tooling can provide type safety in a very similar way to Typescript if you’re willing to put in the effort while also still technically offering you an escape hatch to do whatever the heck you want and duck type to your hearts content.
NIT linter warning: That’s not really a JIT compiler.
PHP parses the whole file and compiles it to Zend opcodes before executing it, so syntax errors are caught up front. But "JIT" means compiling an intermediate representation/opcodes into native machine code at runtime, when the functions are called, not at load time when the source file is parsed. If you just load a file and never call any of its code, the JIT compiler should never compile it.
PHP 8's OPcache JIT can do that optionally, but the normal load/parse/compile-to-opcodes step isn't JIT.
One form of type checking does happen at compile time (which is really load time in PHP, but close enough), namely when a class extends another class or implements an interface: the types of every method and property are checked to ensure that they are substitutable per the standard variance rules (return types are covariant, parameters are contravariant, props are invariant). Everything else is checked at runtime though, and statically analyzing any of those is left to external tools like phpstan, psalm, or mago.
What a wonderful article! Despite being a huge fantasy fan, Pratchett has not yet come across my nightstand. I think that changes soon! I’m going to stop in my local bookstore and see if they have anything.
Regarding the authors point about current authors, I think Brandon Sanderson is really trying his best to live up to the mantle left behind by the great fantasy authors of the 20th century. Not all of his books that I’ve read have been bangers but considering he writes multiple novels a year across a wide variety of fantasy and sci-fi subgenres, that’s somewhat to be expected.
I know reading isn’t as popular now that screens have become so engrained into our daily lives, but there are absolutely kids out there getting stuck into books and it’s never been a better time to be a writer given the access of the internet and the ability for an author to promote their work and showcase their storytelling creativity through the medium of social media.
What? All of these companies have been major importers to the USA since the 80s or earlier. I don't see how tariffs have anything to do with how embedded Japanese electronics and cars are embedded into American culture.
Tbf, I think you’re just experiencing a downside of living in NYC. I’ve only ever been there as a tourist, but I wouldn’t ever dream of renting a motorcycle in the city for the reasons you mention.
For context, I live in a highly dense European country and I wouldn’t ride my motorcycle in our most densely populated city centers either. For me, a motorcycle is luxury transportation for when the weather is cooperative or I want to enjoy the journey to my destination. If I want an efficient commute, I’m gonna take the train into the city and enjoy the relaxed state of mind knowing I don’t have to navigate.
Drivers have waaaay too many distractions nowadays and I don’t trust most people to be paying attention as much as I want them to. At least out on the open highway, I stand a chance of getting away from them and putting distance between us. In a city, my options to create space often don’t make much of a difference due to congestion in general.
I hope you can find the opportunity to ride more in the future. :)
Im glad that Microsoft is letting XBOX do their own thing again and at the very least being competitive in their own market.
While I understand its going to be an uphill battle for XBOX after the wild ride that they’ve been on for a decade now, I’m hopeful that they can make a dent in the market and come back to really compete with Sony and Nintendo on their own terms.
Consistency has been the bane of all Microsoft products for time immemorial and I really hope they can come back and turn things around. Consumers do better with competition and with hardware costs spiraling out of control, we need more competition to keep prices in check.
> AI tooling can also be a place where we start building our view of what maintainable software practices look like so we don't make decisions that have these same tail effort profiles. That can be things like building out tooling to handle maintenance updates
This has been possible already but from my vantage point, it doesn't look like anyone really did it? Sure, there already exists tons of OSS that is built for this case, even before AI, yet it seems to me to always come back to incentives. IMO, there is no incentive to write maintainable software (and I'm not sure there ever will be one at this pace). Businesses are only incentivized to write enough software to accomplish the task within their own defined SLAs and nothing further. But even that doesn't seem to be a blocker at this point if Github is used as an example.
Good software comes from people who care deeply about solving the problems in way that they are invested in. If your employees don't care about your product, you're already starting on the wrong foot. AI isn't going to incentivize bad-average developers to write better software or a good developer to push back harder against their clueless manager. When they make the decision, AI might help (assuming it doesn't make a bigger mess) but it's not going to reduce technical debt in any meaningful way without a sea change of perspective from product managers around the world.
So far, I just don't see it happening in theory or in practice. I hope I'm proven wrong!
I think I have a different perspective on this because I've worked in places that do care about that sort of thing on tools that do focus on those sorts of things. I think the long term incentive for these tools to address tech debt as a goal comes from the AI eval benchmarks trending towards being saturated. The advantages of one tool over another will be in the longer context things. This naturally will tend to start to act as a forcing function for training to focus on the longer tail of software development. A good way of thinking about this is GPT 3.5 was good at dealing well with lines of code and functions, 4 was functions, small apps, 5 seems adept at delivering apps and systems, 6 will be systems and whole enterprised programs of work.
Maybe it uses some that battery API as a heuristic for a lower-power version of the site? Or maybe they have a web-only version in developing markets? Low battery means it should query for your location less often to save battery?
Totally spitballing here. Strava being a website that requests battery does not seem wildly outlandish to me, albeit it is a bit suspicious in general.
> it uses some that battery API as a heuristic for a lower-power version of the site?
As a naive user I would expect websites to not be able to receive information about my battery state. With that information they can track my mobile phone usage pattern, and with some cross-referencing gain even more specific private information.
I hope not. They’ve been flip flopping too much and the market needs more dGPU competition.
The team working on drivers is doing a good job playing catch up and I hope intel will continue to invest in cards that focus on graphics workloads and not just on AI inference.
If anyone is wondering how to escape this cycle, the solution is pretty straightforward; don’t buy things you cannot afford with cash/debit.
If putting your credit card balance on autopay is scary to you, you probably shouldn’t have a credit card. Also, having a credit card doesn’t mean you can ignore the charges and settle up at the end of the month. Credit is a tool that can be abused and misused like any other tool.
Personally, I’m anti credit in general and don’t have credit cards or a credit score. But I also moved to Europe where credit is not nearly as important as when i lived in the US.
>Personally, I’m anti credit in general and don’t have credit cards or a credit score.
if only people could choose to have or not have a credit score. that would be cool. unfortunately, equifax/transunion/experian are some of the original data vacuums and assign one whether you want one or not.
Yep. I'm old enough to remember when credit agencies were considering dubiously legal. It was illegal (in my state at least) for a group of merchants to run a shared 'blacklist' of customers back in the day. The credit agencies side-stepped this. It was pitched as an "opt in" sort of situation where if you wanted cheaper credit or to finance a car or some optional thing in life, you could do so. They were not even used (as much, at least) for house mortgages - the bank would go through financial records and check income vs. debt and your banking history instead. Your credit score (or lack of it) was irrelevant.
Then they slowly became endemic to simply participate in life at all. Good luck renting a spot with a poor credit score even in the early 2000's. My second apartment I had to show my (private mom and pop) landlord a great reference from my previous rental plus supply him with a 3mo security deposit since I had zero credit. I learned then that it was a non-optional part of society and I had better play ball or go entirely off grid hermit style.
Then credit agencies started even more BS like putting in your salary history (mined from employers), any criminal records, etc. It's a social credit score in everything but name and likely implemented far broader and wider in society than anything China currently has. You will literally be frozen out of many careers and entire areas to live if you do not maintain it.
Yours is also a good theory, but there are plenty of people that find themselves in a situation where income can lag behind expenses.
When it comes to the choice of being responsible with debt or making sure your kid has calories today, there isn’t really a choice in reality.
There is a lot to be said for better financial education, but there is also a lot to be said for services like credit cards that allow someone to smooth out a cash flow issue.
It all seems so obvious until you find yourself in that situation. Most (or many at least) people in debt aren’t stupid or reckless, although they may be ignorant of their options for spending better and for borrowing better.
I strictly use it to accrue points, but general advice is that credit is useful to smooth out the lumpiness of pay cycles, but if you can’t pay the debt back on necessities within the credit cycle, you shouldn’t use it at all.
Since credit is the primary means used for discretionary spending, I firmly believe that the accessibility of quick (but not necessarily cheap) interest allows inflation to go unchecked.
I was deliberately debit-only for years. Someone on a podcast explained why they used credit cards for extra protections from banks beyond debit cards. I don't know the accuracy of what was said, but the show is hosted by three smart people and neither of the other two disagreed that credit cards have more protection than debit cards so I assume it was generally accurate. I got a credit card right away and use it for most purchases and pay it off in full every month.
I sort of agree although I am for credit cards if they help me with deals since I am frugal personally but even I am thinking to just use credit cards of my close cousins/family if they already have one.
I am giving a transcription of the situation in the video[0] but buy now pay later apps have on average 300% apr (yes this is not a joke) and even ask for tips and have so many dark patterns, both these industries are really similar/the one basically.
> She had just switched to this remote job, which was a pay cut, but it let her stay home and care for her son at the time. And then after she went back to her normal job, she actually stopped using Earnin for nearly two years. She got on a stable financial footing. She even bought this house. But housing costs are expensive and for a bunch of complicated reasons, her child support payment is less this year than it was before. And that put Runeda in this really precarious position, where if one thing went wrong, it would completely throw her off financially. And about two weeks ago, that's exactly what happened. My son wakes up really early sometimes, and it was, like, 5:00 in the morning, and I went to try to, like, open an app on my phone, and it wasn't loading, and I was like did they turn my internet off? And I checked the router, and it said your service has been interrupted for nonpayment, and I'm like, what the heck are you talking about? The bill used to be on auto pay, but for some reason wasn't anymore. they told me I had to pay, like, over $200. I had like 50 bucks in my bank account. That was the first domino, and everything fell apart from there. Runeda borrowed $150 from Earnin to pay the internet bill, the $20 reconnection fee and the $6 Earnin fee.
Would you recognize the difference between usb 3.2 and usb 2.0? Cables also play into the standard and the reality of our modern lives is that we all accumulate random cables as a matter of course of life. Sometimes things get mixed up and if you didn’t label the cable in some way when you acquired it, there is no way to easily test it without a lot of hassle and headache.
Most type checking happens at runtime (this might not be true for interfaces at some level, but I can’t say for 100% certain - I just know I tend to see interface related errors earlier during code execution…). It’s perfectly valid syntax to declare a private method as returning an integer and then for the body of the method to return a string (explicitly cast as a string even). As long as you never call that method at runtime, no exceptions will be thrown.
With a half decent IDE or LSP, these sorts of runtime exceptions can be easily avoided but technically they still exist and if you don’t know about that, it can be argued to be confusing. PHP has made a lot of trade-offs to largely maintain backwards compatibility and many of them live in decisions that happen at runtime.
Modern PHP tooling can provide type safety in a very similar way to Typescript if you’re willing to put in the effort while also still technically offering you an escape hatch to do whatever the heck you want and duck type to your hearts content.
reply