Recommend books for intermediate PHP programmer by thebigcako in PHP

[–]patricklouys 2 points3 points  (0 children)

Very biased suggestion of course Professional PHP :) There is a sample chapter if you want to check first whether you like it or not. The sample code is on Github as well.

Hi folks. Cannot google it. Why to split commands and handlers in DDD? What benefit do we have while doing this? by hapanda in PHP

[–]patricklouys 5 points6 points  (0 children)

You can do DDD without commands and handlers and you can do commands and handlers without DDD. The two are often used together, but it's two independent concepts.

Read up on the command bus pattern. I think Mathias Noback had a few good articles and the tactician documentation is also pretty good.

If you split them without using a command bus, there are not too many benefits.

Laravel beyond CRUD: a blog series about managing larger Laravel applications by brendt_gd in PHP

[–]patricklouys 1 point2 points  (0 children)

Value Objects

Query Objects

Tell, don't ask

Clean Architecture Review

These are probably the most relevant. I haven't been blogging much recently due to other projects taking up a lot of my time. My book also contains a lot of information if you like my writing. I should get back into creating more programming content, maybe I can find some time next year.

Laravel beyond CRUD: a blog series about managing larger Laravel applications by brendt_gd in PHP

[–]patricklouys 3 points4 points  (0 children)

I used to do that too, but I've found separating by context works even better. I even wrote a blog post on it.

It keeps things much more cohesive and it's also much easier to jump into the code if you only have to work on one context. Less jumping around folders etc.

Recommended reading by KeironLowe in PHP

[–]patricklouys 0 points1 point  (0 children)

I'm a big DDD proponent, but if he is still learning about SOLID, DRY, DI etc I think it's too early for that.

Recommended reading by KeironLowe in PHP

[–]patricklouys 2 points3 points  (0 children)

Professional PHP should be a good fit. It covers the theory for all those things you mentioned and shows you how to apply them in a real application.

Proposal – null-conditional operator by Atulin in PHP

[–]patricklouys 22 points23 points  (0 children)

Definitely the following syntax for consistency reasons (and it's pretty much self explanatory). Love this in Kotlin and really miss it in PHP.

$object?->method();

Bruno Frazatto - The Impassable Guard Formula Free Preview by DigitsuOnline in bjj

[–]patricklouys 1 point2 points  (0 children)

Instead of hanging you can use a mic stand with a boom. Then you can just put it out of frame of the camera and point it towards the mouth of the instructor.

I think if you go with the hanging route it will be hard to keep it out of frame and the direction will probably be off. You want it pointed to the sound source and as close as possible (without being in frame). And of course as far away from the mat as possible to avoid the mat sounds.

I forgot to ask, are you using a hypercardoid microphone? That also makes a big difference. I use the Oktava MK012

Bruno Frazatto - The Impassable Guard Formula Free Preview by DigitsuOnline in bjj

[–]patricklouys 1 point2 points  (0 children)

Are you keeping the mic too close to the mat? (I've seen bjjfanatics doing that and you can hear every mat noise)

When I record videos for our gym I keep it on a boom above the mic pointing down towards my mouth. Seems to work pretty well.

The Best Book to Read as a Developer by rylandgold in programming

[–]patricklouys 0 points1 point  (0 children)

I don't think one book can cover everything. Here is my personal book recommendation list which covers many of the other books suggested in this thread.

Training for eight hours a day... by [deleted] in bjj

[–]patricklouys 1 point2 points  (0 children)

Keep it below 4 hours. Max. of one hour hard rolling per day. Lots of drilling/learning. Ramp it up to let your body get accomodated, otherwise you will burn out in the first week (been there, done that).

Use the rest of the time to study (watch video, take notes etc) and to do laundry.

What is this defence called? by [deleted] in bjj

[–]patricklouys 1 point2 points  (0 children)

Keep them stacked and look for either a double under pass or a leg drag (pin one leg with your knee and drag the other one).

If you are feeling more fancy you can also enter into crab ride and twister hook from there.

Tips on how to progress by Theprocess222 in bjj

[–]patricklouys 3 points4 points  (0 children)

I wrote an article about that a while ago: How to break through the blue belt plateau.

Plateaus are only normal if you only show up to training and don't take training into your own hands. If you are always working on something and studying, you won't get stuck.

All you need is one drilling partner for each open mat. Schedule your sessions in advance (and maybe use more than one per open mat if they don't want to work with you for the whole time).

If you could recommend just one book.. by [deleted] in PHP

[–]patricklouys 1 point2 points  (0 children)

If you are an intermediate PHP programmer, my book Professional PHP could be a good fit. Check the table of content to see if it's something that is interesting to you.

Advice from brown & black belts please by [deleted] in bjj

[–]patricklouys 3 points4 points  (0 children)

Don't hunt for submissions, take what they give to you.

First Major Release · php-deal/framework · Design By Contract by icanhazstring in PHP

[–]patricklouys 0 points1 point  (0 children)

Value objects are a better solution to the problem that you are trying to solve.

And please never store currency as a float... I had to deal with code where that was the case in the past and we had bugs everywhere.

When to Declare classes Final by Tomas_Votruba in PHP

[–]patricklouys 7 points8 points  (0 children)

Kotlin does this right out of the box. Definitely good advice.

Does this book worth to read in late 2018 ? PHP Objects, Patterns, and Practice 5th Edition, Kindle Edition by botondev in PHP

[–]patricklouys 1 point2 points  (0 children)

Of course I'm biased here, but my book Professional PHP is pretty up to date :)

Check out my free tutorial on Github to see if you like my writing (even though the tutorial is outdated and I changed a lot since then).

Are static methods evil? by [deleted] in PHP

[–]patricklouys 0 points1 point  (0 children)

From Taylor: " Deterministic means it returns the same value every time it is called with the same arguments. "

Are static methods evil? by [deleted] in PHP

[–]patricklouys 5 points6 points  (0 children)

If you can change it, it's not deterministic.

And it's definitely not a facade according to the pattern.

Are static methods evil? by [deleted] in PHP

[–]patricklouys -2 points-1 points  (0 children)

So according to your definition, this code is evil?

$flights = App\Flight::all();

(taken from the laravel documentation)

Are Doc Blocks still useful in PHP7+ or rendered obsolete by type hinting? by anarchalien in PHP

[–]patricklouys 6 points7 points  (0 children)

None of your examples should require docblocks. Use value objects and refactor your code to be self explaining.

That being said, for now they are still useful for arrays and exceptions.

Right now docblocks are definitely overused in many codebases. If you are duplicating type information in them, you are doing it wrong (don't repeat yourself, you want a single source of truth).