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

Patrick Louys:
Become a better developer in 2018
Jan 11, 2018 @ 17:57:25

In a post to his site just before the new year Patrick Louys shared some of his thoughts about how to become a better developer in 2018 as a sort of programming-related New Year's resolution.

Do you have any programming related New Year’s resolutions? A lot of people don’t follow through with their resolutions. But don’t let that discourage you. When you make resolutions, you are much more likely to achieve your goals (10x more).

I wrote this post to show you how you can achieve your programming New Year’s resolutions. Every year I have been writing down my goals, for over a decade. It helped me grow a lot in my personal and professional life. It’s not just about setting goals and achieving them. You have to pick the right goals.

He begins by making a few recommendations when it comes to setting goals and how to set yourself up in your day to day work to achieve them. He then relates this back to programming goals, suggestion you focus more on patterns and practices rather than specific technologies (unless they're relevant to your work). He also recommends several books to read during 2018 to either learn new concepts if you're just starting out or wanting to refine your own skills.

tagged: better developer recommendation opinion newyear resolution

Link: https://patricklouys.com/2017/12/27/become-a-better-developer-in-2018/

Jason McCreary:
Accepting Adam's TDD Challenge
Mar 16, 2017 @ 15:43:02

Jason McCreary has a post on his site where he's officially accepted a challenge made by Adam Wathan during the Laracon Online conference and how he went about solving it.

Last week at Laracon Online Adam Wathan gave a talk entitled “Lies you’ve been told about testing”. Following the talk, Adam posted a challenge. Amid Adam’s post, he makes a single claim and presents a challenge.

The challenge was to write a unit test for the three provided class implementations in isolation. The claim is that isolated unit testing is incompatible with Test Driven Development (TDD). He talks about the other phases of TDD outside of the "refactor" step ("red" and "green") and how he would apply those to the steps leading to a complete refactor. He also talks briefly about testing styles and what would need to change to complete the process on both the code and the test side.

tagged: tdd testdriven development refactor challenge resolution

Link: https://jason.pureconcepts.net/2017/02/tdd-isolated-unit-test-challenge-adam-wathan/

SitePoint PHP Blog:
Responsive Images Using Picturefill and PHP
Oct 10, 2013 @ 15:08:11

On the SitePoint PHP blog there's a new post from Lukas White showing you how to use the Picturefill plugin (Javascript) along with PHP to make responsive images.

One of the key challenges with responsive web design, and a subject of much discussion in recent years, is how to deal with images. Setting a max-width on image elements enables designers to allow their size to adapt to the page dimensions, but in itself that approach can lead to far bigger images being downloaded than are required. [...] You can use a similar approach [to "source sets" of images] straight away and in a cross-browser compatible manner by using Javascript; one such method is the Picturefill plugin. In essence, Picturefill allows you to specify different src attributes for an image, each image file corresponding to a different media query. Thus

The tutorial helps you create an application, powered by the Slim framework and the ImageMagick extension, for the basic structure. He then grabs the Picturefill library and drops them into place. Some sample code is also included showing how to create the HTML structure for the images and the Javascript to handle the switching.

tagged: responsive image picturefill tutorial resolution source set

Link: http://www.sitepoint.com/responsive-images-using-picturefill-php/

Refulz.com:
Traits - Method Precedence and Conflict resolution
May 31, 2012 @ 15:07:25

On the Refulz.com site today they've posted a new tutorial looking at the use of traits and how to resolve conflicts and work with method precedence.

In our previous post about the multiple and nested traits, we read how nested and multiple traits can be used in a class. In such cases, there is a possibility of the same method name existing in the trait, and the class using the trait. Furthermore, the same method name might also be present in the parent class of the class using traits. It is important to understand how the precedence order works for such cases.

First they look at the precedence between classes and traits with the class always winning...unless the method is inherited from a parent class. They also mention the order when it comes to using the "insteadof" and "as" operators as a way to get around conflicts between traits.

tagged: traits conflict resolution inheritance precedence insteadof as tutorial

Link:

Toomas Romer's Blog:
Case study: Is PHP embarrassingly slower than Java?
Aug 04, 2008 @ 17:02:05

In a case study posted to his blog, Toomas Romer wonders if a PHP script is embarrassingly slower than than its Java counterpart.

The problem. The PHP implementation [of the IP2C library] is a lot slower. Embarrassingly slower. Without any caching the Java version is able to do ~6000 queries per second. The PHP counterpart can push through ~850 queries. The implementations are the same. The stats provided by the author of the library are 8000 vs 1200. So about the same as my measurements.

He details the script, showing what parts the script is taking up the most time on. A large part of the execution is tied up in IO and the fseek/fread and readShort/readInt functions take up a good chunk.

He even tries removing the functions and making things a bit more streamlined. This helps, but still lags behind its Java brother. Check out the post for more statistics comparing the two.

tagged: casestudy slower ip2c ip country resolution java compare benchmark

Link:

Inside Open Source:
Viewing Large Record Sets in PHPMyAdmin
Jan 15, 2007 @ 15:47:00

From the Inside Open Source blog (from APress) there comes a helpful tip for those working with Firefox and PHPMyAdmin on a lower resolution screen:

I'm currently working on an e-commerce project involving a relatively small number of database tables. However the clients table consists of 19 fields, making for difficult data review and debugging within PHPMyAdmin, even at 1280×768 resolution.

The answer is simple, at least if you're using Firefox. Firefox offers three hotkeys for changing the text size, and resultingly, the amount of text you can see on one screen.

The keys for this easy little fix use the Control key and plus (larger), minus (smaller), and zero (return to default size).

tagged: phpmyadmin firefox text size record set resolution phpmyadmin firefox text size record set resolution

Link:

Inside Open Source:
Viewing Large Record Sets in PHPMyAdmin
Jan 15, 2007 @ 15:47:00

From the Inside Open Source blog (from APress) there comes a helpful tip for those working with Firefox and PHPMyAdmin on a lower resolution screen:

I'm currently working on an e-commerce project involving a relatively small number of database tables. However the clients table consists of 19 fields, making for difficult data review and debugging within PHPMyAdmin, even at 1280×768 resolution.

The answer is simple, at least if you're using Firefox. Firefox offers three hotkeys for changing the text size, and resultingly, the amount of text you can see on one screen.

The keys for this easy little fix use the Control key and plus (larger), minus (smaller), and zero (return to default size).

tagged: phpmyadmin firefox text size record set resolution phpmyadmin firefox text size record set resolution

Link:


Trending Topics: