 | News Feed |
 | Jobs Feed |
Sections
|
Community News: "PHP Tip a Day" Blog
by Chris Cornutt May 17, 2012 @ 11:07:58
Greg Bulmash has started up a new site that's dedicated to the "tip of the day" sharing of PHP facts he finds out in the course of his development, php-tip-a-day.com.
I started a daily PHP tip blog a couple of weeks ago, figuring the daily writing will keep me curious about programming. [...[ I've found that I learn things better when I have to absorb them well enough to explain them to someone else, so this site (and a couple others I'm starting up) are my attempt to just solidify my knowledge and push my skills. The goal of writing five brief tutorials about various functions, methods, or solutions each week is meant to force me to keep expanding my knowledge and to help me burn it into my brain. I hope others might find it useful.
So far he has posts about things like:
There's lots of good content here, especially if you're a beginning developer and want to discover these helpful hints along with him.
voice your opinion now!
tipaday tidbit knowledge tutorial
Reddit.com: Too many bugs and too much stress
by Chris Cornutt May 17, 2012 @ 10:37:58
In this recent post on Reddit.com, a developer asks the community about some of his feelings about bugs in his software and his focus on quality:
No one has told me this and I don't need them too. I feel like one bug that has a negative impact on the user experience is too many bugs. I've been programming for over 5 years professionally and I still introduce bugs into my code. [...] I don't like the expectation that I (and maybe others have) that my code must be perfect when I am not perfect. I don't like the fact that it only takes one mistake to affect so many people. [...] I'm wondering if others on here have every felt this way. What have you done about it?
Suggestions in the comments talk about everything from dealing with the apparent burnout the developer is facing, a reminder that no code is bug free and some recommendations of testing and bug tracking to help make the quality of the code better (and give visibility into the level of work being done).
voice your opinion now!
bugs burnout testing opinion code quality
Chris Hartjes' Blog: How the Testing Sausage Gets Made
by Chris Cornutt May 17, 2012 @ 09:19:33
For those either just getting into unit testing your applications (maybe even TDD) or those that are old hat at it and what to figure out a few more tricks of the trade, you should check out this latest post from Chris Hartjes about some of the tools he uses to get the job done.
So how does the Grumpy Programmer write code, TDD style? It starts with using a set of tools that reduce the amount of friction required. First, I do almost all my work from a terminal. [...] Why the terminal? PHPUnit is a CLI application. Yes, many popular editors and IDE's can do things like execute PHPUnit for you, but they are limited in what flexibility they provide.
He also talks about his editor of choice, vim, and some of the plugins he uses in his day to day testing development. This includes tools to handle things like interfacing with git/gists, working with ctags to see the code's structure, working with "surroundings" and the pathogen plugin to make adding other plugins easier. He keeps the code up in one terminal and his testing tool (PHPUnit or other) accessible in a second, making it a simple matter of switching to write the test then the functionality to make it pass.
If there is a lesson to be learned from this, it's to make sure that every tool that you use reduces the friction that is generated when building your application using TDD.
voice your opinion now!
testing tools vim plugins tdd unittest phpunit terminal
PHPMaster.com: Handling Collections of Aggregate Roots - the Repository Pattern
by Chris Cornutt May 17, 2012 @ 08:44:37
On PHPMaster.com today they have a new tutorial focusing on using the Repository (a part of the domain driven design architecture) to enhance your model's current functionality.
Unlike mappers, though, which are part of the infrastructure, a repository characterizes itself as speaking the model's language, as it's intimately bound to it. And because of its implicit dependency on the mappers, it preserves the persistence ignorance as well, therefore providing a higher level of data abstraction, much closer to the domain objects.
Included in the tutorial is the full code you'll need to create a simple UserInterface class and a User model that extends it. He also makes a UserCollection class to handle working with multiple User objects and a UserMapper to handle the actual data source fetching. Finally, he implements the Repository on top of this base structure showing how it lays on top of everything via the UserMapperInterface instance. At the end some example code showing it in use is also included - making the PDO connection, creating the UserRepository and fetching by a few different data types (email, name and role).
voice your opinion now!
repository pattern domaindriven architecture tutorial mapper
Marcus Bointon's Blog: Compiling wkhtmltopdf on Mac OS X 10.7 Lion
by Chris Cornutt May 16, 2012 @ 11:55:26
Marcus Bointon has written up the process he took to get the PHP extension for Wkhtmltopdf (a conversion tool for HTML to PDF generation) up and working on a Mac OSX machine - not as easy a task as it sounds.
Wkhtmltopdf is extremely cool. I've used qtwebkit for generating server-side page images before using python-webkit2png, and that's fine (unlike using Firefox running in xvfb!), but I need to produce PDFs. So, I looked around and found several neat, simple PHP wrappers for calling wkhtmltopdf, and even a PHP extension. "Great", I thought, "I'll just install that and spend time working on the layouts since the code looks really simple". I spoke too soon.
He goes through each step of the process - installing the needed wkhtmltox and libwkhtmltox support, having to manually compile wkhtmltopdf and some of the small changes you'll need to make to the Makefile to get things to cooperate. He shows where to put the resulting application files and the name of the extension to enable in your php.ini.
voice your opinion now!
compile osx wkhtmltopdf problem manual
Chris Hartjes' Blog: Have a 'Strategy'
by Chris Cornutt May 16, 2012 @ 10:42:29
In response to this suggestion from Alessandro Nadalin about using the "Strategy" design pattern to replace a switchChris Hartjes has this new post sharing his opinion of "the right way" do it it.
Once I realized what he was doing, I realized that the Strategy pattern was applicable in this case…but his chosen example was dumb and one that I wouldn't have used to demonstrate things. As expected, he told me to supply a sample of a better way. I did, telling him that the sample would be better if he didn't mash the logging level together with the message.
Included in the post is sample code, first showing the initial version of the logging class, complete with accompanying tests. Following that, he shows how to refactor it into something using the Strategy pattern, replacing the logging type switch statement with protected methods for each logging message type (critical, notice, etc).
voice your opinion now!
strategy designpattern refactor logging unittest
Symfony Blog: Symfony Community Survey 2012
by Chris Cornutt May 16, 2012 @ 09:05:21
The Symfony Project is running a community survey for developers using the framework. It asks some generic questions including "how long have you been working with Symfony?" and "how did you get to know Symfony?"
Symfony 2.0 has been released for quite a long time now, and so we would like to conduct a quick survey to get a better understanding of the Symfony community. I'm going to use some of the aggregated results for my Symfony Live keynote, and all the aggregated results will be published on this blog after the conference.
If you're a SenseioLabs Connect user, you can also get a badge for participating and will be included in a giveaway for tshirts and hats.
voice your opinion now!
community survey symfony project
|
Community Events
Don't see your event here? Let us know!
|