Monday 19 January 2009

Links to some great articles on programming

[caption id="attachment_410" align="alignleft" width="300" caption="Photo by Manel"][/caption]

The internet is full of smart people writing intelligently on how to write good software. Very few of these articles are from the perspective of a scientist (hence this blog!) but a lot of what they write is useful, interesting and, occasionally, entertaining. This post is of some of the best articles, posts and websites that have taught us what we know today.


Six ways to write more comprehensible code, by Jeff Vogel uses a game called 'Kill Bad Aliens' as a setting for his examples on writing better code. The code is C++ but the tips are nearly all applicable to any language. The only one I don't agree with is number 2: 'Use #define a lot. No, a LOT.' #defines are part of the C/C++ pre-processor macro language that replaces one string with another before the compiler is run. It allows the programmer to replace 'magic numbers' with more descriptive tokens without the overhead of creating constants. I agree that #defines are better than magic numbers but I believe most of those values should be loaded as data and not hard-coded into your program. This way, when (and it will be when and not if) you change your mind you only need to change the data files and not recompile your code. For something that needs as much tuning as a game having loaded, not compiled, data is very important as it allows quicker iterations which means more iterations in a given time and therefore more chance to get the best possible experience.

Bad names. Eric Lippert is one of the people who design the C# language at Microsoft. His blog can be deeply technical but it is always an interesting read. In this post he talks about bad variable/function/class names he has encountered in the C# compiler and what problems various names expose. For instance any name with 'Misc' in it is doing more than one thing which is 'a bad thingTM'. The comments have a few more chipped in by the peanut gallery.

Is it worth spending time on design? by Martin Fowler (the real name is DesignStaminaHypothesis but that name is a bit opaque). This post is about the hypothesis that there is a point below which spending time on design will actually slow you down but that this point is very difficult to judge and, in the authors opinion, is lower than people think. I like this post because it shows that very few things are set in stone and it references two related points (links are in the article): 1) Productivity of a programmer is very hard to measure and 2) the author introduces the concept of technical debt to describe the cost to a project of not planning. Technical Debt is a very powerful concept and can be applied to any time you cut corners to get something done sooners than if you had done it properly.

Holding a program in one's head by Paul Graham. An article about the psychological side of programming: avoid distractions, work in long stretches, etc. This article, I believe, will make more sense to the scientist-programmer than other programmers because, as a scientist, you are more used to holding a problem space in your head and trying to manipulate it to find a solution(s). The points in this article, when taken to heart, will improve the quality of your coding in a way that is completely different from purely technical improvements.

I hope you enjoy these posts and articles, they all shed light onto different areas of the craft we call programming. Please share your interesting links in the comments.
Reblog this post [with Zemanta]

11 comments:

  1. [...] Links to some great articles on programming Programming for Scientists (tags: programming) [...]

    ReplyDelete
  2. I like the collection, I have gone thru them and they are nice. Thanks for sharing

    ReplyDelete
  3. Thanks for posting these links to cool articles! :-)

    ReplyDelete
  4. http://www.paulgraham.com/head.html

    ReplyDelete
  5. I was excited to find this great site. I need to to thank you for ones time just
    for this wonderful read!! I definitely savored every part of it and i also have you bookmarked to check out new information on your
    blog.

    ReplyDelete
  6. whoah this blog is fantastic i really like reading your articles.

    Keep up the great work! You understand, a lot of individuals
    are looking round for this info, you could aid them greatly.

    ReplyDelete
  7. I do accept as true with all the ideas you've offered for your post. They are very convincing and will certainly work. Still, the posts are too brief for novices. May just you please lengthen them a bit from subsequent time? Thanks for the post.

    ReplyDelete
  8. Everything is very open with a clear clarification of the
    issues. It was really informative. Your site is useful.

    Many thanks for sharing!

    ReplyDelete
  9. It's very trouble-free to find out any matter on net as compared to books, as I found this paragraph at this site.

    ReplyDelete
  10. Masculine and virile, stainless steel jewelry
    (also known as inox jewelry) are now getting into the mainstream of men's fashion in many parts of the world.
    Lastly, stainless steel jewelry is very durable especially when compared with gold and silver.
    With so many natural sources out there that are incorporated into body
    jewelry makes these organic ranges the most interesting on the market yet.

    ReplyDelete
  11. I was very happy to find this site. I want to to thank you for ones
    time for this particularly fantastic read!! I definitely enjoyed every part of it and i also
    have you book marked to look at new information on your web site.

    ReplyDelete