Entries with the tag "programming"

Tools You Need for Measuring Everything and Anything

Measurement is important. Metrics, while not sexy, are concrete to a good business strategy. When you bring a problem to your superiors, they’re going to want to know what is your measurement, what metrics did you use to determine this is a problem. With tasks I’ve given developers, I’ve always said “show me the metrics that your fix is better” versus just looking at the code. (more…)

The Evolution of PHP Programmers

I think around 2015, there was a big splash of good training online for PHP. Frameworks upgraded/changed, helped programmers write better code faster earlier than that. Before that, it was a lot of RTFM. So, before, in the earlier days (maybe somewhat still today), I think PHP developers did this: (more…)

Why Use Private in Open Source Software

As a PHP programmer, I struggle to understand the reason for private methods and properties. Now, don’t get me wrong, I know the official explanation for them: “Use this to hide properties and methods from child classes” - but why? There have been a number of times when I’ve done stuff that is way more of a cluster-fnck because of private methods that I couldn’t slightly modify. (more…)

How to discover talent, not just skill

One of the newer programmers on my team asked me the other day why I hired him. I said “I saw you had a natural talent, and have potential.” We both kind of laughed because we knew his skill level at the time was very low. He was not that experienced. But, he had more questions about how I can detect talent and potential versus just someone who has really polished looking code. (more…)

Developers: How to get your estimates right

Estimates can be one of the hardest things to create as a developer. The word estimate is a misnomer in our industry. It’s almost as if they should be called “agreements” or “promises” according to some bosses. Yet we all know that they are just that: an estimate of the amount of time, not a guarantee. (more…)

Make sure not to "too" future-proof your code

When doing a bit of code review, I saw an incredibly ornately architected future-proof module written by one of my programmers on my team. It had taken him roughly 3x as long as I had estimated, but the code was very complete. It was created in such a way that every single portion of it was modular and could be interchanged quite easily. (more…)

Release the quality you'd expect

Recently, I had a programmer create a new feature for one of our products. He inadvertently caused another feature of our product to look less polished and function a bit weird. (I called it ‘wonkified’). The consensus of the group was to push out the feature, and then go back and fix the broken part of the old feature in the next week or so. (more…)

Theoretical Thoughts on Data Object Validation

One of the things I struggle with is the validation of data objects. I submit that there is such a thing as a dumb data object and a validation domain object. The validation object could also be some sort of helper or a service I guess. But, the point is, that the main data object doesn’t have validation on it. It has coupled objects that provide that validation. (more…)

Conway's Game of Life - In Javascript

Recently, someone mentioned to me Conway’s Game of Life was a programming challenge at a code retreat they attended. I had never heard of it so I went to take a look at the concept. It seemed like a cool idea. So, I decided to use Canvas and Javascript to create my own instance of it. This is just my first draft of it - so take a look. And, if I’ve done anything incorrectly,... (more…)

Should you use software you are making new again?

Lately, I’ve been working on the “2.0” of a very old piece of software in our organization. I rarely use this software - partially out of the pain caused to try to figure out how to navigate it and the associated slow user interface - and partially out of a different theory about new software development. Let me explain. (more…)

What I look for in a code review

A few days (ok, a bunch of days) ago, someone asked me on twitter what I look for when I do a code review. Pretty certain I was tweeting that I was either… a) doing a code review or b) annoyed at doing a code review. heh. I thought for a bit, and I think I’ve distilled the list of things I look for. Now, mind you, I don’t set out with my checkbox list... (more…)

The point of custom exceptions

I tend to want to use PHP Exceptions when I can. But, I don’t just leave them as is. I tend to have a large custom exception library. These exceptions extend the base Exception class in PHP - that’s about it. (more…)

Create your application with "overtake user"

A couple years ago, I developed this concept I call “Overtake User.” Basically, in every application I build, I build in the ability for the currently logged-in support specialist or admin to become someone else. Now, this is different than just viewing the user’s information and records. This actually let’s the current user become the other user. This is helpful also for scenarios where the user is “seeing something strange” but you can’t see it.... (more…)

The Importance of Adding Auditing to Your Applications

One of the things I learned while working at “The Triangle” was the “joy” of auditing. From their point of view, auditing was extreme. Think journaling and you have a pretty good idea. Now, when we talk about auditing, make sure to understand this is referring to change tracking and not vulnerability or fault detection. (more…)

How to Quickly Mask a Credit Card Number

So, often I have to show a masked credit card on the screen. However, I really want to go the extra mile and show the user a secure, fully masked credit card number that still reflects their original card. For example, if their credit card number is only 15 numbers long, I shouldn’t show a 16 character long string. So, I’ve developed this code snippet: $cc='1234123412341234'; $masked = str_pad(substr($cc, -4), strlen($cc), '*', STR_PAD_LEFT); (more…)

Service Class Methodology

There has been a lot of discussion on forums and throughout the object oriented PHP programming community about service classes. This is just intensified by the Zend Framework model of development coupled with the changes in their design/architecture and vocal spokespeople. I thought I’d throw my hat in the ring for this. (more…)

Why IP Authorization No Longer Works on Web Apps

The last time someone brought up authorizing certain actions by IP address - or I should say, limiting the amount of actions that can happen by one IP address. I brushed that off without a second thought. It didn’t occur to me until later that the original owner of that idea may not have known all the reasons why I know this isn’t a good idea. So here’s a quick rundown: (more…)

Object Cache Class in PHP

While I’m infinitely happy that all uses of a class in PHP now are references, that’s just not good enough. Sometimes I want to use my newly created object in many different methods. I have two options. First, I could create it as a Singleton, and always call the instance getter. Or, I could use an object cache. (more…)

3D walkthrough in Basic

Just had a blast from the past… found this a while ago. This was a program I wrote way back in the days of Basic. It was a basic 3D walk through. ' Added speed routines and antiflicker and take away waits. ' 3rd generation program ' ' 'Here's my take on the doom.bas program that was posted here a while ago. 'It's much clearer and more organized and a bit faster as well, I... (more…)

chaining methods in PHP

I rarely find myself needing to chain methods in PHP - but its not an altogether bad idea. The only caveat that is necessary is that your code must be written in such a way that a method can fail, but other methods can still continue. For example, you couldn’t have one method return false… that would break the chain. You also couldn’t have a method depending on the actions of the previous method to... (more…)

Email to SMS/TXT address list

The website http://www.emailtextmessages.com/ keeps a database of most of the email addresses that correlate directly to a txt for mobile phones. However, their version is in HTML - and I see no feed. I’ve compiled the list into a CSV file so that its easier to use in programming. Do visit their website and click on an ad to support their hard work. (more…)

Understanding the Observer Pattern in PHP

For a while, I’ve been looking at plugin systems, but not really fully understanding the pattern behind them. Don’t get me wrong, I see how they work, but I didn’t know the reason why - the theory or pattern behind it. Well turns out, generally, they’re based upon the observer pattern. I decided to write my own observer pattern demonstration here. (more…)

Adobe Air Log File Watcher

One of the biggest pet peeves I have is when errors are generated on PHP files between redirects using the header() function. Especially if they’re not a fatal error, you never get to see them! Also, missing files that hit the apache logs usually are not found later until you review the logs as well. I thought: wouldn’t it be great if there was a tool that would watch these log files for me? (yes,... (more…)

Writing a Spelling Corrector

Normally I like to post content that I’ve actually written, but I can’t pass up linking to this article: How to write a spelling corrector. Its a great piece that explains the math behind the spelling correcting that Google, Yahoo, etc… do when you’re doing a search and gives code examples on how this is accomplished. Very great read! (more…)

Go to All Posts

Get the RSS for programming