6 ways to piss off a coder

A list of six things which can really annoy coders. This was posted on Sunday, September 2nd, 2007 and is filed under Web dev. You can follow any responses to this entry through the RSS 2.0 feed. You are also welcome to trackback from your own site.

Nobody’s perfect and as a web designer/coder myself I don’t claim to be a professional or anything close to that. But there has been a few times where people have given me code to work on or to look over and there have been some really annoying things which are easily avoidable.

So here is just a small list of some of the things which can quite easily annoy a coder and have annoyed me in the past on many occasions.

  1. 1,000+ lines of un-commented code
    - Im sure this is quite a common issue and most probably almost every coder will come across it at some stage. Too often have I been involved in scripts which have consisted of hundreds, sometimes thousands, of lines of code without a single comment to explain what it does. This usually tends to be the case when the original creator no longer works or supports the script and has therefore left it for someone else to take on. Because he/she was the original creator and did not pass on any hand-written notes he/she may have had (if any) then he/she is the only person who knows what the heck the code is doing. Yes it is possible to figure it all out but that can take hours and hours depending on the size/complexity of the script.
  2. Too many comments
    - Having no comments at all is annoying but then there is the complete opposite of it. There are a huge number of PHP tutorials out there for beginners and I bet that a majority of them recommend that the user makes use of comments in their code. But unfortunately sometimes the coder takes this bit of advice too far. In case you don’t know what I’m talking about there is absolutely no need to write a comment for every single line of PHP code. We already know what echo does so theres no need to explain it! Show example
  3. Really long comments
    - Again touching on the whole comments issue. Lets say there is a function called register_user(). Now this functions primary use (well… only use) is to take the supplied array of data and then insert it into a database. But such a simple function is often explained as something much more complex. There is no need to explain every single item in the supplied array - as long as the person reading the code understands what the function is doing that’s all that really matters. Show example
  4. Re-inventing the wheel
    - If you are a PHP coder yourself I’m sure you know of the include() function. This simple little function does nothing more than include another files content - so why are there people out there who try to complicate this process? Now I understand that if you are using some obscure method of error control then you may want to have further control over your functions but there is no need to create another function called include_file() which then just uses include(). Those pre-defined functions are there for a reason! Show example
  5. Procedural code
    - Now different coders will have different views on this. Personally I prefer working with object oriented code not only because it is cleaner and easier to maintain but it is also easier to understand (I think so anyway) when looking at it in a large script. If you are developing a script which is of a considerable size or if it spans over a number of different files I highly suggest going the object oriented route. It is extremely annoying to have to go through hundreds, sometimes thousands of lines of code and replace multiple instances of the same thing throughout the script. This can be easily avoided with good use of an object oriented approach to coding.
  6. Sudden change of plan
    - This is perhaps aimed at the client or the person who has asked the coder to write the script. After a coder has spent a week or so writing a couple thousand lines of code it is not a good idea to then suddenly say to him/her that you want to do something different. Now depending on what it is it may not be a lot of work to make the switch to the new requirements but this isn’t always the case. If you’ve asked for a system which allows users to upload and manage images - don’t suddenly say that you want it to upload and manage videos instead. If the coder is being paid he/she will more than likely act as if it isn’t that much of a problem but inside would like to just scream at you.

Obviously there are a lot more reasons than just the 6 above but I think they are some of the most common.

15 comments

  1. PissedOff Grammarian Says:

    It’s “object oriented” not “object orientated”

    :)

  2. Anne-Marie Says:

    Interesting to hear a developers ideas of what really pisses them off…I was expecting to see a comment about smug testers. Nice work!

  3. jonathan doklovic Says:

    As for number 6, you should embrace change.
    All agile development methods include this principle.
    It is not unheard of and should be welcomed that someone asks to add video functionality to an asset management tool.

    If you architect and code the app properly, this should be a very simple change, as the mechanics of the management app should be decoupled from the datatypes and only include type specific code when really needed.

  4. Michael Morgan Says:

    Thanks for that, PissedOffGrammarian :P

  5. Cesare Says:

    Would add no coffee machine working :)

  6. ferdhie Says:

    Point 5. With PHP pass by value style, I’ll stick to procedural code anyway. OO in PHP, especially PHP5 is not compatible with PHP4 OO style.

    Anyway, nice articles.

  7. sas171 Says:

    1 way to piss off a reader: wrong links

  8. Michael Morgan Says:

    <blockquote>Would add no coffee machine working</blockquote>

    If I liked coffee I would agree - I see your point though :p

  9. David Karr Says:

    My thoughts about code and comments is that code blocks should generally be free of comments, and code should be written to be clear, well-formatted, understandable, and self-documenting. When something is done in the code that is clearly obtuse, and there’s no other alternative, a comment before the code block should explain the obtuseness. In addition, a block comment before the method and class should explain the purpose of the method or class, and anything another developer needs to know. Comments intended for public javadocs should be separate from “internal” comments. Users of an API need to know different things than people maintaining the code.

    The best thing you can do to make a block of code understandable is to facilitate seeing the entire block in a single page on the screen. Comments, unfortunately, get in the way of this goal. It may seem counterintuitive to avoid comments, but if you focus on the goal of making the code understandable, instead of the comments, you’ll realize when comments are appropriate and when they are in appropriate.

  10. Infernoz Says:

    1. Charge for this like a fresh project, because you will probably have to rewrite it from scratch.

    2, 3 and 4. You must have some morons there, why are you there?

    5. Agreed. [ferdhie] you idiot, get into the 21st century already, OOP makes code MUCH more manageable!

    6. Get used to it, allow for change, many people are fickle and confused, but makes damn sure you have an approved prior specification, so that you have the option to charge them extra for any changes :)

    Anyone who uses the label coder shows their amateurishness, if you want to bitch like this first learn some professionalism, learn to tolerate some customer stupidity, however still have some standards about who you work for, I assume you are getting paid well to put up with this!

    Professionals often start as programmers then may call themselves developers, because they often do a lot more than just programming e.g. analysis, architecture, design, testing, releases, diagnostics and maintenance; companies often call these people Analyst Programmers or even Developers e.g. the implementation can be only 30% of my time, the rest of the time is often spent on a mix of design, testing, debugging and release preparation.

  11. Harishankar Says:

    variable names with no meaning. Like x1, xx1, xa1, xb2. :) this pisses me off often.

  12. doug livesey Says:

    > When something is done in the code that is clearly obtuse…

    Isn’t there something of a contradiction there…?

  13. Nuvo Says:

    variable names with no meaning. Like x1, xx1, xa1, xb2. :) this pisses me off often.

    I’ve had this problem myself.
    It’s not hard to type something descriptive like ‘name’ or ‘url’ and it’s easier to remember what a descriptive variable is for if you need to go back to your code in the future.
    Variables like ‘i’ and ’s’ are acceptable when used properly (as temporary variables for things like for loops) and even then, they are descriptive to some degree (Integer and String data types).

    I always use descriptive variable names as it means I have to use less comments as I can make my code more readable.

  14. Michael Morgan Says:

    Although it’s quite common to use variables like ‘i’ and ’s’ for loops or to store temporary data I very rarely use them, if ever…

    For loops if I need to create a new temporary variable I usually name it after whatever it is looping (and add ‘_loop’ to the end of it). But then I always destroy temporary variables once I’m done with them.

  15. Olkenava » 6 ways to piss off a coder Says:

    […] read more | digg story […]

Leave a reply

Bookmark on digg
Bookmark on del.icio.us
Archives
Related Posts
Links
        RSS Feed