Entries with the tag “programming”

For more generic programming related content, these entries get the “programming” tag. They may have specific language syntaxes or be about theoretical and pseudocode.

Actions Should Not Have Tightly Coupled Input

Oct 12, 2023 laravel php programming

If you’re going to use an Action pattern for your application, be careful what you expect coming in as input. In fact, input should be loose and output should be tightly coupled. Let me explain…

Should We Use a Monorepo?

Jul 1, 2023 programming

A monorepo refers to a single repository in your version control system that holds all of the code for an entire project. That project could be made up of many services, front and back end code, ETLs, etc.

There are many technical arguments for using a monorepo vs a bunch of smaller repos that are more targeted to that functionality. But, one argument is often left out of the discussion.

How to Fix Chronically Out of Date Documentation

It seems that every project we run into has missing or out of date documentation. Wikis become stale. Don’t even start me on that out of date README.md file.

It’s almost not worth writing documentation because it gets out of date so fast.

Right?

An Argument for Keeping Your Project Simple

May 22, 2023 business programming

Awesome. You used interfaces so you can abstract out the dependencies and swap services. Your database queries are all built with an ORM that is database agnostic. You don’t rely on anything special with your servers/cloud. You did it! You now have a project that retains the business logic while allowing all the technical aspects to be loosely coupled! But should you have done it?!

Are programming surveys accurate?

Mar 27, 2022 programming

Please indulge me on a bit of an open-ended question and discussion. Recently I saw some “state of the XYZ” surveys where those were specific languages. The surveys were only answered by about 3,000 people each. And then people spoke about them as authoritative references. But are these surveys actually accurate?

Why is Deleting Code OK but Fixing is Not?

Mar 2, 2022 business programming

One of the most painful things for programmers - whether you’re in a startup or an established business - is leaving code alone that you know could be better. That should be better. There are reasons for this - but what about when it comes to deleting code?

Programmers Aren't Being Lazy: They're Reducing Cognitive Load

Jun 14, 2021 business programming

There’s a common joke among programmers: I’m so lazy that I made this script to automate these tasks. Efficiency and process are prized, but also sometimes mocked and ridiculed. So, are programmers actually lazy - or is there something deeper here - have they been mislabeling something else?

An Argument for Larger Dev Scopes

Mar 29, 2021 management programming

Conventional wisdom says to scope down your initiatives and make small tasks for your team members. It’s best if each can easily work on a single task in a silo, so they can get the project done with the least overlap and delay. But, what are we losing with this methodology?

What License to Use for Private Software

When it comes to Open Source Software, you have a number of choices to make for licensing your software. When you provide a license for your software, you, as the copyright holder, are giving various types of permissions and warranties for the use of this software. You might even define the way it can be used and if modifications have to be submitted back to you. But, what do you “license” software that is closed, paid or private software that you don’t want anyone else to use?

Try Your Process Before Tooling Your Process

May 27, 2019 programming

I’ve known a lot of programmers who give a lot of concern to making the best product they can. They follow best practices, create amazing programs and demonstrate both quality and accuracy. It’s quite amazing. But when you look at their internal tooling, it’s garbage. What gives?

Have Informed Opinions

Apr 8, 2019 business programming

I don’t want this to turn into a rant, but…

Stop Considering the Same Password a New Password Attempt

Apr 1, 2019 business programming

One of the most rewarding things I’ve done as a programmer was watch a real life in person focus group use my application. At first, I didn’t enjoy it. But like most lessons, looking back, it was extremely valuable.

How to Learn Programming

Nov 3, 2018 programming

Over the course of many years, I’ve heard many variations of the same question “How do I learn programming?” Normally, I’m caught off-guard. I don’t know the answer. Things are constantly changing, and what was around “back then” may not be around now. Plus, I don’t exactly remember all of the steps I took to learn programming. Finally, the way I learned programming doesn’t make sense these days. Technology is much different - you wouldn’t consider dialing into a BBS or reading the manual that came from your computer, would you?

Tools You Need for Measuring Everything and Anything

Sep 18, 2018 misc-web mysql php programming

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.

The Hardest Part of Mentoring is Knowing What and When to Share

I’ve written about mentoring a bunch before , so you know I’m a fan of it. But, there’s another aspect that has been bothering me lately. The questions are simple:

Understand the Tech Before Getting a Package

Jun 13, 2018 javascript php programming

How often have you heard this phrase?

Rockstar Coders are Ruining Your Business

It’s such a cliche by now - “We need a rockstar programmer” or “only code ninjas should apply” - but this choice in your job want-ad is ruining your business. Let me tell you why.

How to Find Sections of Code to Review

Nov 14, 2017 programming

I’m a huge fan of code review and code walkthroughs. I’ve been asked before what I look for while reviewing code but I don’t know if I’ve ever addressed ways to pick out what code to actually review.

33 Things I Wish Somebody Would Have Told Me

I’ve migrated the website 33thingsbook.com to this blog post.

A programmer’s guide to quality code, great work relationships and respect.

The Evolution of PHP Programmers

Oct 17, 2017 misc-web php programming

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:

Why Use Private in Open Source Software

Sep 4, 2017 php programming

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.

3 Steps to the Best Programmer's Cover Letter

Jul 11, 2015 business programming

The other day I found myself giving advice and revisions to a fellow PHP programmer about his cover letter for his next job application. That really inspired me to help out and write this entry.

Should you unit test your dependency container?

I’ve been working with Pimple Dependency Injector lately, and I’ve come up with an interesting question.

3D Printing Makes Manufacturing More Like Programming

Oct 11, 2014 business programming

I think it’s pretty awesome that my daily job is making something out of nothing.

How to discover talent, not just skill

Sep 10, 2013 management programming

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.

How to structure your controller, service and mapper method names

Aug 6, 2013 programming

I was talking with one of the junior programmers on my team about naming method names. He was having problems coming up with ones that seemed to make sense to him and to the application. I broke it down how I think about it:

Would You Find Value in a One on One Video Code Review Session?

Jul 17, 2013 business programming

Hello friends - I’m trying to get an idea if this would be a good idea. Let me know your thoughts in the comments.

Developers: How to get your estimates right

May 1, 2013 business programming

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.

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

Mar 19, 2013 programming

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.

Release the quality you'd expect

Feb 19, 2013 misc-web programming ux

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.

Theoretical Thoughts on Data Object Validation

Jan 29, 2013 php programming

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.

Conway's Game of Life - In Javascript

Jan 22, 2013 javascript programming

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, please please please! let me know.

Should you use software you are making new again?

Jan 1, 2013 programming

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.

What I Look For in a Code Review

Oct 18, 2012 business programming

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 or a manual, I just look at the code and “feel” it. Yes, that sounds crazy. I understand. But, subconsciously, I think I’m doing the following things when I do code reviews:

Services, Mappers, Models: Enterprise Thinking in PHP {presentation}

Oct 9, 2012 php programming

One thing I’m really passionate about is using PHP in enterprise situations. I obviously care about Design Patterns in PHP. I’ve also done a lot of technical review of other books about refactoring away from bad code.

The point of custom exceptions

Sep 25, 2012 php programming

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.

Book Review: PHP Frameworks and Applications

Jul 24, 2012 php programming

I just finished glancing over Real-World Solutions for Developing High-Quality PHP Frameworks and Applications. I gotta say it…

Create your application with "overtake user"

Jul 10, 2012 misc-web programming

A couple years ago, I developed this concept I call “Overtake User.”

The Importance of Adding Auditing to Your Applications

Jun 5, 2012 programming

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.

Filtering and Validating Discussion

I came up with a great topic to write this blog entry about: filters and validators. Then, I got to thinking - maybe I can get more feedback from other programmers I know. I decided to send a note out to a few of my buddies and see what they thought as well.

How to Quickly Mask a Credit Card Number

Jan 10, 2012 php programming

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:

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.

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:

To WWW or not to WWW

I run into this question a lot. Should my website have www in the domain name. Should I be going to aaronsaray.com or www.aaronsaray.com?? That is to say, which should be the default home page domain? Let’s discuss…

Excel won't handle UTF-8 in CSV? Force a different encoding in PHP

Dec 14, 2010 php programming

When generating a CSV file with PHP in the UTF-8 encoding, Microsoft Excel freaks out. It just doesn’t show the proper encoding. Thank you Microsoft! However, I did find a way to handle this encoding and make it compatible for Windows/Microsoft Excel.

Guitar Chord fingering with PHP

Nov 30, 2010 programming

After cleaning up some old files in my archive, I found this snippet of code I made a while ago.

Object Cache Class in PHP

Nov 16, 2010 php programming

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.

3D walkthrough in Basic

Nov 2, 2010 programming

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.

Chaining methods in PHP

Nov 4, 2009 php programming

I rarely find myself needing to chain methods in PHP - but it’s not an altogether bad idea.

Email to SMS/TXT address list

Oct 28, 2009 programming

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.

Multi-Version Programming to Successfully Leverage Overseas Programming

Sep 20, 2009 business programming

Today, I read through the paper titled ‘An Experimental Evaluation of the Assumption of Independence in Multi-Version Programming’ (Find it here).

Licensing of Code

Apr 25, 2009 programming

UPDATE As of 2023, all content is now licensed Creative Commons. See the footer for more details.

My Progression Through Forgot Passwords

Mar 2, 2009 php programming security

I thought I’d take some time to look at the 3 main ways that I’ve handled forgotten passwords on my websites, why I did them that way, and if there was anything wrong.

Please Use Public Accessors in your Object Oriented Programming

Feb 4, 2009 php programming

I really hate to see people accessing and designing objects with public attributes. So many times I’ve seen this backfire. Let’s take a few examples and see why this matters:

Understanding the Observer Pattern in PHP

Nov 17, 2008 php programming

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.

Why your company needs a System Architect/Analyst

Sep 10, 2008 misc-web programming

In this post, I’m going to cover what a System Architect/Analyst (SA from now on) is and why you need one.

What I believe MVC is - or MVCFDH

Aug 28, 2008 php programming

There are many interpretations of MVC - there are less definitions but more implementations. I want to cover what I personally do when using PHP for MVC. I call it MVCFDH.

Adobe Air Log File Watcher

Aug 9, 2008 programming

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, a while ago, I talked about the perl “tail” script that I used in my eclipse to watch these… but… this is even better). Well there is a solution! My first Adobe Air application: Log File Watcher!

Which Conference Should I go to - Help me in 2008

Apr 1, 2008 programming

So, luckily, my current employer will pay and make arrangements for me to attend one major conference each year. Last year I attended Mysqlconf, the year before, Zend Con.

Eclipse Testing with TPTP - help me?

I recently came across this tutorial here about Testing with TPTP - and I’m confused. What’s the benefit of this type of testing (um… creating JAVA code for a JUnit test… right?) compared to running some PHPUnit, Selenium and AB (from apache, or something…)? What am I missing - does anyone have any other good hands-on tutorials?

5 Things this PHP programmer learned from System-i/as400 programmers

Dec 9, 2007 php programming

Working in a shop that has approximately 15 times more System-I as/400 iSeries (whatever you want to call it) programmers, I’ve been immersed into their culture, standards and mindset.

Writing a Spelling Corrector

Oct 23, 2007 programming
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!