@oliver@phpc.social avatar

oliver

@oliver@phpc.social

Earning a living with #PHP since 2005. In love with modernizing legacy codebases, excited by mission critical features.

This profile is from a federated server and may be incomplete. Browse more on the original instance.

WhyNotZoidberg, (edited ) to random
@WhyNotZoidberg@topspicy.social avatar

for is still weird the way they have removed the home button's functionality; you HAVE to go into tabs and close all tabs manually to actually be at the true homepage again.

Edit: found the problem: Mozilla really hate you if you want to close tabs. Why isn't there a "close when home button pressed" option? Again, this seems like Mozilla deliberately are obtrusive and then "can't understand" why people don't use their products.

oliver,
@oliver@phpc.social avatar

@WhyNotZoidberg the option "Quit" will close all tabs. Also, going into tabs overview, there's an option to close all of them. It's a non-issue to me, even though I'm one of those who can't stand a ton of tabs open.

afilina, to random
@afilina@phpc.social avatar

Writing software without tests is like fiddling with a TV antenna until the picture is clear, and then stop touching it because it finally works.

oliver,
@oliver@phpc.social avatar

@afilina would that imply not working on the software any more? In reality people are fiddling the antenna every day, with the TV being off, then all are happy when the TV is turned on and the picture is still clear. If it's not then rollback the position, and try the fiddling a bit more carefully (now with the TV being on - hotfix in production :))

oliver, to php
@oliver@phpc.social avatar

A bit of a rant about some composer packages.

It's such a burden do deal with those that bump the PHP runtime requirement up to ^8.0, and also drop the one for 7.x in the same release, with no actual changes that would really make the package depend on 8+. Literally zero buffer for the transitional period which would allow projects to sit on 2 chairs a bit.

oliver,
@oliver@phpc.social avatar

What this means in reality is that the feature branch to bump the project to the next version grows with no real need or benefit in such cases. Those packages need to sit in a feature branch, growing the diff and congnitive load for everyone involved.

It's not always the case with 7->8 bumps only, I've seen many bump the requirement to e.g. 7.4 and drop the 7.1 in the same release... with zero 7.4-specific features used in it.

Crell, to php
@Crell@phpc.social avatar

New rule: If you're implementing any library that involves IO (database or remote system), you must provide a mock version/in-memory version of it for testing.

It's your responsibility to make your code easy to mock for those using it, so that their tests can work.

If you do not, you are the one who is wrong and it is your fault.

Think about how your users will test around your code. Don't be irresponsible.

oliver,
@oliver@phpc.social avatar

@Crell currently on a long road to make a huge project compatible with 8 and (among others) there are 20+ in-house API client packages stuck on 7.2, with zero tests, that don't even support getting a custom (mock) handler 😶 So yes, there's a new rule for such packages coming into existence

grmpyprogrammer, (edited ) to random
@grmpyprogrammer@phpc.social avatar

Gen Xers remember the glorious times of torrenting movies (and Napster too) and I wipe away a tear of joy that we get to live through it again

oliver,
@oliver@phpc.social avatar

@grmpyprogrammer my university (in Serbia) got an email from Columbia Pictures because it was among the top seeders of a movie that's been freshly released in cinemas in USA. For some time most of the departments had been limited to intranet access only 😄 A lot of promises has to be made before our office got the access out of that walled garden.

Crell, to random
@Crell@phpc.social avatar
oliver,
@oliver@phpc.social avatar

@Crell Indeed. Very little of what is labelled as "tech debt" actually is the tech debt. I prefer to use the term "maintenance" when it comes to dealing with such work. It describes it better, and also it's easier sold to upper management when it turns out that this new feature requires more then just shoveling more layers on top of the existing code 😶

mhoye, to random
@mhoye@mastodon.social avatar

I felt this in my teeth.

oliver,
@oliver@phpc.social avatar

@sjstoelting that's interesting. On the other hand, what works for one org may not work for others. I'm not defending Jira, it's a pile of trash. But, email for issue tracking / project management is (to me) as bad as Jira 😦

nicktron, to iPhone

I’ve never used an on my phone before, but I think I’m going to start. I have an and use . Can anyone suggest their favourite? TIA!

oliver,
@oliver@phpc.social avatar

@nicktron ublock does the job pretty well

anderseknert, to random
@anderseknert@hachyderm.io avatar

An interesting aspect of design is how error messages are almost never included in any "contract", and as such subject to change at any time, often without so much as a mention. From what I've seen, consumers "depending" on error messages is however quite common, as there often is no better way to differentiate one error from another. Error codes solve this for REST APIs, as do granular types for exceptions and errors in programmatic APIs... but honestly, no one seems to bother.

oliver,
@oliver@phpc.social avatar

@anderseknert I could write a book about terrible APIs 😓 My current job includes integrating with many fintech companies, and I sometimes truly can't understand how they even operate at such a huge scale... Errors are the worst, usually a big chunk of them aren't even defined in the spec. So, what I do is go and attempt all kinds of weird things in order to gather as many error codes/messages as possible, and then write scenarios for handling them.

inurlibrary, to firefox
@inurlibrary@mastodon.social avatar

Switching back to from for work stuff and wishing there was an easier way to switch between user profiles other than about:profiles -- anyone know of a better way? Only saw one extension in the directory and it looked a bit sketchy.

oliver,
@oliver@phpc.social avatar
chirpbirb, to linux
@chirpbirb@meow.social avatar

are there any clients for ? web browser is fine w/ the advanced layout but i wonder if there's something native so i don't have to have a tab open all the time...

oliver,
@oliver@phpc.social avatar

@chirpbirb @Catwoman69y2k

@trunksapp is very decent, too. I have Tusky too, but I find myself using Trunks more often

ChanceHMiller, to random
@ChanceHMiller@mastodon.social avatar

one day i will learn how to properly spell accomodate

oliver,
@oliver@phpc.social avatar

@ChanceHMiller bureaucracy and ambiguous are my pain points (thanks auto-suggest/correct)

grmpyprogrammer, to php
@grmpyprogrammer@phpc.social avatar

To the #php folks lurking out here — hit me up with your questions and struggles with getting some kind of automated testing working

oliver,
@oliver@phpc.social avatar

@kboyd I hope I won't be boring too much with codeception, but it's a life saver when it's too risky to do major reflectors. You can set browser tests up, but also unit tests that will work against your test db, and it's then possible to just call your static methods, letting them do the real work.

It's awful from a certain standpoint, but also a good tradeoff from another one. What grumpy said is of course the best way to do it.

oliver,
@oliver@phpc.social avatar

@sarah if unit tests are impossible to write (which is almost an absolute rule in the beginning with such projects), you can set some end-to-end (browser) tests up with e.g. codeception, and then start refactoring the code that those tests cover. Start with the ones that are the essential for the app to work, then core business logic etc.

It takes time to prepare the grounds, but in the long run you will thank yourself many, many times.

carnage4life, to random
@carnage4life@mas.to avatar

It was quite obvious Reddit’s CEO has been inspired by Elon Musk but it’s kind of delusional to describe Twitter as an example that you can build a really good online busines.

Are all these CEOs on crazy pills?

oliver,
@oliver@phpc.social avatar

@halas People owning businesses on a much smaller scale than Twitter or Reddit suffer from this same detachment from reality, but the boom from their actions has a very small radius.

And, it does indeed make one dust off their CV when such things become obvious

dandb, to php
@dandb@mas.to avatar

So that XML-based framework I was complaining about the other day... it gets worse.

Turns out not only are all its XML templates separate, non-injectable entities that each do their own SQL queries, but also the DB read/write class also has these hidden hooks for various different record types (like writing in calculated values).

But these hooks ALSO do their own queries. The framework is essentially doing a crap tonne of redundant DB IO for every single action it takes.

oliver,
@oliver@phpc.social avatar

@dandb it's hard without seeing the codebase, but: can you do a mass find&replace, to make those queries go through your class/function first (and where you'd do the cache thing)?

oliver,
@oliver@phpc.social avatar

@oliver @dandb After several hours in there, the only way I could speed it up (apart from rewriting the majority of it), was a very barbaric caching mechanism. I'd make a hash of an SQL query as a key and store the result in memcached 🙈 Luckily, it was possible to do that from the "god" db class. I'd drop the cache every 5min or when something "major" happens (e.g. a news article posted). After that, the site was flying. Can you maybe do something similar if the db is the bottleneck? 😅

oliver,
@oliver@phpc.social avatar

@dandb How did it go? 😶 It's an awful hack, but it can be a life saver... Of course, cache invalidation is a big thing as well, because you don't really want to have that issue alongside everything else that's already horrible. I hope you can set some rules up to mitigate stale cache problems.

oliver, (edited )
@oliver@phpc.social avatar

@dandb that sounds horrible. how do people come up with such ideas, then implement them, and never see how bad they are - I'll never understand.

On the other hand, years ago I had a task to speed up a news website that was too slow. To run it locally I had to increase Apache & PHP timeouts to 5min, as 30s wasn't enough. So many db queries, so many repeated ones, or things like counting the number of comments by doing a select * and counting rows in PHP (actual data not used for anything)

drmaddkap, to random
@drmaddkap@meow.social avatar

BORG: We are the Borg. Resistance is futile.
MY 5 YEAR OLD DAUGHTER: Why?
BORG: We will add your biological and technological distinctiveness to our own.
5YO: Why?
BORG: To expand the collective.
5YO: Why?
BORG: So that we may achieve perfection.
5YO: Why?
BORG: To reach the pinnacle of our evolution.
5YO: Why?
BORG: sigh Because it’s just something we do, ok?
5YO: Why?
BORG: … you know what? F this …opens a transwarp conduit and leaves

oliver,
@oliver@phpc.social avatar

@drmaddkap at some point in the past I touched the topic of evolution during one of those "why" sessions.

Now, almost every day I get a question in form of "before lions became lions, what were they?" 😤

djumaka, to random
@djumaka@phpc.social avatar

I'm doing more code reviews recently than coding myself. I notice that I have quite some structural and inconsistency notes and I'm thinking if I would be that considerate about these things if I did the code myself or is it always a matter of noticing such things when you review others' code. And if it's the 2nd isnt it all some ego stuff ...

oliver,
@oliver@phpc.social avatar

@djumaka I think we are all expecting solutions that we ourselves would create.

The most challenging part for me is not to ruin other person's creativity; not to re-shape the code they produce into something that I'd write myself. I try not to post comments too quickly, instead giving myself time to absorb the other person's way of thinking first. Definitely there's ego stuff trying to make its way there :)

valorin, to php

Security Tip: Replace simple dependencies with in-house versions!

The more dependencies your project has, the higher your risk of supply-chain attack is, and the less you're aware of what code is actually running…
https://larasec.substack.com/p/security-tip-replace-simple-dependencies

oliver,
@oliver@phpc.social avatar
oliver,
@oliver@phpc.social avatar

@valorin it's also the way to have less headaches when going for a new version of PHP, when projects get abandoned in the meantime or their pace is simply slower than yours

grmpyprogrammer, to random
@grmpyprogrammer@phpc.social avatar

At the gate for my flight home, ask me anything

oliver,
@oliver@phpc.social avatar

@grmpyprogrammer Do you have some badass legacy project that's stuck on an EOL PHP version and desperately needs an upgrade? 👀 I could maybe help - should you need it (part-time since I already have a FT job, but this kind of work has always been oddly attractive to me)

dandb, to php
@dandb@mas.to avatar

The more I use enums, the more I like them. There's a bunch of places in the app I'm working on where we have a bunch of foundational data that's just wrapped up in config classes, that now can be switched to enums.

I love that I can add methods as well. It's nice to be able to serialize an emum, for instance, for stuff like <select> elements.

oliver,
@oliver@phpc.social avatar

@dandb Managing enums prior to native support is such a pain - every solution is "dirty" in one way or another.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • provamag3
  • magazineikmin
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • JUstTest
  • All magazines