Greg Beech's Website

Browse by Tags

  • Code without comments is code that doesn't work

    The other week Jeff Atwood posted a blog entry named Coding Without Comments that stated... well I'm actually not sure. It started by making the valid point that comments should indicate why your code works the way it does and shouldn't be needed to explain what it does, but then went entirely off track and ended up pretty much stating that all comments are detrimental to code quality (emphasis...
    Filed under:
  • Not using negatives does not make your code less readable

    Most people find negative statements more difficult to comprehend than positive statements. You probably had to double-check the title of this entry to see if it made sense - I know I did! This isn't surprising if you think about it because a positive statements presents a concept which can be used directly, whereas a negative statement presents a concept and then says "the opposite of that"...
    Filed under: ,
  • Is product knowledge more important than coding ability?

    For as long as I can remember, if you needed a transactional and scalable data store, then you would buy a database such as SQL Server and implement your data store on top of that platform. There were already databases fully featured enough and reliable enough that they would likely meet your needs, and be far cheaper than trying to implement your own database. In addition, there was no maintenance...
  • Document your assumptions with Debug.Assert instead of comments

    From reviewing significant amounts of code over the last few years I have concluded that most people don't use Debug.Assert very much, if at all. I find this surprising because I use Debug.Assert a lot. Used prudently it can reduce bugs in code, make it more self documenting, and as an additional benefit you can even improve performance! When writing methods people frequently make assumptions,...
  • Often the obvious solution is the right one

    The rule "don't use exceptions for flow control" is one that should rarely be broken, partly because it makes the code much less readable, and partly because it will seriously compromise the performance of a solution. To give you an idea of the sort of impact exceptions can have, one website I tuned threw an exception if an item wasn't contained in its custom cache, which was often;...
  • Even good Hungarian notation is still bad

    I was bored this weekend so I ended up trawling through a bunch of blog archives and came across posts from some well respected people about why they believe Hungarian notation (in its originally intended form) is a good thing. There are entries from Eric Lippert , Joel Spolsky and Larry Osterman which essentially have the same point that originally Hungarian notation was intended to reflect the purpose...
    Filed under: ,
Copyright (C) Greg Beech. All rights reserved.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems