fgets() replacement

D

Dan Pop

In said:
1. If one or more functions already available will do the job then
use those functions. As Hippocrates said: "Art is long, life short,
experience treacherous, judgement difficult... ." Sorry, I have
forgotten the full quotation.

2. When writing general purpose functions, design it so that it
does the minimum possible extent of work. The simpler the function
the wider will be its use. The principle to remember is: "if it
is not necessary for a funtion to do something then it is necessary
that the function does not do that thing."

None of these applies here.

1. There is no standard function (or functions that simply combined)
that does the job.

2. We're talking about a function with a very specific purpose. The hard
part is not the implementation, but the design. That's why most
programmers prefer to design it themselves, rather than use some else's
design. I don't like any of the designs I've seen until now, so if I
needed such a function, I'd certainly implement my own design...

Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top