Freethought & Rationalism ArchiveThe archives are read only. |
07-09-2003, 10:10 AM | #11 | |
Veteran Member
Join Date: Jan 2001
Location: USA
Posts: 1,072
|
Quote:
The last post in that thread was dated 04/04/2003. Today's date is 07/09/2003. Uhm, isn't it a lot closer to 3 months than 4? |
|
07-09-2003, 10:29 AM | #12 | |||
Veteran Member
Join Date: Jan 2001
Location: USA
Posts: 1,072
|
Quote:
Quote:
Quote:
|
|||
07-09-2003, 10:36 AM | #13 | ||
Veteran Member
Join Date: Jan 2001
Location: USA
Posts: 1,072
|
Quote:
Quote:
|
||
07-09-2003, 10:47 AM | #14 |
Banned
Join Date: Jul 2002
Location: U.S.
Posts: 4,171
|
Good programming practices seems a simple and easy subject to me. I don't know why there are volumes written on it when it is such an easy thing to grasp.
This is especially true in the age of very fast computers where, more often than not, super efficient code is not necessary. Once a friend and I calculated time differences when doing things the "right" way as opposed to the "wrong" way under various circumstances. We added extra lines of code to make things clearer yet less efficient. In our samples, which I admit were not that extensive, it was difficult to find examples that came up to any noticeable time differences. DC |
07-09-2003, 10:47 AM | #15 | ||
Veteran Member
Join Date: Jan 2001
Location: USA
Posts: 1,072
|
Quote:
Let’s see how Principia continues…it’s a hoot! Quote:
Here we see another example of a common underhanded tactic Principia employs. He creates a substitute example -- one that in reality is grossly inaccurate -- and trashes it, all the while pretending that doing so trashes the original. Is anyone here really gullible enough to buy his dishonest "substitutions" tactic? |
||
07-09-2003, 10:54 AM | #16 | |
Senior Member
Join Date: Feb 2003
Location: San Diego, California
Posts: 719
|
Quote:
|
|
07-09-2003, 11:15 AM | #17 | |
Veteran Member
Join Date: Jan 2001
Location: Median strip of DC beltway
Posts: 1,888
|
That's a horrid way to generate the random number. A better way would be:
random_val=min+floor(double(rand()/(RAND_MAX+1.0))*double(max-min)) It's simpler, practically no distribution bias (assuming no bias in rand()), and a hell of a lot faster. According to man rand: Quote:
|
|
07-09-2003, 11:40 AM | #18 | |
Senior Member
Join Date: Feb 2003
Location: San Diego, California
Posts: 719
|
Quote:
|
|
07-09-2003, 12:11 PM | #19 |
Moderator - Science Discussions
Join Date: Feb 2001
Location: Providence, RI, USA
Posts: 9,908
|
DNAunion:
Here we see another example of a common underhanded tactic Principia employs. He creates a substitute example -- one that in reality is grossly inaccurate -- and trashes it, all the while pretending that doing so trashes the original. Is anyone here really gullible enough to buy his dishonest "substitutions" tactic? As I said to Principia, comments about the motives/honesty of other posters are not appropriate here. Please either stick to attacking arguments (for example, the above quote could be made acceptable by saying Principia is attacking a strawman), or refrain from posting any more on this thread. |
07-09-2003, 12:48 PM | #20 |
Contributor
Join Date: Jul 2001
Location: Deep in the heart of mother-lovin' Texas
Posts: 29,689
|
This is especially true in the age of very fast computers where, more often than not, super efficient code is not necessary.
That depends, generally, on the target platform and the application/purpose/function of the code. In addition, many compilers optimize "inefficient" code for you (though I've had some optimizing compilers introduce some strange behavior into my code). However, there's ususally no reason that code must be made more complex just for understandability. IMO, it's usually the case that simplifying and streamlining the code makes it more understandable (comments are more important than code structure, generally). - Mageth, who used to follow the maxim "REAL programmers never document their code; if it was hard to write, it should be hard to understand." |
Thread Tools | Search this Thread |
|