Strange One

Programming, for all ages and all languages.
DevL

Re:Strange One

Post 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? :)
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:Strange One

Post 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*
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
DevL

Re:Strange One

Post 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!
Poseidon

Re:Strange One

Post by Poseidon »

isn't it a option to first fgets the string, and then use sscanf to parse it?
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:Strange One

Post 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?
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
DevL

Re:Strange One

Post 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? :)
Post Reply