[Ilugc] [TIP] C language code to download file using HTTP

  • From: girishvenkatachalam@xxxxxxxxx (Girish Venkatachalam)
  • Date: Wed, 16 Nov 2011 09:17:58 +0530

On Wed, Nov 16, 2011 at 8:27 AM, Shakthi Kannan <shakthimaan at gmail.com> 
wrote:

Answering to your reply on dl() function not being too long. It is not
just that. It is a question of being modular.

Tomorrow, if I want to change the way I connect or download, I only
need to change the function that does that rather than the dl()
function. In fact, one can have multiple functions for different types
of connections, and let the user choose based on options
(static/dynamic). A function must do one job and do it well. This
allows the design to scale, rather than having to maintain multiple
versions of the dl() function.

Write programs that do one thing and do it well ~ Douglas McIlroy

Of course, this is a trivial example for demonstration, but, good
habits start early.

Okay man. Please send your version. People can choose what they want.

I am going to send the same thing in perl and python on subsequent days.

I will also try to do it using lua with the luasocket library.

We can't do this with shell scripts.

-Girish

-- 
G3 Tech
Networking appliance company
web: http://g3tech.in ?mail: girish at g3tech.in

Other related posts: