Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Stovepipe Systems:
Rethinking Form Development
Dec 19, 2016 @ 11:50:08

On the Stovepipe Systems blog Iltar van der Berg shares some thoughts about rethinking form development and how moving from composition over inheritance model can help make working with Symfony forms easier.

In one of my previous blog posts, Avoiding Entities in Forms, I've shown how to decouple your forms from your entities. Afterwards I got feedback and most of it was about the lack of examples and the flow, when to fill your data and how to get this back in the entity. However, often I notice that developers design forms based on their entities. This can lead to complex forms because you're confined to a strict set of properties. Developers often get struck with unmapped fields and form events to work their way around those limitations.

With Symfony Forms I highly recommend to follow the composition over inheritance principle. Small form types are easier to re-use and make it less complex to build forms. Moreover, this allows small data objects to have specific goals with validation for their specific case, rather than complex validation groups.

He starts with an example user story, defining a need for a form that allows users to post comments on blog posts. He starts on this simple form, defining the "bare minimum" the form requires and creating a class/entity to match. He then talks about what happens when the business need changes and they want a checkbox too. Since he created the form based on the "composition" idea (not defined by the database structure) he could pretty easily update it with this new field and add a bit of extra handling.

tagged: form development tutorial composition inheritance tutorial

Link: https://stovepipe.systems/post/rethinking-form-development

Andreas Creten:
Does code need to be perfect?
Nov 11, 2016 @ 09:55:57

On his Medium.com blog Andreas Creten has written up a post that tries to answer the question "Does code need to be perfect?" As developers we have a drive to take pride in our work and want it to be the best code possible. However, that can lead to some bad practices...

In the past months I have asked myself a lot why we always strive to write perfect code. Picking up coding again for an internal project made me realise our team (and probably a large part of the rest of the software development world) spend a lot of time on writing perfectly formatted, ordered, patterned and tested code. But is this really necessary?

[...] The engineers want to write perfect code using the latest techniques, make sure that the code is well documented so they can fully understand how everything works and that it has tests so they can easily update things later. Product owners on the other hand just want things to be done, fast and cheap, so they can ship new features or convince new clients. How can you make these conflicting views work together?

He offers a few different suggestions for those developers wanting to craft the perfect codebase including coding for "now" not the future and the fact that "perfect code" just doesn't exist. He offers some suggestions for dealing with that "non-perfect code" you come across in your codebase, when starting from scratch makes sense and thinking about how "perfect" the code needs to be at the outset.

tagged: perfect code opinion development practices

Link: https://medium.com/we-are-madewithlove/does-code-need-to-be-perfect-a53f36ad7163#.jdqre42fu

PHP Roundtable:
056: Hourly vs Value-Based Pricing
Nov 10, 2016 @ 10:56:50

The PHP Roundtable podcast, hosted by Sammy Powers, has posted its latest episode. In this new show he's joined by Keith Casey, Tim Lytle and Mike McDerment to talk about hourly versus value based pricing when charging for freelance development work.

There are two seemingly contradicting philosophies about how to charge clients for programming work. The hourly camp suggests that the client is paying for your skill and hiring you for your time. The value-based pricing camp suggests that the programmer should price a project based on its value to the client instead of the hours it will take to build it. Today we chat about these two ideas and discuss the pros and cons of both.

You can catch this latest episode either using the in-page audio or video player or by watching the live recording directly over on YouTube. If you enjoy the show and want to see more like it, be sure to subscribe to their feed and follow them on Twitter for information about the most recent and upcoming shows (and live recordings).

tagged: phproundtable podcast video ep56 hourly value pricing development work

Link: https://www.phproundtable.com/episode/hourly-vs-value-based-pricing

PHP Roundtable:
055: Acceptance Testing with Behat
Nov 08, 2016 @ 11:56:10

The PHP Rountable podcast has posted its latest episode featuring a discussion about Behat and acceptance testing in your PHP applications. This time host Sammy Powers is joined by Jessica Mauerhan and Konstantin Kudryashov.

We chat about the open-source Behavior-Driven Development framework called Behat. We get a brief overview of how Behat can help us write more reliable code and also explore some best-practices when writing automated tests.

You can catch this episode in a few different ways - either using the in-page audio or video player or you can watch the live recording (Google Hangout) directly over on YouTube. If you enjoy the show be sure to subscribe to their feed and follow them on Twitter for updates when new shows are released and when the next shows will be recorded.

tagged: phproundtable podcast video behat acceptance testing behaviordriven development

Link: https://www.phproundtable.com/episode/acceptance-testing-with-behat

Laravel News:
Can you be an expert developer in 10,000 hours?
Oct 26, 2016 @ 09:32:48

On the Laravel News site there's a new post that tries to answer the question "can you be a an expert developer in 10,000 hours?" This is based on some prior research (not specific to programming) that anyone can be an expert on anything in about 10 thousand hours worth of work and study on the subject. This post takes the ideas presented there and applies them to the world of development, trying to see if there's a good match.

Back in 1993, psychologists K. Anders Ericsson, Ralf Th. Krampe, and Clemens Tesch-Romer said that 10,000 hours of deliberate practice of a specific skill will make one an expert. Fast forward 15 years, and Malcolm Gladwell’s Outliers made the 10,000 hours rule famous. And in 2012, Macklemore solidified it’s fact status: it officially takes 10,000 hours to be an expert at anything.

How does this rule correlate to coding? If you’ve been working full time as a dev for five years, you’d be considered an expert by the parameters of the rule. [...] The problem with the 10,000 hours rule to excellence is that most domains aren’t static.

The article goes on to talk about the ever-changing world of technology (as compared to static activities where the rules aren't going to change). They talk about the Laravel framework and how it has evolved since beta/version 1 and how, if the 10k rule is applied, no one is an "expert" as it changes so fast. There's also a link to a study that debunked the 10k rule and so they shift to trying to answer another question: how much does it take to be just considered "good"? This is related back to software engineering and where in the process could it be that you move from "good" to "great".

Maybe the real question here is instead of trying to be an expert software developer, what aspects of your job can you improve in 20 hours of practice? Maybe the focus shouldn’t just be on the code; after all, your job is more than just staring at glowing screens all day. Identifying specific areas of weakness that you can devote time to strengthening every week may be the key to becoming that expert that you desire to be.
tagged: expert developer good tenthousand hours development opinion

Link: https://laravel-news.com/2016/10/10000-hours/

PHP 7.1.0 Release Candidate 4 Released
Oct 19, 2016 @ 10:10:29

The PHP.net site has posted an official announcement about the release of the latest Release Candidate in the PHP 7.1.x series: PHP 7.1.0 Release Candidate 4:

The PHP development team announces the immediate availability of PHP 7.1.0 Release Candidate 4. This release is the fourth release candidate for 7.1.0. All users of PHP are encouraged to test this version carefully, and report any bugs and incompatibilities in the bug tracking system. [...] The fifth release candidate will be released on the 27th of October. You can also read the full list of planned releases on [our wiki](https://wiki.php.net/todo/php71).

As usually for Release Candidates you can grab the latest test build from this QA site (for source) and the windows.php.net QA site for the binaries. You can find out more about what's changed in this RC in the NEWS file and start walking through the upgrade to PHP 7.1.0 when it's released using the upgrade guide.

Reminder, this is a development preview not a stable release so do not use it in production!

tagged: language releasecandidate php71rc4 development preview

Link: http://php.net/index.php#id2016-10-19-1

Full Stack Radio:
52: Taylor Otwell - Patterns for Simplifying Laravel Applications
Oct 18, 2016 @ 09:38:05

The Full Stack Radio podcast, hosted by Adam Wathan, has posted their latest episode - an interview with Taylor Otwell, creator and lead developer on the Laravel (and most of the projects in its ecosystem).

In this episode, Adam and Taylor Otwell have a discussion about strategies they use to write cleaner, simpler code when working with the Laravel framework.

They talk about several of the other packages/products in the Laravel ecosystem (like Valet, Spark and Passport) as well as some of Taylor's thoughts on simplifying code including a few other links to presentations and tutorials on the same topics. You can listen to this latest episode either using the in-page audio player or by downloading the mp3 directly. If you enjoy the show, be sure to subscribe to their feed and follow them on Twitter for updates on when new episodes are released.

tagged: fullstackradio taylorotwell laravel simplify patterns development podcast ep52

Link: http://www.fullstackradio.com/52

Jani Hartikainen:
5 step method to make test-driven development and unit testing easy
Oct 11, 2016 @ 10:23:08

While his examples may be in Javascript, Jani Hartikainen has posted a guide that can help any developer get started with TDD - Test Driven Development - in their new or legacy applications.

What’s the hardest thing in test-driven development or unit testing in general? Writing tests! The syntax or the tools aren’t the problem – you can learn those enough to get started in 15 minutes. The problem is how to take some vague idea in your head about what you want to do, and turn it into something that verifies some function works… before you even wrote the damn thing!

People tell you to use TDD. But how can you possibly write a test for something that doesn’t exist? I don’t even know what the function is going to do yet – or if I actually want two functions instead of one – and instead you want me to think of a test for it? Are you crazy?

How do all those people who tell you to use TDD do it? That’s the thing – test-driven development requires thinking of your code in a different way. And nobody ever tells you how to do that. Until now.

He then breaks down the process of how to turn a "vague idea" into something that can be effectively tested, noting that this change in thought process can sometimes be difficult. He then breaks it down into a set of five steps:

  • Step 1: Decide the inputs and outputs
  • Step 2: Choose function signature
  • Step 3: Decide on one tiny aspect of the functionality
  • Step 4: Implement test
  • Step 5: Implement code

While the above may seem familiar to anyone that's read about TDD before, it's interesting to see how he explains each item with an emphasis on behavior not just the code required. He ends the post with a few more smaller suggestions to help you get on the road to TDD with the same emphasis on behavior rather than functionality.

tagged: tdd testdriven development steps easy unittest behavior

Link: http://codeutopia.net/blog/2016/10/10/5-step-method-to-make-test-driven-development-and-unit-testing-easy/

October 2016 Issue Released - Pillars of Development
Oct 04, 2016 @ 09:55:07

php[architect] magazine has just announced the release of the latest edition of their magazine, the October 2016 issue: Pillars of Development.

Articles in this issue include:

  • Juggle Arrays Using Functional Callbacks (Andrew Koebbe)
  • Dev Divas: History’s Heroines of Computing, Part One (Vesna Vuynovich Kovach)
  • The Strangler Pattern, Part One (Edward Barnard)
  • API Tips From the Front Line (Anna Filina)

The usual columns are also back including the "Education Station", "Security Corner" and "Leveling Up". If you'd like a sample of the contents of the issue, they're also offering a free article, "COTS, Open Source, Build it Yourself, or Something in Between?" by Eli White. If you pick up your own copy of this latest edition directly from the php[architect] website either as an individual issue or as a subscription (either digital only, print only or combined).

tagged: phparchitect magazine october2016 pillars development issue release

Link: https://www.phparch.com/magazine/2016-2/october/

How is everyone doing development locally today?
Sep 23, 2016 @ 12:08:17

On the /r/php subreddit from Reddit.com there's a post from Spvrtan asking the community what technologies they're using for local development in their day to day development work.

It's honestly been over 5 years since I last touched PHP on the back-end. At that time, other than "doing it live", XAMPP was the top dog for local environments. Is there a new player in the space or should I go with the same? I've been working primarily as a front-end engineer for the past few years during my full-time employment roles and touched the back-end on projects I've worked on but they've all been Java-based.

They also ask what other developers are using for their deployment tools and pipelines. Answers to the post so far include some of the usual tools and methods including:

  • Docker
  • puphpet (for use with Vagrant)
  • Homestead from Laravel

Other comments also mention the manual creation of virtual machines and even support for local installations rather than virtual ones. What's your development environment like? Head over to the topic and share your own setup too.

tagged: reddit rphp local development virtualmachine opinion deployment

Link: https://www.reddit.com/r/PHP/comments/54487o/how_is_everyone_doing_development_locally_today