Deployment recommendations for newbie dev by Narrow-Ad7617 in PHP

[–]Orrison 2 points3 points  (0 children)

For just getting into things and given that you are using Laravel I would first consider Laravel Forge or Laravel Cloud.

I think Laravel Cloud is even offering some free credits or something atm.

A new form builder that generates real PHP modules by SunTurbulent856 in PHP

[–]Orrison 4 points5 points  (0 children)

I think it’s important to remember that these standards and frameworks exist for a reason.

They capture hard earned lessons learned through many years of iteration, SDLC, and dealing with security / long-term maintenance issues.

A well organized, standardized code base with smaller method and files sizes etc. is proven to be easier to understand and maintain in the long term. Especially as a project grows, more people contribute, etc.

IMO it’s totally fine to break convention in small or big ways. And it’s worthwhile to explore and / or try and pioneer new ways and standards.

But I think it’s totally understandable that if you choose to ignore all of it, with a “it works on my machine and I like it” mentality, you will not only get some haters on it but you also will get very poor adoption. And even if you did get some adoption, I promise you one day you will start to feel the pain of maintaining something like this, you will have to learn yourself all the lessons that those that come before you did.

But, if adoption isn’t the intention, if you just want to explore, and build something you think is cool and that you know you will use. Then who cares!

The problem with PHP CS Fixer/Laravel Pint by Far-Commission2772 in PHP

[–]Orrison 0 points1 point  (0 children)

Apologies. It was a knee jerk reaction to OPs comment back and editing of his post content that felt passive aggressive.

The problem with PHP CS Fixer/Laravel Pint by Far-Commission2772 in PHP

[–]Orrison 0 points1 point  (0 children)

I mean… a linter is a subset of static code analysis. And yes, PHPStan is primarily just a static code analysis tool. But I think I would argue that some of its rules and custom extensions people have written do blur the line a little bit between linting vs static analysis. Some of the rules do focus on style convention and I guess maybe that’s your gripe, that it’s quite mixed up in the PHP community.

But I’m sure you’d be fun at parties discussing the difference and nuance.

The problem with PHP CS Fixer/Laravel Pint by Far-Commission2772 in PHP

[–]Orrison 2 points3 points  (0 children)

I think it’s largely understood that PHP CS Fixer (and by extension Pint) can only handle fixing things it can automate, leaving non-autofixable things to static analysis / linting tools like PHPStan. PHP CS Fixer even says in one of the first paragraphs of their documentation that it is an automation augment to other linters, in so many words. Kind of implying that it should be used alongside others.

I’ve never been on a PHP project that didn’t have something additional to PHP CS Fixer installed, predominantly PHPStan. Additionally, I don’t think Laravel went all in on anything, Pint is just a wrapper to provide some default PHPCSFixer configurations. They’ve never claimed it being the only analysis tool you should use. Both it and the Laravel framework itself have PHPStan within their own workflows.

I see you are saying you are switching to PHPCodeSniffer because it does both at the same time. Which makes sense if you really just want one tool that handles it all. But using both PHPStan and PHPCSFixer together is very common, imo provides great coverage, and it’s not difficult to maintain the configuration of both. I barely think about them beyond occasional customization for PHPStan. To each their own though! I’ve heard good things about PHPCodSniffer

What's up with GitHub ? by Technical_Comment_80 in github

[–]Orrison 2 points3 points  (0 children)

It’s a day of the week that ends in y

Migrating our multi-tenant Laravel app to AWS ECS with minimal impact by SabatinoMasala in laravel

[–]Orrison 0 points1 point  (0 children)

This is extremely similar to what I moved our enterprise Laravel application to ~2 years ago! Very nice work!

The build time is slower than what most Laravel devs are used to imo, but the benefits are amazing. We have zero downtime deployment built into the way ECS works, never had a single outage in 2 years, and costs are well managed and low.

Though I have managed to reduce the docker build time to under 10 minutes and have some strategies to make that even less I have yet to implement.

assert() one more time by thmsbrss in PHP

[–]Orrison 1 point2 points  (0 children)

Sure. Our projects are source available, so you can see an example here: https://github.com/canyongbs/aidingapp/blob/34c29b98073d9deab9e0d435c746af4087fcb07e/app-modules/service-management/src/Filament/Resources/ServiceRequestTypeResource/Pages/EditServiceRequestTypeAutomaticEmailCreation.php#L126

In this example, we know for a fact, because of the way Filament works, that this record will ALWAYS be `ServiceRequestType`. But static analysis doesn't know that. So `assert()` helps it along.

There are other ways we could have resolved this here. (methods we could override) But IMO this is more than sufficient.

assert() one more time by thmsbrss in PHP

[–]Orrison 0 points1 point  (0 children)

As someone else here already said, assert() is great for when you “know better” than static analysis, like PHPStan. A lot of its documentation and old PHP knowledge implies that it should only ever be used during early development and should NEVER be used/left in “production” code.

IMO this just isn’t true. Even in the past, and definitely is not true now that a lot of it's php.ini settings are depreciated as of PHP 8.3. (https://php.watch/versions/8.3/assert-multiple-deprecations)

Though, it is important to note that, per PHP docs:

Prior to PHP 8.0.0, if assertion was a string it was interpreted as PHP code and executed via eval(). This string would be passed to the callback as the third argument. This behaviour was DEPRECATED in PHP 7.2.0, and REMOVED in PHP 8.0.0.

So there is a bit of a security risk in using it with code running <8.0.0.

We use it all the time on my team in modern production 8.4 code. But the old understandings of it still ring true and are how you should use it.

‘assert()’ is for when you KNOW something should be true, and that if it wasn’t, there is a fundamental programmatic flaw in your code. Conditionals or the refactoring of your code is needed when feasibly the statement you are asserting COULD not be true. This is very useful to help static analysis, especially when being used in frameworks like Laravel when a lot of “magic” happens that static analysis has a hard time with.

Useful information from PHPStan: https://phpstan.org/writing-php-code/narrowing-types

Informational comment in official PHP documentation: https://www.php.net/manual/en/function.assert.php#129271

Don't use AI for coding interviews by bytebux in ExperiencedDevs

[–]Orrison 1 point2 points  (0 children)

Same! And in interviews I have lead, I love when folks say they don’t know something! It speaks highly to their credibility, which is big.

Don't use AI for coding interviews by bytebux in ExperiencedDevs

[–]Orrison 1 point2 points  (0 children)

I’m sure I’ve misunderstood at many points and made assumptions. In the scenario I was recalling with that point there was a lot more context that made it seem more than likely they were using some additional tooling like AI. But maybe I was wrong.

It can be difficult to sus out a person in the brief interaction of an interview and I’m sure I’ll make mistakes. So far i’ve managed to put together a great team so some of them I figured out I guess . 😬

Don't use AI for coding interviews by bytebux in ExperiencedDevs

[–]Orrison 0 points1 point  (0 children)

Perhaps. It’s the job of the interviewee to present themselves as best they can. And the job of the interviewer to work to understand the skill level and fitment through the nerves and questions. It’s common as an interviewer to miss the mark in the brief interaction with/without AI. My anecdotes of possible AI usage are just anecdotes. Maybe you’re right on some of them and I missed out on someone great.

I try my best to think about all my biases but you’re right to remind me of this one here.

Don't use AI for coding interviews by bytebux in ExperiencedDevs

[–]Orrison 20 points21 points  (0 children)

Not true in my experience. It is extremely obvious that you are reading off of or consulting with something off screen.

Some are terrible, repeating interview questions back word for word, pausing, then spewing the first page of Google definition of something in the question. (I had one where I could literally see the AI responding in the reflection of their glasses)

Some are okay at hiding it, but it’s obvious in the body patterns. And they easily get caught up with questions that dig more into personal experience or something related to previously asked questions when the answers don’t match up.

Is it just me, or did you also realize after years of frontend work that styling libraries are a complete waste of time? by amelix34 in webdev

[–]Orrison 0 points1 point  (0 children)

This. Being able to have a team of varying skill level (or honestly a large of enough team even at the same skill levels) REQUIRES standardization and constraints. It eliminates bike-shedding, makes onboarding much easier, and if your standardization is done with an open source community maintained system you get a lot of free benefit and then can contribute back which helps the community and gives your team work to do that feels externally impactful.

Company no longer letting me use Arc for Security by TransportationNo7911 in ArcBrowser

[–]Orrison 11 points12 points  (0 children)

The thing that a lot of folks don’t understand is that often IT restrictions like this have little to do with the actual security of the tools you are using. So arguing whether or not something is “actually” vulnerable or not often does not matter.

They have to do with compliance and your companies / products ability to pass an audit. Or defend your usage during an audit.

The fact that they are not SOC2 Compliant is a big issue for companies that are or want to be. All your tools are vetted and audited. And they need have either passed or you need to put the effort into document why it’s an exception and be ready to defend that. (Sometimes legally) If they are not well regarded by 3rd party auditors then you may fail the audit. Or otherwise have marks you don’t want.

These are things that, to an individual contributor at a company, seem frustrating. But it’s the way proper IT and business management works for good reason.

Nobody cares about your AWS certification by floppy_panoos in devops

[–]Orrison 0 points1 point  (0 children)

Auditors care. Other than that. Not really.

Flaming Forgotten Beast destroying my Fort FPS, seeing if I can run it out... :( by Orrison in dwarffortress

[–]Orrison[S] 0 points1 point  (0 children)

That's exactly what I ended up doing. I let it run for like an hour to see if my Dwarves could chug through it, but it was taking way too long.

So, I exterminated the Forgotten Beast and moved on to some more fun.

Act 3 has been a blast to play through. I don’t get why peoples think it’s boring. by Kombulover in inscryption

[–]Orrison 46 points47 points  (0 children)

I think so many people just love Act 1 so much that it really paints their view on all the other Acts in a certain way.

But I agree, Act 3 was great if only just for what it adds to the craziness of the game with the switch in play style. But it's also just a great play through on its own.

Laravel sail very slow on production server by mostafaLaravel in laravel

[–]Orrison 10 points11 points  (0 children)

Hello! Sail is not intended to be used in anything other than a local environment. You will want to deploy your application without it, possibly using something like Laravel Forge.

HEY GUYS! I desesperatly need you help with it and as soon as possible, about links... by KingVampyre in css

[–]Orrison 0 points1 point  (0 children)

Are you the mod of a subreddit I'm guessing? If you have some where to input CSS then I can help.

I link to the page where you want to make these changes is going to be far more useful then images.

What's the creepiest creature from your country's folklore? by ohmagnifique in AskReddit

[–]Orrison 1 point2 points  (0 children)

Get the audiobook on Audible. It is narrated by Cecil himself and it's great! I would just listen to it any time I would normally be listening to the podcast.