How to be a better programmer - Part 1

feature photo

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

I thought I would re-start my blogging (apologies for the major lapse!) endeavors by covering how to become a better programmer. This will be split into a number of parts as there is a lot to cover! The first part is me feelings about ‘How to be open’ - this covers a range of things but is really about a programmers attitude. I would love to hear back if you feel you are a ‘open’ programmer or not.

How to be Open

In my very first programming job at a games company I was most definitely what I would term a ‘complete git’. Totally arrogant about my abilities and not very receptive to others opinions or new ways of doing things.

When I moved into management I found (with much pain) you cannot have that attitude (unless you really want to be hated) and to move a project forward you need a fine balance between listening to the group and also enforcing a single vision upon a project to achieve a final goal.

I have since alternated between fully management roles and combinations of management and programming. And the attitude change I found had dramatic effects on how I programmed as well.

This meant that now I am a much more ready to look beyond my own solutions . This often means trawling for alternatives on the net which in a large percentage of cases ends with finding someone else’s solution which although on the surface looks solid always has some fundamental flaw that means I re-write it. But in doing so I have already (hopefully) learnt from mistakes already made.

In broader subject matter such as frameworks depending on your choice of language (PHP for me) there are always alternatives. I am a great believer in not ‘re-inventing the wheel’ and now encourage in others to get out of the habit of thinking ‘I can make a better what-ever-it-is’ - this does go especially for frameworks and for programmers who have only worked in small teams, I have lost track of the number of interviews in which someone has stated that they have written their own ajax controller / php framework - and then have no real justification for not using something pre-built.

The bottom line is that there is always someone smarter out there in a particular field and it is wise to take advantage of their experience.

Feedback

So are you an arrogant programmer? what routes to you take before starting any large bit of programming? What is your relationship with your fellow programmers?

There Are 11 Responses So Far. »

  1. I agree with everything you just said. I’m a PHP dev and I’ve recently begun to expand my horizons in Python and Ruby. I find it a little annoying to run into developers that have a chip on their shoulder and think that their language or solution is superior to whatever else is out there.

    I’ve also been working on making sure I don’t have that ‘I can make a better what-ever-it-is’ mentality. It can be quite difficult at first.

  2. I keep seeing this advice around the PHP community about not reinventing the wheel. I guess what we have is the best it could be and you’ll never be as good a developer a John Smith with Foo PHP Framework, huh?

    Seriously, the more people creating PHP frameworks the better. More ideas will be presented, different approaches to problems will be discovered, and so on. Heck, if it wasn’t for DHH bucking the convention then 3/4 of the web development frameworks we see now would not exist.

    Stop believing what the “enterprise” PHP developers tell you about Zend and PEAR being the best stuff possible. Find out what could be done better and do it. Granted, it takes a certain amount of time, effort and determination to do this, but it will benefit your own (professional) development and those around you (if you open-source it).

  3. I also agree with you on the part about being open(open minded) thats the only way a person can fully evolve as a programmer,

    But I am still not sure about the re-inventing the wheel argument….to be honest I use to be a fan of the slogan(do not re-invent the wheel ) until you are stuck with some huge framework that is filled with bugs and you have no idea where to start debugging since you don’t understand the core(low level) functionality of the framework….

    To conclude, I’m not saying you should waste precious time by writing your own framework but if time is not precious and you are also in the process of transforming yourself to better programmer then writing your own framework might not be such a bad idea…..(you will learn a lot from it….)

  4. No matter how good you are, there’s always someone smarter. Even if it’s you, one or two years later. I’ve never seen a piece of code written by me two or three years previously without thinking “Hey, I could have made this more modular, or easier to understand, or more extensible”. There’s always room for improvement.

    I would update the phrase to “Don’t reinvent the wheel… unless you need to”. Otherwise cars would still use wooden wheels ;D

  5. I work at a company doing PHP work for 4 years. I started here, and I am the Senior programmer. I never have personally met or learned PHP from anyone who was better than me. I wish I would have.

    My education had a small course in ASP, and I quickly moved to self teaching myself PHP months before I graduated.

    My programming methods reflect me completely. The way I solve problems and work on my projects. There is a junior programmer under me, but he started out with absolutely no experience, so what he knows, I’ve taught him.

    Frameworks. I don’t even know what frameworks are. I’m guessing they are a collection of methods and/or functions that do things easier. Just 2 years ago I fully learned the benefits of functions and now almost any site we do has a full compliment of PHP functions to do the work.

    I also developed a CMS from scratch that is one of our main products. As needs came around, I added new modules and features to it. Everytime we do a new site, it’s the lastest CMS with new features built in. If it’s a great feature, we might roll it back into older sites. At the very least, the CMS is not bloated as I take an organized approach to my programming.

    I’ve learned that it’s not worth thinking your the best. I’m good, and I do work fast, but I’ll never be the best. Besides strong knowledge of PHP, MYSQL, CSS, HTML, and JAVASCRIPT, I doubt I’ll fully learn another language unless PHP dies off.

    AJAX, I’ve done that too. I’ve always wanted to load content into HTML pages since I made my first .htm page 11 years ago. I don’t load XML though, I use it to load PHP pages and to process some requests.

    As for pre-built. I feel that it’s like learning a whole new program. There will be 100 features that I will not need, and I won’t have complete control over the output like I can have with my own programming. I use TinyMCE, phpThumb, and other small libraries of code to get my work done. But I’ve never used a framework.

    And I’ve never found a great reason to make a PHP class. Please, someone, convince me!

  6. Great article Nick. Looking forward to part 2. Humility is a great attribute in a programmer IMO. Several years ago I found the following article, and I re-read it every year or so just because it resonates so deeply with me.

    http://blogoscoped.com/archive/2005-08-24-n14.html

    Clint, I would encourage you to try a framework on a small upcoming project. It may not be for you, but at least then you’ll KNOW that instead of just thinking it. My personal favorite framework is Prado (www.pradosoft.com). As far as php classes go, I cannot recommend this book enough: “Head First Design Patterns”. It is written for JAVA, but the ideas and concepts can be easily ported to PHP. This book will make it very clear to you what you are missing with classes/objects.

  7. Have a look at the Zend Framework…I have recently discovered Zend_Layout portion of the framework and from a maintenance point of view this looks to be a Godsend. Solutions to problems that I experience in projects all the time (like having to include include files in every page for template system) are solved all of the time by these frameworks…and that’s what I love, being able to get things done quickly and in a way that can be maintained easily.

    If you haven’t already I would urge you to try out a framework.

  8. Great you’re blogging again! I am just like you also a manager + programmer. I am leading a team of 10 developers. You’re adressing excactly those issues I have to deal with in my everyday manager/programmer life.

  9. Good article. What you think about Zend certification? Can it help for PHP develpers to improve programming?

  10. very good article nick. looking forward to part 2. i’m interested in the answer to the question from ryu :)

  11. frameworks have nothing to do with being “open”. It comes down to saving time. Frameworks are what we call “big wheels” waiting to be replaced by the next big thing. Use frameworks when you either can’t do anything better or you have limited time. It comes down to who has the better “software” not who has the better “framework”.

Post a Response