php[architect] logo

Want to check out an issue? Sign up to receive a special offer.

Editor Bytes – Data Discipline

Editor-in-chief Oscar Merida looks into the August 2020 issue, Data Discipline.

Listen

Transcript

Yes, on the Internet, everything is a string. However, that doesn’t mean we can ignore the structure and intended uses of the data that our applications work with. This issue focuses on how to ensure your data works with you and not against you. Review how to store it in a database, impose order to your JSON data with JSON-Schema, query it with SQL, choose an appropriate PHP type for your variables, and more.

Before I worked with PHP, my first programming experience was using Visual Basic to program macros for Microsoft Word documents and Excel spreadsheets. Typically, I was automating the production of monthly reports or helping scrub attendance data for various events. While I don’t recall the specific programs, I have vivid memories of tracking down bugs because I had not converted a string to an integer or float when performing some operation. A year or two after that job, I began working with PHP 4 and appreciated that I didn’t have to declare the type of a variable explicitly. I didn’t have to remember to convert an integer to a float before adding it to another floating-point value. In time, I learned that this convenience leads to subtle bugs or always remembering to use === when using strpos() or comparing hashes. As much as we’d like to let the compiler worry about data types for us, some forethought and planning when coding can prevent errors down the line and avoid edge-cases that lead to security vulnerabilities.

Our issue starts with Matthew D. Groves writing about “Querying NoSQL With SQL: HAVING Your JSON Cake and SELECTing It Too!” If you grumble when working with a document database because the query syntax is unwieldy, check out this emerging standard that uses SQL syntax. In “JSON Schema Validation With MySQL,” David Stokes shows how to use JSON-Schema to ensure a JSON document conforms to your expectations. In our third feature article, Erwin Earley provides an introduction to working with IBM DB2 and shows how familiar its interface is compared to the mysqli API. He even shows how to use both APIs to tie related data across both systems in “PHP and Database Access.”

In “PHP Puzzles: Writing a Dice Roller,” Sherri Wheeler solves last month’s challenge for parsing tabletop dice rolling expressions. She starts with a string splitting approach and then refactors her second solution into a class. Chris Tankersley dives into “Effective Data Typing,” in this month’s “Education Station.” Prompted by a discussion at his work, he reviews PHP’s data types, type juggling, and offers advice on using it effectively. Are you worried about continuing to use Windows for PHP development? Don’t be. Joe Ferguson has us covered in “The Workshop: PHP Development With Windows Subsystem for Linux.” WSL 2 seems to provide a familiar Linux setup within Microsoft’s OS. In “Community Corner: PHP 8 Release Managers: Interview with Sara Golemon and Gabriel Caruso, Part Two,” Eric Van Johnson continues his chat and touches upon PHP Internals and what goes into a PHP release. Over in “Sustainable PHP,” Edward Barnard sets off on “The Quest.” He’s looking for some way to avoid the usual end-state of too many PHP projects—the Big Ball of Mud. Eric Mann writes about the importance of “Usable Security” in “Security Corner.” If you make your system too difficult to use, your users will find a way around it. Since many people are looking for jobs at the moment, Eli White shares his advice on “Interviewing Remotely” in “finally{}.” If you’re looking to add to your team, read on for help getting the most out of an interview when it can’t be face-to-face.

Air date August 12, 2020
Hosted by Oscar Merida
Guest(s)

Leave a comment

Use the form below to leave a comment: