Wednesday, June 23, 2004

Think Longterm

One of the things that is hard to grasp as a newbie, is the importance of thinking longterm.

Because it takes a while to understand the importance of:

1. Commenting
2. Planning
3. Project Management
4. Error Proofing
5. Testing

There is probably more to the list, but most newbies, think if the app works, that's all that matters.

And I was the exact same way, give me a goal, and I couldn't wait to code.

But then begin the painful lessons:

1. This isn't exactly what I had asked for.
2. I have to change something in your code.
3. I get too many errors on this app, did you error proof it?
4. This application, 1 out of 100 gets the job done, what's happening 99% of the other times? Did you test it?

The reason why, I and other classicists/old schoolers/purists emphasize these things so much, is because you are dead on aiming for a hungry bull just ready to rip you to pieces.

We all make mistakes, and that's okay as long as we learn from them.

And to help you prevent them from the long haul, you need to take a different approach to your coding.

Take pride in your work, knowing that it is going to do it's thing for a long time 5-20 years, who knows??

However then make sure the app/project will last that long by following the methods that help make sure you get there.

Let's briefly go over these top-notch methods:

1. Commenting, Elyse over at Anticlue has a nice article on commenting, here

But simply said, commenting can be simple or complex, but the more details you put in there, the easier it will be to fix/repair in the future.

Which is the whole purpose, put in the details now, to make it easy for you later.

Also it's much more important, if people besides yourself are going to look at your code. Take pride in your code, make it look nice, neat and indented.

2. Planning, I can't say enough about planning. Planning is both the skills you develop to architech the project/app, but it's also making sure you have a clear/written and documented vision of your project.

3. Project Managmeent, it sounds like a pain in the ass, but really it's godsend. Because this prevents communication mistakes.

I don't know how many times, it's happened to me, where I thought I knew exactly what the client/customer/boss wanted for the project, only when I started coding, they said, "What the heck is this? This isn't what I wanted?"

Isn't that a pain???

So learn from this, use a simple-to-complex project management system to prevent communication mistakes, as well as not wasting anyones time until everyone knows what everyone else wants and will get done.

4. Error-Proofing, this is one of my concepts, if someone else came up with it before me, I apologize. Error Proofing simply means preparing your code to handle any possible error.

This means what copy/app changes you want to happen based on what kind of error.

Also this can mean some cool looking error reporting, Qforms has some interesting ideas on form error handling.

Also it means, knowing your incoming data, protecting your datatypes. If your app depends on results from a query, what if you get no data one time? How does your app handle it?

5. Testing, this is one the that my current boss is a master of. You give him an app, and he will break it into smithereens. :)

Which is both funny and a good thing, because it takes a lot of work to do testing, and prepare your code.

You gotta lose your ego, come up with a testing system, that always changes and evolves, and make sure your code is really PERFECT, before it gets public.

That's all for now.

Remember think longterm, do you really want to have to fix some crappy app, you did 2-3 years ago, but was written so horribly no english person can read it?

I don't think so.


  1. Anonymous8:06 PM

    yet you denounce frameworks...

  2. Yet I denounce nothing, except blindly following frameworks.

    Each has some good and some bad.

    I see, if i don't happen to follow a fad, I must be a nut, and therefore disregard whatever I say.

  3. Anonymous12:09 AM

    Actually Craig, you've denounced frameworks for:
    1) Having poor performance (q:"I really need thos extra milliseconds")
    2) Having poor usability (?)
    3) Being a fad
    4) Being 'illogical' (q:"why try to make our brains think other than the way they're meant to think")

    For your skills to progress you need to be more open in the way that you think about computer programming and the challenges that it brings.

    If you're passionate about becoming a better programmer then I suggest having a read of:
    - The Practice of Programming - Kernighan and Pike
    - The Mythical Man-Month - Brooks
    - The Art of Computer Programming Trilogy - Knuth
    - The Psychology of Computer Programming - Weinberg

    Your quotes were taken from:

    -- tim lucas

  4. To be precise, i denounced certain frameworks for using the customtags, cfmodules, cfcs, cffunctions, and others ways to reuse code instead of the more efficient way, called a cfinclude.

    fusebox, at least the version I am familiar with is hard to see, because each application is not a seperate page or url, other than a different url variable, which is bad for usability.

    The apps can be fine in terms of functionality, I just don't approve of the urls, and I don't like using less efficient includes.

  5. In addition, I have heard more and more adaptation to frameworks, not because they are good or bad, but because it is popular or it is the in or fad thing to do.

    I disapprove strongly of basing my decisions based on popularity or fads.

    I prefer to refer on whatever the most efficient way is.