#realdevtips search results
One tiny little tip from my today's JavaScript coding session. Array.push() ftw! #RealDevTips #JavaSscript
PHP's first-class callables. Can even be used to 'invade' private properties, thanks to its creation-site scoping 🪄 #RealDevTips #PHP
When asserting that a function that returns a promise throws an exception, ensure to unwrap the rejection before chaining on the assertion. #RealDevTips
The code below is the core of #DevDb. It is an excerpt from the Service that handles comm between the UI and the VS Code extension code. I generally prefer this pattern of using objects, to say using conditionals. #RealDevTips P.S. #DevDb updates from last weekend:…
Mockery's API for fluent interfaces is simply...fluent 🤌 You can simply skip methods in the chain of calls and only focus on what matters. #RealDevTips #Laravel #PHP
Got a complicated logic for conditional check? Refactor the logic into separate a function. Yes, you end up with +1 function, but it is much more readable and maintainable, and your brain will thank you. See (contrived) example in screenshot below: #RealDevTips
PHP Faker's boolean() method lets you generate values probabilistically. This gives the same vibes as Laravel's Lottery class 🤙 #RealDevTips #Laravel #PHP
If you use VS Code and write tests for your JavaScript/TypeScript code, Wallaby is a good tool to check out. See in screenshot below how it marks error-free code lines green (1) and provides Code Lens for quick actions (2). wallabyjs.com #RealDevTips
When disabling an input field in Filament, you want to be sure that users cannot maliciously alter the state of such field in the frontend and submit a value for such disabled field. Be sure to prevent dehydration of same on the backend. #RealDevTips #Laravel #FilamentPHP
One of the benefits of Facades is the ease of mocking in your tests: you get to skip the low-level mockery setups and simply call mock methods like shouldExcpect() on your Facade class. See the \Illuminate\Support\Facades\Facade.php class #RealDevTips #Laravel #PHP #PestPHP
Problem: A long ternary is hard to read. Solution: Extract two functions. (This is especially useful when there's a lot of JSX around a ternary)
I wrote a little article on PHP's first-class callable. Please let me know if you prefer the writing style to the previous ones: dev.to/damms005/phps-… Previous articles: dev.to/damms005 Thanks! #RealDevTips #PHP
During #oscafest23, I was giving a pre-session talk and someone asked me a question on Composer. I could relate. Experience makes such a thing trivial. I've started making articles on this. Be sure to follow. dev.to/damms005/under… #RealDevTips #PHP
This is all nice and dandy. But I'll not write this kind of code. If I'm reviewing a PR and find this snippet, I'll recommend it be refactored for clarity. #RealDevTips #PHP
I've been programming in PHP for 18 years and I've been developing a major developer tool for PHP for the last 7 years. And still from time to time I stumble upon a language feature I've never seen before. Why does this work without "return" in front of the "declare" keyword!?
One of the reasons I love Laravel is how it inspires API designs, as in screenshot below. Adonis JS is a prime example of the farthest of this spectrum, IMO. @PovilasKorop 's Laravel daily is loaded with practical examples of such Laravel juices. #RealDevTips
I brewed something sweet with TypeScript (partly inspired by @laravelphp's Pipe ): (shout-out to @TitianCernicova)
Consider: - Using a standard of some sort (e.g. PSR-12 for PHP) - Early returns - Descriptive method names - Short method bodies - Refactor complex logic to method calls - Writing code for humans, not machine Bonus: declutter your IDE, set large line heights 💅 #RealDevTips
I want to write code like Chimamanda writes articles 😁
I am currently refactoring a legacy PHP codebase. I'll share my process here with same #RealDevTips hashtag. Be sure to follow if this is the kind of stuff you find value in. Retweet if your audience may find this valuable, too. cc: @PovilasKorop @hackSultan #RealDevTips
In my early career days, I lacked direction. There was no one to tell me exactly what to do, especially how what I learnt applied to real-life scenarios. Now, as I relate with and manage junior/mid-level SEs, I see that pattern again and I don't see much on my timeline... 1/n
Got a complicated logic for conditional check? Refactor the logic into separate a function. Yes, you end up with +1 function, but it is much more readable and maintainable, and your brain will thank you. See (contrived) example in screenshot below: #RealDevTips
The code below is the core of #DevDb. It is an excerpt from the Service that handles comm between the UI and the VS Code extension code. I generally prefer this pattern of using objects, to say using conditionals. #RealDevTips P.S. #DevDb updates from last weekend:…
During #oscafest23, I was giving a pre-session talk and someone asked me a question on Composer. I could relate. Experience makes such a thing trivial. I've started making articles on this. Be sure to follow. dev.to/damms005/under… #RealDevTips #PHP
I wrote a little article on PHP's first-class callable. Please let me know if you prefer the writing style to the previous ones: dev.to/damms005/phps-… Previous articles: dev.to/damms005 Thanks! #RealDevTips #PHP
PHP's first-class callables. Can even be used to 'invade' private properties, thanks to its creation-site scoping 🪄 #RealDevTips #PHP
When asserting that a function that returns a promise throws an exception, ensure to unwrap the rejection before chaining on the assertion. #RealDevTips
This is all nice and dandy. But I'll not write this kind of code. If I'm reviewing a PR and find this snippet, I'll recommend it be refactored for clarity. #RealDevTips #PHP
I've been programming in PHP for 18 years and I've been developing a major developer tool for PHP for the last 7 years. And still from time to time I stumble upon a language feature I've never seen before. Why does this work without "return" in front of the "declare" keyword!?
PHP Faker's boolean() method lets you generate values probabilistically. This gives the same vibes as Laravel's Lottery class 🤙 #RealDevTips #Laravel #PHP
Mockery's API for fluent interfaces is simply...fluent 🤌 You can simply skip methods in the chain of calls and only focus on what matters. #RealDevTips #Laravel #PHP
One tiny little tip from my today's JavaScript coding session. Array.push() ftw! #RealDevTips #JavaSscript
When disabling an input field in Filament, you want to be sure that users cannot maliciously alter the state of such field in the frontend and submit a value for such disabled field. Be sure to prevent dehydration of same on the backend. #RealDevTips #Laravel #FilamentPHP
One of the benefits of Facades is the ease of mocking in your tests: you get to skip the low-level mockery setups and simply call mock methods like shouldExcpect() on your Facade class. See the \Illuminate\Support\Facades\Facade.php class #RealDevTips #Laravel #PHP #PestPHP
Consider: - Using a standard of some sort (e.g. PSR-12 for PHP) - Early returns - Descriptive method names - Short method bodies - Refactor complex logic to method calls - Writing code for humans, not machine Bonus: declutter your IDE, set large line heights 💅 #RealDevTips
I want to write code like Chimamanda writes articles 😁
I am currently refactoring a legacy PHP codebase. I'll share my process here with same #RealDevTips hashtag. Be sure to follow if this is the kind of stuff you find value in. Retweet if your audience may find this valuable, too. cc: @PovilasKorop @hackSultan #RealDevTips
In my early career days, I lacked direction. There was no one to tell me exactly what to do, especially how what I learnt applied to real-life scenarios. Now, as I relate with and manage junior/mid-level SEs, I see that pattern again and I don't see much on my timeline... 1/n
Problem: A long ternary is hard to read. Solution: Extract two functions. (This is especially useful when there's a lot of JSX around a ternary)
One of the reasons I love Laravel is how it inspires API designs, as in screenshot below. Adonis JS is a prime example of the farthest of this spectrum, IMO. @PovilasKorop 's Laravel daily is loaded with practical examples of such Laravel juices. #RealDevTips
I brewed something sweet with TypeScript (partly inspired by @laravelphp's Pipe ): (shout-out to @TitianCernicova)
If you use VS Code and write tests for your JavaScript/TypeScript code, Wallaby is a good tool to check out. See in screenshot below how it marks error-free code lines green (1) and provides Code Lens for quick actions (2). wallabyjs.com #RealDevTips
One tiny little tip from my today's JavaScript coding session. Array.push() ftw! #RealDevTips #JavaSscript
PHP's first-class callables. Can even be used to 'invade' private properties, thanks to its creation-site scoping 🪄 #RealDevTips #PHP
The code below is the core of #DevDb. It is an excerpt from the Service that handles comm between the UI and the VS Code extension code. I generally prefer this pattern of using objects, to say using conditionals. #RealDevTips P.S. #DevDb updates from last weekend:…
When asserting that a function that returns a promise throws an exception, ensure to unwrap the rejection before chaining on the assertion. #RealDevTips
Mockery's API for fluent interfaces is simply...fluent 🤌 You can simply skip methods in the chain of calls and only focus on what matters. #RealDevTips #Laravel #PHP
PHP Faker's boolean() method lets you generate values probabilistically. This gives the same vibes as Laravel's Lottery class 🤙 #RealDevTips #Laravel #PHP
If you use VS Code and write tests for your JavaScript/TypeScript code, Wallaby is a good tool to check out. See in screenshot below how it marks error-free code lines green (1) and provides Code Lens for quick actions (2). wallabyjs.com #RealDevTips
When disabling an input field in Filament, you want to be sure that users cannot maliciously alter the state of such field in the frontend and submit a value for such disabled field. Be sure to prevent dehydration of same on the backend. #RealDevTips #Laravel #FilamentPHP
Got a complicated logic for conditional check? Refactor the logic into separate a function. Yes, you end up with +1 function, but it is much more readable and maintainable, and your brain will thank you. See (contrived) example in screenshot below: #RealDevTips
Something went wrong.
Something went wrong.
United States Trends
- 1. Penn State 22K posts
- 2. Mendoza 18.9K posts
- 3. Gus Johnson 6,093 posts
- 4. #iufb 3,920 posts
- 5. $SSHIB 1,285 posts
- 6. Omar Cooper 8,821 posts
- 7. Sayin 66.8K posts
- 8. Sunderland 151K posts
- 9. Estevao 26.3K posts
- 10. #UFCVegas111 3,682 posts
- 11. Iowa 19.3K posts
- 12. Jim Knowles N/A
- 13. Texas Tech 13.5K posts
- 14. James Franklin 7,931 posts
- 15. Happy Valley 1,820 posts
- 16. Oregon 33.5K posts
- 17. Arsenal 254K posts
- 18. Neto 24.7K posts
- 19. WHAT A CATCH 11.1K posts
- 20. CATCH OF THE YEAR 4,607 posts