Posts tagged development
Alexa, Compete, and Other Educated Guesses
Dec 15th
Hey you! Yeah you, the one obsessing over your Alexa rank… you CEO, you “webmaster”, you marketing guy, you whomever you are…
STOP
Seriously… you people are driving me crazy with your Alexa rank whoring. It’s the same few things over and over and over again that I hear:
- WTF my traffic went up like eight fold and my Alexa ranking hasn’t changed!
- OMG my Alexa ranking dropped like four million places but my traffic is still the same!
And I always answer with the same reply… Who fucking cares?!
First off you need to understand that the Alexa number has no bearing on your business in the slightest. It is a reflection of your business… and a cloudy one at that. I know people that I swear would take a loss in traffic if it meant a gain on Alexa. Where are your priorities?!
Second you need to understand that It’s an educated guess as to how your site may or may not being doing based on a very very very very small sample size of the entire Internet. Do you even know a single person who has the Alexa Toolbar installed?
The last time I even HEARD of someone having the Alexa Toolbar installed I about punched them in the face for browsing my admin area (you know who you are) and having it prefollow all the delete links… luckily we did nightly backups.
Compete is even worse. I have a property that was closed down in 2007 and they show I peaked my traffic in January of 2009… need I say more?
What about Hitwise vs comScore vs Nielsen?
Save your fucking cash… These giants will bend you over backwards, upside down, and rail you un-lubed till you’re broken and bleeding. Ok that was a little strong but seriously… There are very few companies that should be subscribing to any of these services. Unless you’re in the SEO market (and I mean providing SEO to clients), online marketing, or another broad sweeping / far reaching online company, you DON’T NEED IT.
You would do better to focus on improving your business rather than comparing yourself against your competitors… the real kicker is you’re comparing educated guesses against other educated guesses about numbers that really don’t matter! If your competitor did 50% more sales than you are you going to know why from those numbers? No, you’re going to spend 200 hours looking at the numbers over and over again.
Nothing Else Matters
Instead, why not try looking at your competitors from the end user / customer’s point of view. What do they offer that I don’t? How easy is it for me to checkout / purchase on their site compared to mine? Then take an analytical top level approach to comparing your business. Where do they advertise? Where does their traffic come from? Do they have an affiliate program? One step further on the technical side you start asking… What is their page load time compared to mine? Where do they host? Do they use a CDN?
These are questions whose answers matter…
Don’t pay $30k – $50k a year for a service when you’re only interested in one market… hire someone full time to do nothing but run numbers for you. It would be the same cost in the end except you’d employ more people and if you really wanted you could have them install the Alexa tool bar to bump up your fucking rank… groan
/endrant
Smarty Templates… Get That Shit Out of My House
Dec 15th
If the title wasn’t strong enough for you, allow me to rephrase. Anyone that thinks Smarty is a good idea to implement should be shot in the face (or at least immediately removed from all developer responsibilities) because I’m tired of it junking up the tubes…
First of all there is absolutely NO reason anyone should use Smarty. The “Why Use It” page at Smarty says, “One of Smartys primary design goals is to facilitate the separation of application code from presentation.” That’s complete bullshit… there is no separation of application code from presentation with Smarty. In fact, in every implementation I’ve seen there is more logic mixed in with the templates than any other method… Including one template in a loop inside of another template is complete fail right off the bat and that’s the entire premise of Smarty.
Let’s break it down by their bullet points:
Designers can’t break application code. They can mess with the templates all they want, but the code stays intact. The code will be tighter, more secure and easier to maintain.
Look I’ve been doing this for 10 fucking years and I’ve never worked with designers that even break up their own designs (I know they exist) let alone dick around in templates… LET ALONE WHO KNOW TEMPLATING ENGINE LIKE SMARTY!
Errors in the templates are confined to the Smartys error handling routines, making them as simple and intuitive as possible for the designer.
OMG really? I can has ANOTHER error system to feed me where the problems supposedly are? Except this time it’ll be less robust and more cryptic?! And what happens when a developer removes an “assign” from the logic end? They get to yell at the designer to fix it? Who knows how to fix it anyway? The developer that doesn’t have to touch the template or the designer that doesn’t have to touch the logic? Some mythical breed of designer who not only knows Smarty but also knows PHP?!
With presentation on its own layer, designers can modify or completely redesign it from scratch, all without intervention from the programmer.
Oh you mean like designers do with regular XHTML/CSS in every other system? You know… by separating out your controllers from your view using… OMG… PHP?!
Programmers aren’t messing with templates. They can go about maintaining the application code, changing the way content is acquired, making new business rules, etc. without disturbing the presentation layer.
See the part above where this is accomplished by… PHP!
Templates are a close representation of what the final output will be, which is an intuitive approach. Designers don’t care how the content got to the template. If you have extraneous data in the template such as an SQL statement, this opens the risk of breaking application code by accidental deletion or alteration by the designer.
Here we see why Smarty is so fail… They put SQL statements in their templates before they created Smarty?! Way to be MVC guys! Which, I’m guessing, is what they’re trying to be with the Smary system itself? So essentially we had some people that didn’t know the first thing about the MVC design pattern up and decide to design a templating engine for PHP that would be more MVC like… awesome.
You are not opening your server to the execution of arbitrary PHP code. Smarty has many security features built in so designers won’t breach security, whether intentional or accidental. They can only do what they are confined to in the templates.
LOL, what?! Your designers don’t have access to all the files in the dev environment? and you don’t version control your source? and all your designers know how to code as well?! Look if your company / team falls into the three categories above there is no way a templating engine for PHP is going to solve your problems… it’ll just complicate things.
What have you accomplished?
So essentially what you accomplished by using Smarty is to do something which you already could have done using only PHP and that is inherently done in good MVC code. Except this time you get to load an entire templating engine… and here’s my favorite part. You get to load every single template into memory and then parse through all of it to look for special tags! And then when you find the special tags you need to perform their actions whether it’s printing a value, running some pseudo-PHP code contained in the template, or my personal favorite… loading another fucking template!!!
The first time I see a conditional to determine what additional template should be used (if any, ugh) inside a Smarty template I want to smash the developer that wrote it IN THE FACE!
Summary
Here’s the short version… By using Smarty you incur massive amounts of overhead by having to read every template into memory and parse through them all looking for special tags. You also introduce an additional pseudo language requiring developers and designers to know this additional language while making your code base less readable by anyone other than who wrote it. You increase development time for all projects because you now have to use extra methods, variables, etc… and you are completely dependent on another system for your code base to work…
For all of these negative aspects what do you get?! A code base which is less scalable and less readable… congratulations, you built a better mousetrap.
