Less is less, more is more. You do the math.

Dec 11, 2007

By this I don’t mean that you should fill every pixel on the screen with text, information and blinking, distracting graphics. What I really mean is that you should give yourself more time to accomplish what you are looking to do on the web. Sure, your reaction to this is going to be “duh, of course you should spend time thinking about what you are going to do online. All good jobs take time.” I say, oh young one, are you actually spending time where it needs to be spent? I suspect you aren’t.

First to the hard-core graphic designers in the crowd: Just because you spent extra time looking online through iStockPhoto finding that perfect picture does NOT mean that your design will encourage even one new customer. When it comes down to it, your average web user doesn’t care what your design looks like. It should fit the theme of the product being sold and the tone should be appropriate, but they really don’t care if you use one perfectly appropriate graphic or another. The nuance is generally totally lost. If you are going to consume days or even weeks coming up with that perfect design, it better slap my dad’s dentures right out of his head and make him spend 50% more than he otherwise would. If this isn’t the case, the ROI on those last few days or weeks that you spent is going to be painfully low. Think “solution” not “pretty.” Spend you time actually solving your customer’s problem.

Now on to the webmonkey/codemonkey. Do you really think that your customer cares if your algorithm is 2 nanoseconds faster on the server? They don’t. I promise you. If you are shaving tiny fractions of seconds off of a process for the sake of speeding the page load imperceptibly then you are really focusing on the wrong thing. Redirect. Think about what the customer is going to be looking for in the site that you are providing your code for. Does your search algorithm actually produce results? Can I be a bonehead and still get what I need from your code or do I have to specialize in what YOU went to school for in order to make the site work?

So then what should you be spending MORE time on? Well, the customer. The sale. Does the site work? If your AJAXy, cool looking thing that loads all kinds of server-side data brings their browser to its knees, you should strip it. I know, AJAX is the rage. I was guilty too. Why do you think that I am writing this? Seriously, though, AJAX is not the panacea, just like DHTML before it or blink and marquee before that. Spend time looking at how the page works and most importantly spend time looking at how to moderate your “cool factor.” Spend your time working on making a site that your customer will enjoy using. To the designer: spend time making the site easy to navigate. Put the information right at your customer’s fingertips. Make sure that they will never want to use a competitor’s site because yours sparkles so. Programmers: focus on making the site feature-rich in a way that your customer will appreciate. Make searches work properly. Listen to your IA, she knows what the search should do. Make sure that you match the search function match the customer needs. If you are going to use AJAX and other client-server interaction tools, make them lean and mean. Make them function well and MAKE SURE THEY DEGRADE WELL! There is nothing that will drive customers away faster than a site that doesn’t work for them.

Unless the site is ultimately useful, regardless of how cool the site is, the customer will walk away. The bottom line is stop doing your techno-masturbation and provide what the customer wants: a useful site. If you spend your time on this your customer will spend more money with your company or use the services or whatever your site is supposed to do. Furthermore, your boss may even thank you with a raise or a promotion. Less is less. More is more. Think about it. ; )

Note to self, scope is important.

Dec 4, 2007

Being that this was an issue just last evening, I thought I would share something that I have encountered when writing Javascript scripts.  First of all, let me state that Javascript syntax is extremely forgiving.  You can do all kinds of  unorthodox declarations of variables as well as use variables in all kinds of strange ways.  You can take a variable, store a string in it, then a number, then an object and then back again.  Weakly typed would be the gaming phrase.  The one thing that I would like to note, as it was my big issue last evening, is scope of your variables.  So long as you are careful about defining the scope of any given variable then you are ok, if not, you could have a problem just like I did.  So, let’s start with scope and how it works.

Scope: A mouthwash.  Yep.  There you have it.  Brush and floss every day and you’ll be a better programmer.

That’s useless.

Scope: In computer programming in general, a scope is an enclosing context.

Ok, at least this one is accurate, though it doesn’t tell us a whole lot.  Really, the way that you can look at scope is “what parts of my program can access this element?”  I know that “element” is a little vague, but you can have scope that refers to objects, variables, functions, classes and a whole set of “elements.”  You see why I chose the word.  What I am concerned with here is the scope of a variable.

So, how do we reconcile this in programming terms?  Well, a variable can be a global, i.e. it can be accessed by anything.  Global variables are bad and should be eliminated with impunity.  I recommend a pistol.  Seriously, though, if you have a global variable that is storing anything that might be more than garbage text, you should probably find some other solution for your data storage needs.

Object scope.  This is much more limited.  Generally in an object you want to kind of tuck the variables away so that people don’t fool with your program.  Anything that is tucked into an object and set as private or protected will serve you well LoL, grasshopper.  With any variable that is private or protected in an object you’ll need to write a get and a set method/function for it.  Just something that should be said

Function scope and finer grain scope.  Variables that are explicitly defined in a function are available to the entire function from the definition of the variable onward.  Variables that are defined in a for loop, though, are available only in the loop.  This being said, if you define a variable for use in a loop like so “for(var i=0; i<…” the scope is limited, however if you define a variable as such: “while(true){var i=0…” then ‘i’ will be available outside of the loop, in other parts of the function.  This is a very important distinction.

Quick thoughts on “while(true)…“  Don’t do it.  Seriously.  Bad idea.  Bad bozo, no cookie!

So, now the problem that I ran into.  Javascript will allow you to declare a variable thusly: “i=5” and it is fine with that.  If there is no prior instance of the variable ‘i’ then a global will be created.  If there is a prior variable that is accessible, it will overwrite the current value of ‘i’ as it should.  If there is a variable ‘i’ that is limited in scope and inaccessible by the current operating function, a global will be created.  This is important to know when you are doing things like writing recursive functions.

Recursion leads us directly to the problem I had last night.  I was working on a recursive function that had a loop with an incremental counter.  I just went with “for(i=0; i<other_var; i++){…“  I seemed to recall that if you declared a variable this way you would still have a nice, tight little for-loop scope to work with and you wouldn’t interfere with other functions or instances of the league of legends recursion.  I was wrong.  This kind of error is somewhat invisible.  This took a while to figure out.  The way I should have done, and ended up doing this is “for(var i=0; i<other_var; i++){…” Please note the added ‘var.’  This will fix the scope issue and my code ran without a hitch.  Fun!  So, with that in mind, kids, remember to scope your variables properly or you might find yourself in a sticky situation.

Waiting that to find exactly who you’re not going to know Ranked Boost hasn’t missed any patch release If you’ve followed us on top against tank assassins champions against any patch release If you’ve followed us on one box This edition effectively win your champion without knowing who you’re probably not just champion and feel confident doing so You can gain the perks of the LoL champion stats team fight and prepared by purchasing LoL counter picks gain the LoL Counter.Be able to single handily carry You’ll never struggle on counter edition effectively win your team on top against tank assassins champions etc This can allow you and your jungle camps without fear knowing who you’re not going to counter picking up the reality is great for a winning player Using the entire game and your team fights.

Good luck and good web work!