Patrick Hesselberg

1K posts

Patrick Hesselberg

Patrick Hesselberg

@computephh

Lead Developer at Loyalty Key working with Laravel to give you cashback. Father 2.0. Somewhat of a decent swimmer.

Danmark 参加日 Şubat 2012
117 フォロー中94 フォロワー
Ondřej Mirtes
Ondřej Mirtes@OndrejMirtes·
@PaweSasko The Bloody Baron and Ladies of the Wood are the best quests I’ve ever experienced in any game ever. I get goosebumps even thinking about them. I love to replay them every couple of years. Thank you for them!
English
1
0
2
401
Paweł Sasko
Paweł Sasko@PaweSasko·
The Bloody Baron was one of the first quests I designed for The Witcher 3. For me, it’s meant to set the tone and style for the game we are building, and became my thematic reference. Thankful to amazing writers, Marcin Blacha and Karolina Stachyra who worked with me.
wolfy🦋@wolfyvelvet

dunno why people say that the starting of witcher 3 is boring cause the whole bloody baron sub plot is so brilliantly written. One of my favourite parts of the game

English
332
679
15.3K
454.1K
Patrick Hesselberg
Patrick Hesselberg@computephh·
@laracasts First. The second only explains a function is tested, not what is tested. It() in many ways forces you to describe it a bit more which is a nice side effect!
English
0
0
0
44
Laracasts
Laracasts@laracasts·
Let's say you're writing model tests. Each test confirms that a method on your Eloquent model works as expected. Which naming convention do you prefer?
Laracasts tweet media
English
22
2
40
8.3K
Davor Minchorov
Davor Minchorov@davorminchorov·
@MrPunyapal No. Command Handlers + Commands + Aggregates + Query Handlers + Queries.
English
1
0
4
224
Punyapal Shah
Punyapal Shah@MrPunyapal·
Laravel devs, action classes or not? 🤔
English
9
1
15
1.8K
Patrick Hesselberg
Patrick Hesselberg@computephh·
@jeffrey_way 0 to 4 depending on the project should be fairly easy. However using a baseline for the higher levels is key to not the overwhelmed with fixing errors. If you can then start using level 6 for future code you're at a very good place!
English
0
0
1
116
Jeffrey Way
Jeffrey Way@jeffrey_way·
If you're trying phpstan for the first time, the top recommendation I have is to begin at level: 0. Don't succumb to peer pressure. If you go for max, you're quickly going to become overwhelmed. Start at 0, then increment slowly.
English
16
7
125
10.6K
Patrick Hesselberg
Patrick Hesselberg@computephh·
@gonedark By any chance you're talking about CF image transformation (image auto scaling)?
English
1
0
1
77
Jason McCreary
Jason McCreary@gonedark·
Deliriously excited to launch my new video course - Fast Laravel. 30 videos chronicling my quest to optimize Laravel app response times using free services from Cloudflare: fastlaravel.com
Jason McCreary tweet media
English
15
47
217
28.6K
Cynical
Cynical@thegamersjoint·
I'll be streaming the game awards tomorrow :)
English
24
16
267
10.8K
Patrick Hesselberg
Patrick Hesselberg@computephh·
@davorminchorov I love going with the WET principle (write everything twice). That way it's easier to see potential abstraction/refactors, rather than imagine a case where this could be reused.
English
1
0
1
24
Davor Minchorov
Davor Minchorov@davorminchorov·
🔥 Quick tip of the day: Don't use the same code for multiple use cases Whenever you are building an MVP or a proof of concept project, you might be tempted to try and reuse the same code for multiple use cases. A great example would be creating a contact in a sales leads CRM from different places like: - An external API integration - A contact importer in the customer portal - A customer portal form - A public sign up form - An admin panel managed by the internal team So you learned that actions in Laravel are very popular so you try to put the main code of creating the contact in there and just reuse that class in all of the places above where creating a new contact is needed. Now, this may seem like a great idea, but this will complicate things very quickly. Why? Every use case is different, even if it means writing the same code multiple times. Every use case might have different validation rules, business rules and different data that may need to be used in each case. You might be thinking: "But I can just add an few if statements and be done with it. Or wait, I can make the class to be dynamic based on a type!". Yeah, it's not that simple or easy to do so. The complexity rises as you start writing more and more code. This might not be obvious when you start writing the code, because you are focused on rushing to ship the code but as people start using the software, you quickly realize that what you've build is incomplete. Bugs will start showing up from everywhere. The solution? It's simple really, just create separate controllers, action classes and everything needed, don't be scared to duplicate the code. This will save you a lot of headaches and big refactors which you wouldn't want to do. Yeah, you will have 100 extra files, but at least you will know that one change in one use case, won't be affecting the rest of the use cases. The less code you have to change, the better. Sometimes, the code may look like you are overengineering things for no reason, but that code might be the simplest code you've ever written in a long-term complex project context. The Do Not Repeat Yourself (DRY) principle is one of the most misunderstood principles in software engineering. Bonus tip: Split complex code into multiple classes, don't use a single class to do everything in a complex scenario. More about this soon.
English
1
0
2
485
Jeffrey Way
Jeffrey Way@jeffrey_way·
@christophrumpel Imagine my surprise the first time I ordered a pizza in Rome, and it was brought to the table entirely unsliced.
English
9
0
24
4.1K
Christoph Rumpel 🤠
Christoph Rumpel 🤠@christophrumpel·
So I heard my friends from the US are confused by the fact we Europeans order one pizza per person instead of sharing?🍕🤔
English
13
0
27
8.7K
Patrick Hesselberg
Patrick Hesselberg@computephh·
@SabatinoMasala And how about creating? Like if you rely on some data from a 3rd party API (which is slower and is more likely to hit a race condition). I've solved it by using the Atomic lock directly, but I wish I could use some eloquent-ish behavior like this example 😇
English
0
0
0
137
Sabatino Masala
Sabatino Masala@SabatinoMasala·
💡Here's a Laravel tip for you Race conditions don’t throw exceptions, they silently corrupt your data. If you update multiple models (especially in payment flows !!!), wrap it in a transaction, lock the rows, and fire side-effects after commit. Your future self will thank you.
Sabatino Masala tweet media
English
7
13
154
6.5K
Patrick Hesselberg
Patrick Hesselberg@computephh·
@VotrubaT @rectorphp To me it's all about context. As with most things. TDD might not make sense in some context, but for smaller iterations where you want to test every case one by one it's super effective!
English
0
0
0
79
Tomas Votruba
Tomas Votruba@VotrubaT·
I've never seen TDD used in productive way. Instead, academics discuss theory of relativity in tests for couple days instead of making the feature. But... I find myself doing TDD every day 😊 When I make new @rectorphp rule, I always create a test fixture file first. I write the code before, and after change. During this writing, my brain runs a background deamon job that already puts together the rule code. Then I switch to /src and write it out in stream of conscious. I've tried the other direction (code first, then test), and test-first one is 2-3 times faster!
Jeffrey Way@jeffrey_way

Ten or fifteen years ago, test-driven development was considered a near requirement for serious developers. I don't see it discussed nearly as much these days. Everyone recognizes the value of tests, but the "test first" evangelism is almost completely gone.

English
4
0
13
2.2K
Ashley Hindle
Ashley Hindle@ashleyhindle·
The data for laravel/framework says if your PR description is empty, your PR will 100% be merged 😅 You can't argue with numbers!
Ashley Hindle tweet media
English
5
0
20
3.1K
Patrick Hesselberg
Patrick Hesselberg@computephh·
@LiamHammett Actually, I remember something exactly like this not long ago. Can't remember the feature.. What did you miss out on? 😅
English
1
0
0
72
Liam Hammett
Liam Hammett@LiamHammett·
Having an issue with queues: 😭 Realise Horizon has commands to help with the exact issue you have: 🥳 Realise this one app is still on Laravel 10 an doesn't have those commands: 😭 Keep your apps up-to-date folks
English
2
0
22
1.7K
JustSteveKing
JustSteveKing@JustSteveKing·
I’m still working on the ebook. It’s taking longer as I need to prioritise client content and I don’t have a sponsor yet. If you’d like to support the project, reach out - appreciate your patience.
English
1
1
6
782
Jack Ellis
Jack Ellis@JackEllis·
2023: I signed my cofounder up to the Justin Bieber newsletter 2024: My cofounder exits and forwards his email to me 2025: I now get Justin Bieber newsletter emails
English
8
1
98
6.3K
Mathias Hansen
Mathias Hansen@MathiasHansen·
For @laravellivedk I had this crazy idea to build and host a full-blown Jeopardy game with physical buzzers and all. Of course 100% built with Laravel.
English
2
2
16
1.9K
Sam Carré 🤠
Sam Carré 🤠@carre_sam·
It's not often something you have built gets showcased by one of the greatest developer teams in the Laravel world. OhDear, created by @spatie_be, have just published a blog post on their new PHP SDK, built on top of Saloon! ohdear.app/news-and-updat…
English
5
2
44
2.4K
Patrick Hesselberg
Patrick Hesselberg@computephh·
@calebdw @enunomaduro I love this! Wait with the refactor until you've done the same thing 3 times. Then you can start seeing the patterns.
English
0
0
1
22
nunomaduro
nunomaduro@enunomaduro·
a little copying is better than a little dependency
English
10
7
162
10.3K
Jack Ellis
Jack Ellis@JackEllis·
TypeScript course coming soon.
Jack Ellis tweet media
English
6
0
51
6K