@Crell@phpc.social avatar

Crell

@Crell@phpc.social

Anything worth doing is worth doing well.

Anything worth doing well is worth teaching others to do well.

Author of Thinking Functionally in PHP, now on LeanPub: https://leanpub.com/thinking-functionally-in-php

#tootfinder

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

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

This past week I had a problem at DayJob that would’ve been easier to solve if we had adopted the use of repositories that create immutable value objects. Since this is a Laravel project, I was overruled. My first implementation ended up being wrong (found out via production testing) and the fix ended up involving Eloquent mutators.

I still think value objects are the better solution but my boss both disagrees and trolls me about it.

Crell,
@Crell@phpc.social avatar

@grmpyprogrammer You're right. Laravel is wrong. The boss needs to learn this.

maxalmonte14, to random
@maxalmonte14@indiehackers.social avatar

So many "democracies" have been reduced to choosing the lesser of two evils. In many cases (stupid) people are even blatantly deceived to pick the worst of those two evils — I bet you can think of a couple of examples yourself — so needless to say, this shit ain't working.

Crell,
@Crell@phpc.social avatar

@maxalmonte14 Democracy is the absolute worst form of government, except for all the others.

(Churchill, supposedly.)

Crell,
@Crell@phpc.social avatar

@maxalmonte14 The main alternatives are monarchy and oligarchy. Democracy seems better.

Democracy's main weakness is its tendency to devolve into the other two rather readily.

Crell,
@Crell@phpc.social avatar

@maxalmonte14 Socialism is an economic system, not political system. People forget that.

Crell, to random
@Crell@phpc.social avatar

What "Follow you dreams" misses.

https://youtu.be/W3I3kAg2J7w

Crell, to php
@Crell@phpc.social avatar

Please, web app developers, consider how your users will upgrade. If your upgrade process is "remove the old one, unzip the new one", then it's not an upgrade process. It's an encouragement to never upgrade.

#PHP #Laravel #Programming

Crell,
@Crell@phpc.social avatar

@sarah Trying to upgrade Koel (Laravel-based self-hosted music streamer, pretty nice), and... there's a reason I haven't bothered to upgrade in a while.

Crell,
@Crell@phpc.social avatar

@ralphschindler I don't believe I said otherwise. (I've had similar issues with many other web apps. This is just the current one I'm fighting with.)

Crell,
@Crell@phpc.social avatar

@ralphschindler Probably? That's a larger lift than I have time for right now. I just want to upgrade my app and figure out why the search function doesn't work.

Crell,
@Crell@phpc.social avatar

@acelaya I don't have a very easy solution. I've seen "checkout from Git and change your tag", "Composer update," and self-modifying updaters (eg, Nextcloud, or the Platform.sh CLI app).

I think an update CLI command is probably the best option for non-cloud envs. In concept it could make its own backups and do the download for you from GitHub, using the API. Though that is admittedly more work.

Crell,
@Crell@phpc.social avatar

@acelaya Another option I've attempted myself is to put virtually all the code into dependent Composer packages. If there's nothing not-in-composer to update, then a composer-update will do everything.

That helps, I think, but sadly does have an upper bound on what you can move out of the main app. And requires someone have composer installed.

sarah, to random
@sarah@phpc.social avatar

PHP needs a code of conduct for the project itself. Is there anyone willing to push for an RFC to add one with me? #php

Crell,
@Crell@phpc.social avatar

@heiglandreas @sarah @ramsey @pronskiy I'm pro-CoC in general, though the specifics matter. A bad CoC is worse than no CoC.

My issue is that every time I've tried to propose a CoC in the past for FIG, I got sealioned by "well why aren't you just using Contributor Covenant?" as the only feedback, and "I dislike CC v1 for $reasons" wasn't a sufficient explanation.

So yeah, I support a CoC for both Internals and FIG, but depends on details, and I will not be the main sponsor.

Crell,
@Crell@phpc.social avatar

@sarah @heiglandreas @ramsey @pronskiy v1, no. v2, I'd have to look at it again to see if I like it. It's been a while.

My repos all use the Code Compact as a CoC, which is what I'd proposed for FIG. Some felt it was too wishy washy, though. (I liked that it was mostly "do this" rather than "don't do this.")

http://codemanifesto.com/

Crell,
@Crell@phpc.social avatar

@maccath Oh geez. I don't know if the maintainer is even active anymore, but I'll leave an issue on the GitHub repo just in case.

Crell, to php
@Crell@phpc.social avatar

Any time I see "bad" code, the first answer is usually "you need more precise and strict types."

Often there's other stuff wrong, but easily 70% of the time, the fix starts with "define the problem better and the problem goes away."

#PHP #Kotlin #Programming

Crell, to ai
@Crell@phpc.social avatar
michael, to php
@michael@thms.uk avatar

Got to say: Just been through upgrading an app from 8.1 to 8.3 and it's really nice and painfree.

Very few breaking changes, and the few that are there are stuff that a sensible person would've addressed a long time ago.

Unfortuantely that means that apart from readonly classes, there are also few exciting new things in there. But I guess these also are just point updates after all…

Almost boring 😉 (Not a bad thing! Stability is also nice.)

Crell,
@Crell@phpc.social avatar

@michael As a general rule, "well-behaved" code tends to upgrade very easily and quickly. Code that is not well-behaved... less so.

Mainly that's because older PHP versions allowed all sorts of stupid shit, and the list of allowed stupid shit has been steadily decreasing over the years. The less stupid shit your code does, the easier the upgrade process will be. 🙂

Crell, to Ukraine
@Crell@phpc.social avatar

Remember: Every mile of land lost by this month to Russian invaders is the direct result of intransigence and refusal to stand by our allies just so they could make Biden look bad.

Every Republican legislator is a threat to national security. Every. Single. One. Treat them as such.

Crell,
@Crell@phpc.social avatar

@tress777 Uh, non-sequitor much?

Crell,
@Crell@phpc.social avatar

@tress777 I'm not assuming. I'm quoting. The GOP has been very open about opposing various deals just to avoid giving Biden a "win". Trump has specifically told them to, in public. Trump is also well documented as being compromised by Putin, so there's the potential treason, too.

Meanwhile, Russia continues to commit war crimes and genocide in Ukraine, daily.

Crell,
@Crell@phpc.social avatar

@tress777 As for "keeping the politics off the platform," no.

We're whole people. Dismissing concerns about injustice because you're not interested in them is a sign that you don't care about injustice. The tech world especially desperately needs to understand and care about injustice, especially the injustice it actively causes. "Tech without politics" is the politics of exploitation.

If you can't handle me at my political, you don't deserve me at my technical.

Crell,
@Crell@phpc.social avatar

@tress777 Also, I'm a Free Software advocate. That's tech and political, by definition.

https://peakd.com/programming/@crell/free-software-is-political

Crell, to python
@Crell@phpc.social avatar

No, #Python, this really is a gotcha, and a stupid one at that.

https://docs.python-guide.org/writing/gotchas/#mutable-default-arguments

Crell,
@Crell@phpc.social avatar

@maxalmonte14 It's more that all default arguments are function-static. Which... holy crap, that's dumb.

(This is apparently a long-standing feature of Python, not something new. I only just learned of it.)

grmpyprogrammer, to random
@grmpyprogrammer@phpc.social avatar

It’s Friday so once again, Ask Me Anything.

Crell,
@Crell@phpc.social avatar

@grmpyprogrammer How much longer before you give up on the trainwreck that is tech and become a farmer?

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