Nick Halstead's Blog: Programming Tips #9 "debug_backtrace"
686117
Nick Halstead has posted the latest programming tip to his blog today (as written by LArry Garfield) concerning the use of debug_backtrace.   Despite the proliferation of debugging tools, especially real-time debuggers, "debugging by print statement" remains the most common form of debugging in most programming languages. [...] Fortunately, PHP offers another debugging tool: debug_backtrace(). It returns an array that is a complete function stack up to the point it is called.   Larry includes a basic example of the function in use - a debug() function that takes in a message, label and a "stealth" setting and outputs a formatted result of the debug_backtrace output.
692991
From Carlo on the FCHouse.com blog, there's this new guide to debugging your PHP5 application with the Eclipse PDT functionality in an OS X environment.   In these months I have developed in PHP with Eclipse PDT (Php Development Tool). During the first days I tried to make the debugging works, but without great results, therefore I dropped and I took back the usual debugging technique of every good script developer: echo $variableName; or simply logging everything possible in some log files.   Knowing that this wasn't "the right way" to do things, Carlo searched for something better. He found a hint on another blog and ultimately figured out how to get his Eclipse/Apache/XDebug installation to work on his Mac. His post also includes the "glue" that you'll need to get them all working happily together.
273160
By Bruno Dieter Chan  THIS week I have some interesting software for you. We'll start off with the useful and work our way down to the could-be-useful.
347638
In a new post on his blog, Kore Nordmann takes a look at a feature that's been around a long time (first introduced in a message board application) - BBCodes.   The discussion on my blog post "Do not use regular expressions for parsing" ended in a discussion about BBcodes in general. I just used them as an example to demonstrate why it it is impossible to parse such a language with regular expressions - and mentioned in a subclause, that I don't see any sense in using them at all.   He looks at some of the myths surrounding them and their use (more secure, easier to use, safer than HTML) and gives some reasons for making teh choice of HTML over them.
184722
On his blog, Nick Halstead shares a few tips he's worked up to help developers that might be having a hard time with coding issues - a few steps towards solving programming problems.   Early on in most people's programming careers problem solving is a large part of your day to day job. As you become more experienced you find that many programming patterns that you have used before can be reapplied. You then start working on larger and larger projects and the problems tend to be more about solving architectural problems rather than logic related ones.   Included in his list are things like "Talking it through", "Brainstorming", "Breaking it down" and "Research". This last one can be one of the most important and can save tons of time in the long run. With tools like Google and other sites, there's no reason to check before you start a project to see if there's someone out there that might have already done it (and it might be more well developed).
357182
In a new post to his blog, Chris Hartjes, spurred on by an article in the latest edition of php|architect magazine (covering protecting your code), has shared a few opinions starting with a certain paragraph near the end.   To start, I will focus on the paragraph above. What I get out of that is that if only your source was closed and hidden from prying eyes, it would not have bugs in it. Which is, of course, total nonsense. Code has bugs because it's open and they feel safer? There are two kinds of bugs: application bugs (which is the code I would write) and system bugs (in this case, bugs that that appear from PHP itself). I'm sorry, but there is nothing I can do if there is a bug in PHP that causes my application to crash except to point this bug out to the people who have the ability to fix it.   He goes on to talk more about how protection like this (the article talks about using the IonCube Encoder) will not stop someone if they're really determine to get at the code underneath the encryption. His only suggestion is to make an application good enough that people wouldn't want to try to steal it as much and would rather pay for their version.   Encode your stuff if you want, but be aware that the minute you choose to do that you are telling your customers "I don't trust you" and I have a hard time understanding a business model that assumes people are going to want to steal the stuff you sell.
390086
In another quick note from Chris Shiflett, there's a summary of php|works and some of the comments made about it:
688722
Sample code that exploits a yet-to-be-fixed Windows flaw is circulating. Microsoft plans to deal with it on the next Patch Tuesday.
146149
An introduction to using refactoring, unit testing and ZenTest on existing code.
645963
Reading other people's code can be difficult, especially if you have no idea what happens when and where. Understanding code flow is vital to maintenance and bug fixes, but littering code with print and debugging statements is tedious and prone to error. There's another way: use the debugger! Daniel Allen demonstrates how to pinpoint a problem with Perl's debugger.
437494
Popular posts from PHPDeveloper.org for the past week:PHPClasses.org: A PHP killer feature - Streams abstractionRob Thompson's Blog: Switch vs. IfPHPEverywhere: Octopussy numbers in PHPJob Posting: MODE Visual Seeks PHP Developer (Charlotte, NC)ProDevTips.com: Why PHP as a templating language sucksMatthew Turland's Blog: The Yin and Yang of TypingStubbles Blog: Stubbles 0.5.0 releasedChristopher Jones' Blog: Updated connection pooling in PHP's OCI8 extensionBen Ramsey's Blog: Congrats Costa Rica PHP!Carsten Lucke's Blog: Configuration issues with Xdebug on Debian Etch
532255
Elizabeth Smith has a new post to her blog today covering some of the fun she's been having with compiling things like Gtk+ and PHP-Gtk2.   So I've been using microsoft visual studio (actually it's Visual C++ Express, but uses the same stuff behind the scenes) to work on getting things compiled on windows. PHP-Gtk2 allows for some nifty extensions, well at least on linux. So I've been working to get versions of libglade, scintilla, gtksourceview and mozembed working on windows. It's a long, slow process. Here's the deal so far.   She talks about her current situation (what's compiling and what's not) and the software that she's trying to get up and running. She also mentions a problem she's been having with an error message talking about "unresolved external symbols" she'll need to track down (or get some help on - anyone out there seen it?)
769015
Felix Geisendorfer shares, in this new post to the ThinkingPHP blog, some of his experiences with writing his code using test driven development.   So far I've had tons of fun trying to create php code using test driven development. It caused my code to become a lot more structured/consistent because writing the tests shows you interfaces problems right away. This is because the process of writing the test forces you to think a lot more about *how* you want to use some class / piece of code vs. your traditional "how can I get task x done"-thinking.   He also points out another benefit - it makes refactoring the code even easier (so there's more of a likelyhood that you'll use it again and again). He talks specifics about a library that he's been working on and the processes he's gone through to make things work with the testing versus his normal development cycle.
649335
Michael Kimsal has posted some more thoughts on what he calls the "sad state of PHP development" pointing out some of the practices of the PHP group surrounding the development of the language.   Every few months there's a release, whether large or small, which introduces new features and bug fixes. However, with every release also comes fears of tiny, sometimes undocumented, changes that break existing code, and often for no solid reason other than someone with commit access decided they liked the 'new' way better than the old way.   He points out a specific example, get_object_vars and how its return values were changed in an earlier release as well as the update to glob made recently to change its return types.    In his opinion:   No changes should be made to the PHP core without an issue being opened, either in the 'bug' tracker or some other issues tracker.   Be sure to check out the comments for other great opinions on the topic.
124078
I think I've mentioned this before but on Saturday Feb 12th I'll be talking  about the Jakarta FeedParser at CodeCon  in San Francisco.  I published an outline  of the talk on the FeedParser wiki.  I'm hoping to have a 0.5 release done before then and havepotentially another suprise in the works.
621839
"Rubinius is a project to watch", so says Charles Nutter in his post Rite, Rubinius, and Everything &mdash; I think he's right.  Evan is hard at work making things work better in rubinius.  He's now got continuations working (I think this makes him the first alternative implementation of Ruby to do so), and says he should have serializable continuations soon (see his post on it here).  W00t!
320730
I'm starting to realize that my blog is a bit of a time machine.  For example I can create a blog entry to warn myself about something that WILL happen in the future.    My current NTP  blog entry is a good example.  I wrote this for myself as much as for the people who read my blog (or find me via Google).  I know for sure that NTP on Debian is going to bite me sometime in the future and I'm going to forget WHY.  Then I'm going to (of course) go to Google or my aggregator and search for NTP and then find my blog post.    I've done this about a dozen times now and its saved me a TON of time!