Thousands of mistakes

One of the kids (smurflings?) was moaning that he can’t do a decent bunny hop on his bike. And its true he can’t.

bunny hop

But I pointed out to him that he has to do 100’s or 1,000’s of poor ones before he’ll be able to do a good one. I’ve done thousands and I can get about a foot off the ground (300mm for the metric folks, 12 inches for anyone who doesn’t use feet). The top riders can do about 3 feet I think, which is high enough to get over most railings in style (rather than pain).

I think its similar in software dev. You have to write loads of crappy apps before you write good ones. There is an alternative argument that practicing moves badly will only make you good at doing them badly. I think for most switched on devs, the mistakes you made become apparent as time goes on. And mistakes others made show themselves when you have to maintain their mess.

When I look back at some of the code I have released in the past I think I have learned tons. I can write more code in an hour now than I could in a few days years ago. And it will have better functionality, better reliability and be easier to extend, test and maintain.

I’d say a lot of that improvement is down to a process of eliminating all the approaches that did not work well (alright, most of those bad approaches then). I guess more specifically its about finding what doesn’t work and replacing it with something that does.

But where are the best places to find proven approaches to replace your old broken ways?

The Excel developer books are good, the Excel-l newsgroup is superb, Google can often help, experience is a good teacher too. Any others? I sometimes feel the resources at the higher end of development are a bit lacking for Excel/VBA. (And something tells me that MS are not going to ever invest in this area).

Asking fellow devs would be ideal, but its so rare to get get more than 1 Excel/VBA dev in an org at any one time.

In mainstream s/w dev its common to start out maintaining other peoples code – I think this is a great way to learn what to do and what to avoid. In Excel/VBA though in my experience most work seems to be new build. Do you find that?

Cheers

Simon

Advertisements

12 Responses to “Thousands of mistakes”

  1. Paul C Says:

    Hi Simon, long time no speak!
    I think this is a good point especially on the maintenance side of things. I wonder if maintenance opportunities are thin on the ground due to bad design (ie maintainability becomes such a nightmare its easier to start from scratch). Have certainly found this in my experience.

    I think a great way of learning is by having a pool of developers that can bounce ideas/experience off each other – as you say its getting rarer these days to find the devs….

  2. Simon Says:

    Hi Paul (I’ll email you)
    And if you do get a couple of devs in, they probably won’t talk to each other hey? ;-).
    Yeah I think you’re right on the design point, and it seems so accepted by management. ‘We have something that sort of works, but you might as well start again’

  3. MikeC Says:

    Morning Simon,
    Definitely agree with you on this one. I cringe when I look back at some of my earliest attempts.

    The key to the difference between writing loads of crap and improving as you go against writing loads of crap and just getting faster at writing crap is focussing on improving your technique and being open to ideas, as well as “attempting the impossible”. The times I have learned most (and thus improved the most) is when someone has asked for something I simply didn’t know how to do at the time of asking.

    Looking back at earlier (crappier) code is also kinda inspiring for me. It makes me realise I’ve improved. It makes me want to go back and re-write things. And the more I do this, the happier I am with it. I don’t doubt for one moment, because I’m intermediate-level (at best!) in Excel, that I could come back in 6-12 months to things I’m writing now and have the “What was I THINKING???” epiphany as I do.

    I actually like this in a lot of ways. I prefer to be continually improving and getting better as I go, and dread the day when I can look back at something I wrote 6 months previously and not be able to see any way to improve it!

    (PS I can’t do a decent bunny hop either…)

  4. Marcus Says:

    Hi Simon,

    Having to maintain someone else’s – or even worse – your own work is a good teacher. Also good is working with some one else’s suburb code – especially when you get one of those ‘hey, that’s a good idea, I never thought of that’.

    The worst teacher is mediocre stuff you’ve written that you haven’t had to maintain or the it never broke (due to luck or circumstance). This is a problem because, being the creatures of habit we all are, you tend to continue using the same approach. You’ve now lost the opportunity to explore a better way.

    I’ve also found pair programming good even though I’ve only been involved in a couple of projects like this. You get to witness some one else thought patterns (good and bad). You also need to be able to justify the approach you’ve taken whether it’s an architectural decision or simply coding style.

    Cheers – Marcus

  5. Marcus Says:

    “some one else’s suburb code”

    Sorry that should be superb code.

  6. Jon Peltier Says:

    Simon –

    Two interesting thoughts:

    “And mistakes others made show themselves when you have to maintain their mess.”

    “In Excel/VBA though in my experience most work seems to be new build.”

    In my experience, it’s often far easier to start something from scratch, rebuilding existing functionality along the way, than to maintain an existing project while trying to add features in a way that’s compatible with what you inherited. In the many projects which I took what was given me and accreted new features, I always got to a point where I wished I’d followed my better judgment and started fresh. It may take longer to rebuild it from scratch (then again, maybe not), but what I build from scratch is going to be easier to maintain, debug, upgrade, and expand.

  7. Simon Says:

    Jon
    I’ve had that sense of impending doom too. I offer 2 levels really – micro changes, where I just fix the smallest thing possible to keep their monster going, and offer v limited testing and ongoing support. And full rewrite with all the good stuff you mention.
    I don’t mind which, but I hate getting caught out in the middle somewhere.

    Marcus, I always wanted to work with other VBA devs to learn and share, then when I did recently, 2 of them wouldn’t talk to each other. Kind of made the informal code reviews a bit awkward.

    Mike good point of writing crap faster, and on looking back with improvements.
    I’ve got my eye on some major bunny hop improvements. I know the theory, I just cant get all my arms and legs doing the right thing at the right time. (like my typing)

  8. Jon Peltier Says:

    One of the best learning opportunities is when you have to upgrade your own code. This teaches you how to program in a modular fashion, it encourages concepts that also support code reusability. It gets you to think about programming with upgrades in mind (like don’t have an arbitrary array size limit, especially a limit that’s hard-coded in 17 places in the project).

    Another opportunity is when you are sitting with a client saying, sure, I can do that. Then you go back to the office and search Google and try various stuff until finally, at 2:45 am, you find you really can do that.

  9. MikeC Says:

    Jon – your second paragraph describes my first 2 years working within Excel…! And your first para describes one of the biggest mistakes I used to make when I first started programming – a lesson I learned the hard way! =:-)

  10. Biggus Dickus Says:

    “But where are the best places to find proven approaches to replace your old broken ways?”

    Doin’ it !! To me doing Macro languages means three parts:

    1. Business Process (usually f’d up)
    2. The application (how to use the features of the base program)
    3. Coding the macro

    Doing good “solutions” means getting the grasp on all three and the first one is constantly changing.

    So on the ‘code’ side I develop techniques in the application (be it Excel or Access) that I can resuse. Reuse of techniques (I don’t have a “code library” except in my head) allows me to reliably and quickly punch out the necessary code to perform some function in my app.

    I haven’t seen very many useful on-line or book resources that have helped me over the years – and it’s mainly because the people who write the books can’t possibly be really DOING code in application at the same time. I find I have to filter through a whole lotta useless extra crap to find what I REALLY need in sample code I find – I don’t know why that is.

    My job is not to create “beautiful” code but rather to get the job done in the shortest time – to keep the costs down for the client and to justify me getting paid adequately for each hour I spend on it. My job is to create a set of techniques I can use and reuse like a permanently changing jigsaw puzzle in each app. Using the same techniques also allows me to easier revisit existing apps when the client INEVITABLY comes back and says – “Can we do THIS now? ….” Ouch!

    On the maintenance issue I almost always shoot existing apps by other people and rewrite them MY WAY from scratch. In the end it produces a better result and it is always cheaper in the long run. I have turned down several “maintenance” projects because I didn’t want to end up responsible for supporting and justifying someone else’s bad design…

    dick

  11. Simon Says:

    Jon, It seems there are a few of us chancers around!
    Dick, yep coding is about the best (only?) way to learn to code. Agreed on the book issue, we got burnt following ASP book code one time. I’ve a post coming up about books.
    I think I’m going to push more to re-write stuff rather than add ugly patch on ugly patch.

  12. Jon Peltier Says:

    Mike –

    Yep, my first year or so was full of late night experiments. Now I can go to my code library and extract what I need.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: