@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.

oliver, to php
@oliver@phpc.social avatar

One of the annoyances found in the codebase I'm currently busy with is finding many traits that are used in one single class. Those traits have literally zero other places they could be used at, so... why? Just because someone else did it, you don't have to the same thing. Also, don't do that if you think it just may be needed in the future. Do it only if that's really, really needed now.

oliver, to random
@oliver@phpc.social avatar

New addiction unlocked. Three of us working on it, after 24h (on and off)

oliver, to random
@oliver@phpc.social avatar

This weekend was the one when a moderately important 1.2TB table gets locked up because its primary key reached its max unsigned int value, and no more inserts could be performed 🥶

oliver, to random
@oliver@phpc.social avatar

Let's see how many versions of I need to go back to, in order to up my containers under 5s again. This last upgrade to 4.25.2 is unbearable, it takes ~3 minutes for something that used to be a couple of seconds (no builds etc).

Wondering if that's something specific to my setup or the progressive degradation is noticeable for others as well?

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

4.24 was slow already, didn't bother trying again.

Tried 4.23, it's a bit better but still not as good as it used to be:
Task completed in 1m0.562s

Went back to 4.22, ran the script to boot them up aaaand now we're talking:
Task completed in 0m1.797s

Thanks for making it easy to get older versions that actually work fine.

oliver,
@oliver@phpc.social avatar

@alexdeathway It's spinning up 10 containers... it was like that before, and gradually got worse and worse, while literally nothing changed on the containers' side.

I initially thought that maybe running the 1st time after an upgrade is doing something under the hood, and that subsequent runs won't be so slow. I was wrong, it was that slow every time. Thankfully I don't need anything from the newer versions, going to ride this version for as long as possible :D

Crell, (edited ) to php
@Crell@phpc.social avatar

I'm noodling with a data storage layer library in . specific. There's 2 options:

  1. Auto-generate SQL tables/views/queries off of PHP data types (with attributes)
  2. Auto-generate PHP classes off of SQL tables/views/queries.

Which would you prefer? The goal is fully typed interaction in PHP space, but I'm not sure which side should be canonical.

Which would you rather work with, and why? Assuming a "good" DX in either case.

Answer why in replies, boost for reach, etc.

oliver,
@oliver@phpc.social avatar

@Crell SQL canonical. I'd use a dedicated tool for migrations, and regenerate PHP classes when necessary. Database is the source of truth, so that's where everything else should be derived from.

ryze, to Youtube

I've made browser extension for debloating YouTube's UI. Get rid of distracting page elements by choosing to show only what you actually use.

Additionally it supports ff2mpv integration and redirecting home page to subscriptions, if you are tired of the recommendation system.

Available for Firefox: https://addons.mozilla.org/addon/youtubecustomizer

Source code: https://github.com/ryze312/youtube-customizer

image/png

oliver,
@oliver@phpc.social avatar

@ryze can't wait to be home to test drive this on my laptop. I'm extremely annoyed by YouTube's layout and, looking and the screenshot of the extension's settings, it seems I'll finally be able to tailor it to my own prefs.

grmpyprogrammer, to random
@grmpyprogrammer@phpc.social avatar

I’m with Marco on this — ChatGepetto-powered tools will spit out all sorts of crummy code full of bugs and impossible to test, and then companies will try and pay poverty wages to fix it. I get paid what I get paid because of what I know — I will not work for anyone who thinks my job is to correct the output of a bullshit machine https://mastodon.social/@ocramius/111377281132508260

oliver,
@oliver@phpc.social avatar

@grmpyprogrammer or just multiply the billing rate by x10 if the job is to fix the bot's output

tim, to wordpress
@tim@mastodon.timnolte.com avatar

I've been a proponent of the "return early" pattern in programming for some time. In code reviews I generally call this out. I recently found an excellent article that provides an alternative coined the "break/continue guard clause" pattern. As a developer I appreciated this article using WP Core in the examples.

https://mikeschinkel.org/2019/better-alternative-to-return-early-php-wordpress/

oliver,
@oliver@phpc.social avatar

@tim Honestly, the break/continue "solution" is even worse than the original code in the article.

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

In kind of a funky mood today.

Have you ever experienced your brain rewiring itself?

I’m pretty sure this is what it feels like. Or maybe it’s just an as yet unidentifiable rumination.

Regardless not sure if I like it or not.

oliver,
@oliver@phpc.social avatar

@itsjoshbruce your words are pretty vague (it may be the best you can do), but you've reminded me of something that happens to me sometimes: feeling of nearly absolute chaos in my head, usually when there are so many things happening around me and I almost feel I lost control of... everything.

But, at the same time there's some kind of a "background feeling" that it will all start to make sense soon. And it always turns out to be that way (so far 😄).

Is it something like that?

valorin, to random
@valorin@phpc.social avatar

Any crypto/password entropy nerds able to help me out calculating possible combinations/entropy?

If an 8 character password with 88 possible characters to choose from has 3,596,345,248,055,296 possible combinations, how many would a password of the same length where one character MUST be a letter [a-zA-Z], one MUST be a number [0-9], and one MUST be a special char (with 26 options) be?

Is it just: 52 * 10 * 26 * (88^5), totalling 71,349,355,151,360?

I feel like that's missing something?

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

@valorin I guess it depends on the time it would take to brute-force it. Quick googling reveals that an 8-char password hashed via md5 and having any of those chars would be cracked in 2 hours. So in that regard it doesn't seem to matter. But, someone without powerful hardware can only guess "manually", and that's where more complicated password is a bit more secure.

Btw, not an expert in the field :)

ryandonsullivan, to random

The new Slack has a feature where at any given time you can have between 0 and 9 new notifications and the real number doesn’t show up until you open the app to reveal. Schrödinger’s notifications.

oliver,
@oliver@phpc.social avatar

@ryandonsullivan Jira is doing the same, except it doesn't show the real number anywhere. "9+" on the badge, then opening the notification popup and running a javascript count on elements is like 150.

nixCraft, to random
@nixCraft@mastodon.social avatar

| ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄|
You don’t need a MacBook
to be a Programmer
|______________|
\ (•◡•) /
\ /
——
| |
|_ |_

oliver,
@oliver@phpc.social avatar

@solohan83 but, why not use it? I mean, it's a computer, it gets the work done, so why not use one?

I don't get the whole macbook thing popping up every now and then. It's a tool. Let people use whatever tool they want, regardless of its name, color, price or whatever. It just doesn't matter.

salcode, to github
@salcode@phpc.social avatar

Just in case you're getting 500 errors from , know you're not the only one. 🙁

(Despite the status page saying, "All Systems Operational")

GitHub status page sayinig, "All Systems Operational"

oliver,
@oliver@phpc.social avatar

@salcode oh, that explains having a pull request which doesn't register a new commit, doesn't trigger a CI run, cannot be closed, and is totally ignorant by remaining open even after I completely deleted its source branch 😑 It closed itself like 30mins later. I thought that only that PR was bugged since everything else worked fine.

oliver, to random
@oliver@phpc.social avatar

Not talking in public about things you aren't familiar with enough can save you from appearing dumb, embarrassing yourself, and so on. https://mas.to/@carnage4life/111009072085430031

grmpyprogrammer, to random
@grmpyprogrammer@phpc.social avatar

Imagine with a straight face claiming programming will change from “knowing how to solve a problem” to “identifying a problem and getting AI to solve it” My experience tells me that the vast majority of shitty apps and code bases come from having no idea how to solve the problem or what the problem even is

oliver,
@oliver@phpc.social avatar

@grmpyprogrammer the only thing I'd like to use AI for is to "identify a problem", and after that I'd be happy to solve it... however, today's AI sucks so much that I wouldn't let it create some dto/value object classes, let alone solve an actual problem. It's failing on basic things.

carnage4life, to random
@carnage4life@mas.to avatar

A key reason AI will disrupt white collar work is that many of these jobs require knowledge but not intelligence.

Jobs like HR, law, marketing, software development, writing yet another Fast & Furious or Sharknado sequel, etc don’t need original thinking like 80% of the time. They just need you to know the rules of the system.

oliver,
@oliver@phpc.social avatar

@carnage4life I wish you get to work with that AI workforce as your subordinates.

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

Week #6 of work on bringing a huge project (~1M LoC excluding /vendor) from PHP 7.2 to 8. Right now halfway through its composer dependencies.

Today I discovered something that really blew my mind - see the ticket that got spawned after the investigation.

How was your day? :-D

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.

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