As you can probably tell, the title of this post is based off the common saying "The Grass Is Always Greener On The Other Side." I've always been amazed by this saying, because while we can find countless cases of it being true, we can also find countless cases of it being completely and utterly false. Take smart-phones for instance. People are quite dogmatic about which they choose, and they believe that the grass is definitely not greener. This is something that's bothered me for a while. But yesterday, I think I've made a cognitive leap towards understanding why it works for some things and not others...
Monday, July 30, 2012
The Grass Is Always ... Browner?
Friday, July 27, 2012
Framework Fixation - An Anti Pattern
In this day in age, it seems that the community trend is completely and unequivocally trending towards the use of web application frameworks. So much so that the defacto first comment to someone asking how to do something seems to be "Just use a framework, and it'll solve the problem for you." While I completely understand why this is the case, I can't say that I agree with it. And while I do believe that frameworks serve a purpose, I think that they are vastly over-used. Let me explain why...
Labels:
Anti-Paradigm,
Anti-Pattern,
Architecture,
Best Practice,
Framework,
Language Agnostic,
Library,
Micro Framework,
Object Oriented Programming,
PHP,
Programming
Wednesday, July 25, 2012
DAOs and MySQL - A Response
In response to last week's ask for questions, I received a number of questions that I'd like to address. Since it would only do the question justice to have a dedicated post for each question. So I'm going to try to do one post per week on a user-submitted question (probably on Wednesday, but no promises). This week's question is a rather abstract one:
I've been learning a lot about service layers and managers and domain objects and one thing really confuses me. Why is MySQL being turned into a non-relational database? It has so much power, so much flexibility, but it seems like many programmers want to abstract it to the point of near uselessness.
Now, there are so many facets to that question that it's hard to find a starting point. But let's try:
Labels:
Answers,
Database,
Email Response,
Good Enough,
Learning,
Object Oriented Programming,
PHP,
Programming
Monday, July 23, 2012
What Generators Can Do For You
The concept of generators was recently proposed for addition in PHP's core (Possibly for 5.5.0). While I believe that this is a great tool, it appears that many PHP developers aren't familiar with the concept of generators. So I thought I would take a little time and explain some of how it works, and how it can be used to greatly simplify code.
Labels:
Design Patterns,
Generators,
Object Oriented Programming,
PHP,
PHP-Internals,
Procedural Programming
Friday, July 20, 2012
Is Autoloading A Good Solution?
One of the most powerful changes that PHP5 brought to the table was the ability to autoload classes. It's such a useful tool that it was the first standard the FIG group put forth. Almost every single major PHP framework and library uses an autoloader to include its classes. It always felt somewhat wrong to me to autoload in production at runtime. So I decided to give it a bit more exporation...
Wednesday, July 18, 2012
The Anatomy Of Equals - Opcode Analysis
I was asked an interesting question via email yesterday. The question is fairly simple. The answer, not so much... So, rather than reply in an email, I figured that I'd write a post about it instead. The question, simply stated, is:
When comparing a float to an integer using ==, where does the conversion happen?
So, let's begin...
Labels:
Answers,
Email Response,
Learning,
PHP,
PHP-Internals,
Programming
Monday, July 16, 2012
The Secure Programmer's Pledge
Every day I come across code that is insecure. Sometimes the code is so hilariously insecure that any 10 year old could break it. I've also gotten into discussions with people who should know better about their practices. It's very, how to put this, disheartening. It's sad that the average developer knows (and cares) so little about proper security practices. So, I've put together a simple pledge (or manifesto, if you'd like).
Labels:
Best Practice,
Language Agnostic,
Learning,
PHP,
Rant,
Security
Friday, July 13, 2012
So, You Like To Read?
One of the things that I see repeated over and over again is the simple question "What books should I read to become a better developer?". Or "How did you learn about that?". Or even "What does a coding standard matter?"... OK, so that last one was a bit of a sentinel question, but the point is clear. Where should you look if you want to read to improve your development abilities? Well, I figured I'd take a few pages out of my library and share which books worked for me, in order of significance. If you remember from a prior post, I indicated that you should choose concepts over implementations. This list should illustrate that.
Labels:
Books,
Language Agnostic,
Learning,
PHP,
Programming
Wednesday, July 11, 2012
OOP vs Procedural Code
This morning I was asked a question that took me by surprise: "Your examples for PasswordLib are in OOP style, how do I write it in procedural style"... This took me by surprise, because the examples actually are in a procedural style. So I felt that I should write a post about the real differences between OOP and Procedural coding styles. Hint: whether you use classes and objects or not has very little to do with the answer...
Labels:
Architecture,
Best Practice,
Design Patterns,
Object Oriented Programming,
PHP,
Procedural Programming,
Programming,
Rant
Monday, July 9, 2012
Building A Multi-Version Build System
I've been using Jenkins to manage builds of my projects for a while now. This was fine for a while, but now that my projects need to support multiple versions of PHP, it left something to be desired. I wanted a system that could build against multiple versions of PHP. And more so, I wanted to be able to build against multiple compiles of the same version (different options, etc). This is how I built just such a system...
Labels:
Build,
CryptLib,
Jenkins,
PasswordLib,
PHP
Friday, July 6, 2012
The True Problem With PHP
There's been a lot of traffic lately about what's wrong with PHP, and counter posts about how good it is. I've even fallen into the fray in an earlier article trying to step up and defend the language. The problem with almost all of these posts is that they focus on the language itself and what's wrong (or right) with it. This is not one of those posts.
Labels:
Learning,
Open Source,
Open Standards,
PHP,
Rant
Wednesday, July 4, 2012
A Tale Of Open Source
As recently as 5 years ago, I barely understood the meaning of Open Source. I had been working with computers for my entire life (I was using a Commodore 64 before I could walk). I had been programming them nearly as long (I wrote my first program before I started grade school). I was an early adopter of Linux (I still have a Red Hat 1 disk somewhere). But I never guessed the impact that open source would have on my life. I never appreciated the impact that open source would have on the world. The past 5 years have changed me forever. This is my story.
Labels:
Open Source,
PHP,
Programming
Subscribe to:
Posts (Atom)