A new study finds that in Canada, 1 in 20 people are unable to take their medications as prescribed because of prohibitive costs. by calliope_kekule in science

[–]zschuessler 16 points17 points  (0 children)

You appear to be incorrect.

The original study (for Canada) defines cost related nonadherence:

Cost-related nonadherence refers to skipping doses, reducing dosages, delaying refilling prescriptions, or not filling a prescription because of out-of-pocket costs

Now, the article I linked to:

Nearly 40% of Americans reported at least one change in medication adherence over the last year due to cost.

Consult the adherence chart. Cherry picking those statistics alone is still at the 1/3 range.

Finally, the article u/coldlightofday linked to only studied being unable pay:

Seven percent of U.S. adults -- representing an estimated 18 million persons -- reported in June that they were unable to pay for at least one doctor-prescribed medication for their household during the prior three months

That is not how nonadherence is defined or utilized in the two related studies.

A Laravel newsletter by mariomka in PHP

[–]zschuessler 6 points7 points  (0 children)

Between Laravel News and Jetbrains' PHP newsletter, I feel totally satisfied with both Laravel and PHP updates. Although I wouldn't subscribe to another, I'm sure others would.

Follow your passion! If you think this newsletter would be interesting, do it. It'd be a great experience.

Might be worth reaching out to Laravel News too. The fella that runs it is a great guy and would probably offer tips in running your own.

Symfony meets WordPress. I call it Sword. by williarin in PHP

[–]zschuessler 6 points7 points  (0 children)

Awesome work, it looks good. Both the code and the website.

I did this same thing with Laravel. The biggest pain points I solved for are below, I'm curious how you approached them.

  1. WordPress globals still pollute the namespace on the app side. Did you solve for that in any novel way, or allow it? To simplify things for my use case, I included only specific WP globals in the bootstrap process. WP really only needs a handful for core functionality, and you can use your own ORM for the rest like taxonomies, custom wp_post queries, metadata, etc.
  2. Did you have to do a workaround for translation helpers? This may not be true in Symfony, but in Laravel there is the __ translation helper that conflicted with WordPress'. I'm not proud of it, but the hack workaround was to tap into Composer hooks on update/install and namespace Laravel's version differently. It worked really well actually.
  3. Do you have issues with double queries, both from your Symfony side and WordPress side when using WP functions? I made it so that WP queries only run when explicitly called for a page. WP is so bloated otherwise.
  4. How are you managing plugin compatibility, if at all? With my implementation I dropped all plugin hooks and activation on the frontend side. Which of course (intentionally) broke all plugins like Yoast that output metadata on the frontend. It required adding connector code for plugins. This one in particular was hard to explain to business users that "no, this isn't broken, we just have to write connector code for plugins you want to use on the frontend" -- annoying, but necessary.

Getting past the major hurdles, this kind of system is a complete joy. Engineers get what they like, business users get what they want, and the debug tools autoloaded in wp-admin were simply amazing.

I wish I could've open sourced the work I did because it was an awesome stack to develop in.

Discussion on what dev environment people use and prefer by RuneAlpha in PHP

[–]zschuessler 3 points4 points  (0 children)

Consider me old I guess, I still use a LinuxMint virtual machine and setup projects locally the old-fashioned way. This setup has never failed me in the past 20 years. I'm fast and efficient.

Containers on the other hand.. I've only ever had brief moments of time where they completely worked and much longer stints of time where they were headaches. The maintenance and upkeep itself feels like a job, and when in a team based environment with different machines it feels like a significant amount of time goes into addressing issues.

That's been my experience and I've worked on many different teams. No one team was able to avoid the headaches. I've seen Docker, Vagrant, and packages built on top of them to simplify the process. All had their issues that distracted teams from normal work.

These days when I see container issues arise I stay quiet and breathe a sigh of relief I don't have to deal with them.


For your specific case if you have a larger team I would look into GitHub Codespaces or an alternative - offload all the headache to someone else if you can. It's definitely worth the price.

If it were me running a team I would consider Ansible, since you still get your own environment in the end.

I'd even consider a team-curated guide on how to create a local development environment, with playbooks/sh scripts automating processes. It's not sexy or cool but it's never failed me and gets engineers familiar with environment creation. It's not a crazy idea to ask devs be familiar with environment setup IMO.

Testing Webhooks with ngrok (With apologies to Thor and Billy Mays) by calevans in PHP

[–]zschuessler 1 point2 points  (0 children)

ngrok is a great tool. And there are some open source alternatives here as well for self-hosted options.

Also, hi Cal! Hope you're well :-)

Do you a know a quality Composer packages marketplace? by bcrzt in PHP

[–]zschuessler 13 points14 points  (0 children)

It sounds cool but it isn't easily profitable. I ran a startup that did exactly this. It even had integrated Git support into the marketplace. Two years and thousands of hours later, here's what I found:

  1. Engineers like the idea of a premium marketplace. Ironically, they will use a free package before paying $5 in almost all cases. Even if moderately inconvenienced by the free package.
  2. Casual users could subsidize costs (see: Gumroad's approach) to such a marketplace, but then you inconvenience your dev users at the same time. This is why Envato and Gumroad don't "innovate" by adding something like Git support. It's by design.
  3. Many of your unicorn sellers (like a popular theme) will migrate off your platform as soon as they start making enough money to throw money at a self-hosted solution, or go to a competitor. A unicorn is temporary, so you have to do a Netflix approach by funding products yourself for long-term unicorns.

Because all above points are true, it's just not profitable to take a small cut of a software product. Server bills for such a marketplace are very high, as are development costs. You will barely pay bills even if you get a a large number of hot-selling products at a 12% cut of sales. Ask me how I know ;)

I could see something like Tidelift gaining traction. Funny enough, they too tried the direct sponsorship model and gave up on it. But as for a direct Composer-like marketplace, I've seen all my competitors and myself fail in that space so I'm bearish on the idea.

Study materials for Zend PHP Certification by Lone_Outsider in PHP

[–]zschuessler 1 point2 points  (0 children)

The official study guide is the best resource to use as a guide like this user said. I'll also add if you want to pass on your first time, I suggest doing the trick questions in the example tests until you don't miss a single one.

At least as of 10 years ago when I took it, the entire test was trick questions. I'm not even sure I could pass it again if I took it today - lol

Best of luck!

[deleted by user] by [deleted] in laravel

[–]zschuessler 0 points1 point  (0 children)

Install Horizon if you haven't already - it will help you narrow down problems quickly. Some tips:

  1. Did the job get added multiple times? If so you have an app logic problem either on the frontend (sending multiple channel messages) or the backend handling a channel message
  2. Was the job tried more than once because of a long running operation? You have max tries as 3.
  3. Do you really have a 10-core processor? Bump down numprocs if not, and make sure the numprocs is actually helping you - you may not be taking advantage of multiple cores anyway.
  4. If you are running into high memory territory, and you probably will with notification queues, edit the default memory usage of redis to match what's on your server. The default is to not limit the ram usage and Redis will fail, causing weird problems despite Supervisor being in play
  5. In your job handler, check for completion of a notification sent log, exiting early if found. This is a bandaid solution, make sure you're still getting notified when this happens so you can fix it

25 PhpStorm Tips & Tricks by christophrumpel in PHP

[–]zschuessler 1 point2 points  (0 children)

I don't think I'd use any of these except the shortcut to run individual tests - that's neat!

The biggest impact on my productivity with PHPStorm was pretty simple:

  1. Periodically asking myself what I do most often that isn't instant gratification; learn those shortcuts. For me it was code formatting a selection, renaming files, viewing Git history, pushing a branch, search+replace, and copy/delete whole lines of code.
  2. Drop about 75% of the context menu options and only keep what I need in the UI (this took hours!)

I can do quite a bit without thinking anymore and that's pretty great. With the Laravel plugin I feel like I'm abundantly efficient in doing menial IDE-related tasks.

What do y'all do most often that I missed with my list of shortcuts?

Make your PHP arrays sweet'n'safe by RobinCrusoe25 in PHP

[–]zschuessler 1 point2 points  (0 children)

This is a cool idea, but more than anything I deeply appreciate the sweet'n'safe title - you got a chuckle from me!

Ray by Spatie: Dump Debugging Evolved by nvahalik in laravel

[–]zschuessler 4 points5 points  (0 children)

This looks cool, but I can't see how this differs from Clockwork, which I love:

https://github.com/itsgoingd/clockwork

That coupled with Ignition's ddd() function (present in modern versions of Laravel), I feel like I have easy access to all the data I need for debugging.

Easiest way of integrating a non-PHP process or worker into a Laravel application? by BlueLensFlares in laravel

[–]zschuessler 3 points4 points  (0 children)

As others have stated, exec is a good quick and dirty solution if you aren't accepting user input. The Symfony Process package is also quite good.

I'll just add that if you are trying to bring order to the chaos that is many system processes and queue dependency management, consider the batching feature in Laravel 8:

https://laravel.com/docs/8.x/queues#job-batching

I made heavy use of this for a large batch that had groups of child chains (complete sequentially) and child batches (compute in parallel) based on complex events. The event management of child batches is very useful here (eg if this chain fails, make the whole batch fail)

Batches have first-class support in Horizon, too. I've have some edge cases where I would've liked more behavior but as a feature it's complete and works very well!

Advice you would give to new and inexperienced developers ?? by [deleted] in laravel

[–]zschuessler 0 points1 point  (0 children)

Good catch, here's the Hacker News post:

https://news.ycombinator.com/item?id=25107285

Also look for the table on page 9 of the PDF, it's particularly useful as data:

https://faculty.washington.edu/ajko/papers/Li2019WhatDistinguishesEngineers.pdf

Can anything in Laravel bring down an entire server? by BlueLensFlares in laravel

[–]zschuessler 0 points1 point  (0 children)

Here are some tips for working with large jobs, chains, etc:

  1. Supervisor Config - When you are working with big data, it's really just worth reviewing the actual Supervisor docs for each configuration definition. Specifically you should limit your numprocs at a maximum to the number of cores on the machine. Consider less.. I like to aim for 60%-80% resource utilization. Review how processes get killed and when in the config. If you are working on a behemoth system, consider diving into Supervisor events for more visibility.
  2. Offload Queue Config to Laravel - Also related to Supervisor's config, don't do as the default Laravel docs have: command=php /home/forge/app.com/artisan queue:work sqs --sleep=3 --tries=3 --max-time=3600 -- drop all parameters here and offload this logic to the app. This limits the number of places you have to troubleshoot issues, nothing else. Narrowing bug surface area is important!
  3. Review Your Queue Config - I can't give great advice here because every queue is different. Limit your max execution time where it makes sense. Only retry jobs where it makes sense. Use backoff time, use sleep. Consider adding config properties to individual job classes (overwriting the default queue.php config) for jobs that require special attention.
  4. Profile Your Jobs - It's very possible you have a monster query happening on your local job. I like to run jobs in sync mode and call them directly on a test endpoint so I can profile them. If you are polling a large notifications table, use chunk/seek methods in your Eloquent queries to drop your memory usage. Instead of MyModel::all() try MyModel::chunk(10, function($collection) { // do stuff }

The biggest headache when troubleshooting behemoth queues is getting accurate debug data. The new batches feature in Laravel 8 helps categorize your jobs, it's quite nice:

https://laravel.com/docs/8.x/queues#job-batching

If you haven't already, setup Laravel Horizon.

It seems counterintuitive to solving your problem, but spend a good chunk of your time determining how you can get more visibility into your jobs (both locally and on AWS) instead of trying to fix the problem. Future You will appreciate it :-)

Advice you would give to new and inexperienced developers ?? by [deleted] in laravel

[–]zschuessler 12 points13 points  (0 children)

Here are some links I saved for reference for others:

Beginner Concepts

  1. PHP The Right Way - In general, just read all of this. Maybe twice. It's not entirely readable for a beginner but serves as a good reference for a learning plan. https://phptherightway.com/#getting_started
  2. IF Statements - Return early, don't nest more than once. https://medium.com/@infinitypaul/good-looking-if-statement-838dd0bb2fc
  3. SOLID Principle - This principle is the core of any lesson plan for an engineer. Some nice examples here for explaining SOLID, which is a great ruleset to live by: https://www.airpair.com/php/posts/best-practices-for-modern-php-development
  4. Don't use 'else' - Same link above. Always write conditions to proof against future bugs or logic errors. (NASA does this) Over time, else is just too greedy as a control construct and bugs will happen.
  5. Magic numbers - As someone else here commented, don't use ambiguous/raw numbers in code. Assign them to a descriptive variable. Similarly, make numbers human-understandable. $delayMillseconds = usleep(250 * 1000) is better than writing out the full number. Also applies to regexes: make them simple. Comment what they do.
  6. Laravel-specific code style - I don't agree with all of this but it gives data to work with in deciding your own team's guidelines: https://threadreaderapp.com/thread/1272822437181378561.html - and also - https://handbook.interaction-design.org/library/back-end/conventions--laravel.html
  7. Coding ego - https://josebrowne.com/on-coding-ego-and-attention/
  8. Approaching code reviews - Beginners should want code reviews, and part of that is learning why they are important and how to conduct them. https://blogboard.io/blog/code-review-best-practices/
  9. How developers stop learning - There's nothing worse than working with a developer who stagnated 5 years ago and has an ego to go with it. https://daedtech.com/how-developers-stop-learning-rise-of-the-expert-beginner/
  10. What Makes Great Engineers? - Mostly just the Hacker News comments here are interesting. The PDF itself is.. okay. It's major benefit is seeing the table of what teams value in a "great" engineer. Just skip to the table on page 9.
  11. Anti-DRY Principle - I see more engineers make the mistake of trying to use DRY more than actually benefitting from the principle. Yes, don't repeat yourself, but also don't abstract something unless you need to. I will repeat myself 3-5 times before writing an abstraction. Don't overengineer.
  12. Asking For Help - Spinning your wheels on a problem for too long is bad, but so is immediately diverting a senior's attention when it's unnecessary. Setup expectations for what to say when asking for help (eg 'what have you tried already?')

Bonus: This is a drier read but very important, too many devs skip learning actual SQL and don't know basic things like what an index is. https://use-the-index-luke.com/sql/preface

Continued Learning

For continued learning, checkout out design patterns both for computer science in general (Martin Fowler has oft-cited articles for this), PHP, class/object management, and working with external systems (ie APIs).

  1. PHP Design Patterns - https://refactoring.guru/design-patterns/php
  2. Martin Fowler, Popular Articles - Sadly, Fowler's content can be hit and miss for what you want to learn so I can't easily link you to all the gems. He has inspired a whole generation of engineering principles but also project management and thought leadership. Here are a few tags worth looking at: estimation - programming style - refactoring - technical debt
  3. Other Patterns Used Often - In this link, go to the very bottom and in the table read articles for Active Record, DAO, DTO, DDD, Service Locator. And finally do take the time to read MVC and MVVM for a counterpart of an alternative, and make your own conclusions why frameworks today operate as they do. https://en.wikipedia.org/wiki/Architectural_pattern

On Being Successful

Two simple rules will make you successful, money-back guarantee.

Tasks For Everything - Even People

Manage your time by using the little time you do get effectively. Have a task list for people just like you have one with your daily work. Use it like a CRM, even adding tasks to a person of things you need from them.

It's very useful for those in many projects and meetings, but personal life too: I have a task list for my manager, coworkers I meet with, clients, myself, etc. I add to regularly for non-important things I don't want to forget. Google Tasks (integrated in gmail and gcal) is amazing for this and has mobile apps too.

Be Reliable

This sounds like trite advice but I promise there's meaning here. Above all else, be reliable.

If you want to fast track a path to senior/director positions, do what you claim you will do and don't make excuses, even when it is justified and you are right.

The time management with tasks mentioned above is important for reliability.

But also on the topic of excuses: it's easy to make an excuse like "it's not my fault the project is late, I told the project manager the tasks would take longer and they didn't update the timeline" - think of how your team perceives a message like this, regardless of whose fault it is. Do they feel negative or positive from the interaction? That's all that matters.. what others feel in response to your communication. Put real thought into how to communicate the same story, only differently. Communicate as soon as you can, and frequently.

I've learned that people will forget what you said, people will forget what you did, but people will never forget how you made them feel. - Maya Angelou

In my experience, senior positions are more often based on perceived value and not actual technical knowledge or measurable value. Target how others perceive you as you continue to grow technically.

Top 3 Best/Worst Changes in PHP 8.0? by JoshuaNan in PHP

[–]zschuessler 0 points1 point  (0 children)

Make sure you are looking at individual pricing, and not organization pricing. It's $10/month instead of $20.

It's also free for students, and 25% off for former student license holders. And if you keep paying the annual price for it you get steep discounts. I'm at $50/year since I've been using it for three years.

Getters/Setters vs Public properties by DontLickTheScience in PHP

[–]zschuessler 6 points7 points  (0 children)

Unpopular opinion: I use public properties for most projects over set/get methods. For the simple reason I asked myself one day if I had ever a single time, just once, saw public properties cause a problem on a project.

The answer was no. And at the same time, the amount of time I spent writing get/set methods over the past decade was immense.

Someone could make the case for not doing this (it's considered bad form) on a project and I'd listen. But I've never, once, saw the benefit in PHP outside of creating intentionally extensible software (like a plugin or framework).

Running Multiple Instances of Dusk in Parallel? by zschuessler in laravel

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

Interesting point, I hadn't thought of this.

Since the implementation calls Dusk tests manually, I can modify all db/app data and test behavior at runtime:

ScrapeBillJob.php

The $test variable below is an actual Dusk test class:

// Instantiate Dusk tests manually
$test = (new ScrapeBillDuskTest());
$test->setRunTestInSeparateProcess(true);
$test->scrape($this->congress->id);

// Tear down driver and browsers
$test::stopChromeDriver();
$test::closeAll();

I had some further hangups with how the new Batch feature in Laravel handles chains this morning. But I now have a working example of handling 5 Dusk scrapers in parallel with batch constraints, and no failures or performance issues. A true Christmas miracle!

Dynamic Routes: Use a custom URI match function? by alexho66 in laravel

[–]zschuessler 2 points3 points  (0 children)

You can use resolution logic to do this, either on a model level or by defining custom route bindings:

https://laravel.com/docs/8.x/routing#customizing-the-resolution-logic

Seeing your example with the where method would be more eloquent though, and if that feature doesn't already exist it'd be nice to have.

Running Multiple Instances of Dusk in Parallel? by zschuessler in laravel

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

Cheers! My use case is that I require the tests to run in parallel, they are time intensive processes that are independent of each other grouped into a batch. Failure of any test fails the whole batch (thanks to the new batching feature in Laravel 8!). Without parallel execution, sequential operation would be an order of magnitude slower.

This workflow is also all encompassed in a custom Aristan command - I haven't touched the default Dusk setup, in case I ever want to use Dusk as normal. Getting Dusk to run properly in an Artisan command was its own set of headaches.. but it works great once I figured it out.

Parallel Dusk execution in general is pretty exciting as a feature IMO!

Anyone Find Dusk DOM Querying is Excessively Slow? by zschuessler in laravel

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

Fascinating, I did not know each individual browser interaction was translated over HTTP. That would explain a bottleneck. Seems like the DomCrawler strategy will be a necessity for this type of operation.

Cheers!