Page 2 of 2

Re:Strange One

Posted: Fri Apr 08, 2005 5:40 am
by DevL
beyond infinity wrote: I've done it a dozen times due to scanf not being as good to use as expected.
(My highlitning).

Couldn't resist this: code reusability anyone? :)

Re:Strange One

Posted: Fri Apr 08, 2005 5:44 am
by distantvoices
*rofl* you write something in an exaggerated way and bet someone traps in and takes the opportunity to nitpick about it and sure you win.

you're welcome, dev'l (devil anyone?). Of course I've got a code library of my own with all this stuff. One does this sooner or later: collecting often used stuff. *chuckle*

Re:Strange One

Posted: Sun Apr 10, 2005 10:07 am
by DevL
beyond infinity wrote: *rofl* you write something in an exaggerated way and bet someone traps in and takes the opportunity to nitpick about it and sure you win.

you're welcome, dev'l (devil anyone?). Of course I've got a code library of my own with all this stuff. One does this sooner or later: collecting often used stuff. *chuckle*
Easy, no need to be on your toes. I was merely jesting. But for the sake of the argument, let's put it another way.

I prefer to have a generic, proven function over altering a "template" (not in the C++ sense) as each and every alteration can have subtle caveats and bugs sneak in.

Now, a code library is good to have, a code library with generic functions is IMHO even better.

So, instead of using function X (which most would think is bloated and overkill for the job at hand) or writing dozens of custom functions A, B, C etc, my point is simply that writing function Y (which can be seen as X-lite) is something that should be evaluated. In essence I'm a proponent of always asking yourself the question of "can I make this solution more generic so I can reuse it in the future".

BTW, there's no "?" between Dev and L. But it's okay, I have no problems with being associated to devils and demons. ;-)

Cheers!

Re:Strange One

Posted: Sun Apr 10, 2005 11:58 am
by Poseidon
isn't it a option to first fgets the string, and then use sscanf to parse it?

Re:Strange One

Posted: Sun Apr 10, 2005 12:59 pm
by distantvoices
@DevL: Me 's been jesting too. *gg* It's been just too luring ... *dg*

Usually an experienced developer/programmer develops a set of each_day_functions like Linked List traversal and so forth which he/she applies where they can be applied - even if he/she writes them in form of a use_it_in_a_versatile_way library.

Hmmm ... why do I have the feeling that my english is somewhat deteriorated today?

Re:Strange One

Posted: Sun Apr 10, 2005 4:56 pm
by DevL
beyond infinity wrote: Hmmm ... why do I have the feeling that my english is somewhat deteriorated today?
Since it is (was here in Sweden) Sunday, you might have been up to some mischief yesterday? :)