» tagged pages
» logout

(Feed found, click Add Page to syndicate.) Error finding feed, please try again » Find feed title

A Blog Page allows you to add entries, for news or other time sensitive postings

(Login required to save to your tagged pages.)
(or Cancel)

Make further edits, (or Cancel)

(Login required to save to your tagged pages.)
(or Cancel)

(Editing anonymously: to be credited for your changes, login or register a new account)

Change Page Permissions? Changing these permissions will adjust who can modify this page.

Anonymous (change)
(change)
(or Cancel)
Upload an image from your computer:
or Copy an image from a URL:
or Erase the current icon:
Icon Preview:

or Cancel

Erase essays? The contents of essays page and all pages directly attached to essays will be erased.

or Cancel

(Editing anonymously: to be credited for your changes, login or register a new account)

other page actions:
essays

essays

sorted by: recent | see : popular
Content Tagged essays

Editing service

first-class paper redactors provide service here

FOSS Sin: Pointless Duplication of Effort | Fred Trotter

Detailed explanation of why two open source efforts working on the same thing is a pointless duplication of effort, and how to tell the difference between pointless and pointful parallel efforts. Uses FOSS electronic health/medical record software as exa

open-source: del.icio.us tag/open-source

When duplication is not duplication

I was looking through some C code today, and stumbled across this lovely little gem:

1
2
3
4
5
tmp = "\"#";
while (*tmp) {
  FD_SET(*tmp, url_encode_map);
  tmp++;
}

Now, be honest. I don’t care how good you are at C, it takes you a few brain cycles to process that and figure out that it is just setting two bits in a bit field. It really should have been written like this:

1
2
FD_SET('"', url_encode_map);
FD_SET('#', url_encode_map);

This raises the question: why wasn’t it? I’ll tell you why:

Programmers have this burning desire to avoid code duplication. We’re taught, almost since the cradle, to abhor duplicated code and to avoid it all cost. Duplicating code is evil, it leads to unmaintainable code, and propogates bugs. Never, ever, do it!!!

Allow me to let you in on a little secret.

Calling the same function twice is NOT duplicating code. Not if the arguments change between calls.

Even calling the same function three times in a row is kosher. Four times, even. At some point, you might want to consider a loop, if the arguments can be determined functionally, but only do so when the list of similar function calls is harder to read and understand than the loop is. This is often when the loop takes fewer lines of code than the function calls do:

1
2
3
4
for (i = 127; i < 256; i++) {
  FD_SET(i, hdr_encode_map);
  FD_SET(i, url_encode_map);
}

There. Had to get that off my chest. Now, back to work.

Capistrano: the { buckblogs :here } - Home

custom term paper editing

http://customwritingservices.org/custom-term-paper.php

Buy custom writing

http://buy-custom-essay.org/essay-writing.php

research papers topics

http://iresearchpapers.com/how-to-write-a-research-paper.html

Page 1 | Next >>
Username:
Password:
(or Cancel)