FRDB Archives

Freethought & Rationalism Archive

The archives are read only.


Go Back   FRDB Archives > Archives > IIDB ARCHIVE: 200X-2003, PD 2007 > IIDB Philosophical Forums (PRIOR TO JUN-2003)
Welcome, Peter Kirby.
You last visited: Yesterday at 05:55 AM

 
 
Thread Tools Search this Thread
Old 07-12-2003, 07:58 AM   #81
Veteran Member
 
Join Date: Jan 2001
Location: USA
Posts: 1,072
Default

Quote:
Tom Ames: I'd just like to know what DNAUnion thinks he's accomplishing here.
DNAunion: If you bothered to read the first post, you should have gotten the points. Here are some.

1) Contrary to what Principia asserted, my code was not spaghetti code.

2) Contrary to what Principia asserted, if is not in and of itself spaghetti code.

3) Improving code clarity by "wasting" a few CPU cycles or a few bytes of memory is considered, at least by some, to be good programming practice.

Other points that Principia then reraised were dealt with as the thread progressed.

Quote:
Tom Ames: If he's posting here in order to learn something, then he's not listening to the responses.
DNAunion: Uhm...most of the responses are wrong or irrelevant. For example:

(1) Sophie's terribly misguided trashing warning.

(2) Sophie's confusing contiguous memory as programmers use the term (note all of the quotes I marshalled to support my position) with the way that she interprets the concept, which is irrelevant to what I was stating.

(3) For exampe, NialScorva's long dissertation about what havoc "MY" code causes even though the conditions he described did not pertain to MY code.

Quote:
Tom Ames: If he's trying to demonstrate that he's a competent programmer, he's failing at that too.
DNAunion: Considering that your previous comments demonstrate your inability to follow the exchanges, I doubt you can follow up on that last part.
DNAunion is offline  
Old 07-12-2003, 08:16 AM   #82
Veteran Member
 
Join Date: May 2003
Location: On the road to extinction. . .
Posts: 1,485
Default GEE

Gee, DNAunion,

I guess we took over the thread, but you were concentrating too much on defending your precious work of art, that you were unable to suitably adjust.


Bye for now.
sophie is offline  
Old 07-12-2003, 08:33 AM   #83
Veteran Member
 
Join Date: Jan 2001
Location: USA
Posts: 1,072
Default

Quote:
Sophie: Now I remember why they invented C++, and strong type checking in languages like Java.
DNAunion: Uhm, the more appropriate terminology is “safe array”. Since you didn’t use that term, which is exactly the correct term for the topic, I’ll assume you are not aware of what one is. A safe array is one that does bounds checking. A safe array is exactly what would have caught my off-by-one error immediately (instead of I myself finding the problem after I did a quick review of my code).

Yes, it’s a good thing that C# and other languages have moved to using only safe arrays, because there are thousands or millions of programmers out there that have accidentally overrun the bounds of an array. Not all of them catch their own errors as I did, though.

Now, strong typing itself means only that the variable and its type must be declared before it can be used. In some languages, called loosely typed languages, a variable can be used without its ever having been assigned a type, or even declared, by the programmer. In fact, the type of data it stores can change during the execution of the program. It can store a date at one minute, a string at another, a boolean at yet another, and end up storing an integer. But in a strongly typed language, a variable must be declared and must be assigned a data type before it can be used, and any attempt to then assign a different type of data type value to it causes an error.

Note that C++ is a strongly typed language even though it doesn’t (by default) implement safe arrays.

Also, C++ will do some “interpreting” of values for you thereby circumventing, at least in some cases, the rule that a different data type cannot be assigned to a variable. For example, you can declare a variable as char myChar; and then assign an integer value to it, such as, myChar = 65;. So C++ is a strongly typed language, but does not necessarily perform strict type checking in the strongest sense of the term.

PS: Notice I haven’t said that you are wrong in what you said, just that you weren’t precise enough. “Safe array” is the term for which you were looking.
DNAunion is offline  
Old 07-12-2003, 08:38 AM   #84
Veteran Member
 
Join Date: Jan 2001
Location: USA
Posts: 1,072
Default

Quote:
Sophie: Well, DNAunion, I concede the points to you again. Possibly because I do not have any other choice.
DNAunion: So you do agree that even your usage of the term contiguous was not technically correct. And, that your usage of the term contiguous drilled down to too low of a level for the topic I was discussing. Good.

Quote:
Sophie: I hope you learned a few good pointers from an aging professional. I cannot claim the same,
DNAunion: Now you can. I just taught you what a safe array is!
DNAunion is offline  
Old 07-12-2003, 08:50 AM   #85
Veteran Member
 
Join Date: Jan 2001
Location: USA
Posts: 1,072
Default

Quote:
Sophie: I did'nt know we were supposed to debug your coding.
DNAunion: LOL! You guys didn’t. I did.

Let’s recap what people have done to my code:

(1) What you did Sophie was issue a trashing warning on my code which I easily refuted.

(2) What NialScorva did was “stuff code into my mouth” and then show what catastrophes his code could cause.

(3) What Principia did was claim that I had written spaghetti code, which I showed not to be the case.

(4) What I myself did was find the off-by-one error in my code.

No, looks like I am the one debugging my code (as well as your guys’ responses!).

PS: The only actual “bug” anyone other than I has found so far, at least that I can remember, is the one-tenth of one-percent bias built into my original pseudo-random number generating function (and even then the person who found it tried to sensationalize the problem, by substituting his own numbers in place of mine).

PPS: And let me remind everyone that it is the Visual FoxPro program that was used by me to calculate the empirical probabilities I mentioned in the other thread, and, if anyone is going to criticize my programming abilities, they should stick to that original Visual FoxPro program -- and not my hastily created translation of it into C++ .
DNAunion is offline  
Old 07-12-2003, 09:03 AM   #86
Veteran Member
 
Join Date: Jan 2001
Location: USA
Posts: 1,072
Default

Quote:
Sophie: The science you speak of is egotism, which places you in a class all by yourself.
DNAunion: Oh, not at all. I look across and see you sitting in the seat right next to me! You and I, we're classmates!

Didn't you offer up that you were a professional in the field? How boastful of you. Didn't you repeatedly claim to be talking over my head? How self-applauding and self-congratulatory of you.
DNAunion is offline  
Old 07-12-2003, 09:19 AM   #87
Veteran Member
 
Join Date: Jan 2001
Location: USA
Posts: 1,072
Default

Quote:
DNAunion: And they are misleading (as I used the term) when they indicate that elements are stored in a two-dimensional row/col table in memory, when they are actually stored linearly and contiguously. That really confuses you? Sorry.
Quote:
Sophie: What is misleading about that Sir?
DNAunion: Uhm, I already explained that in this very thread. But here you go, I’ll go through the trouble of spoon feeding it to you. This time, I'll even add bold emphases for you.

Quote:
DNAunion:
Conceptually, a 9x3 array (in C++ or C or other languages that use 0-based arrays) would appear like the following:

Code:
[0, 0]	[0, 1]	[0, 2]
[1, 0]	[1, 1]	[1, 2]
[2, 0]	[2, 1]	[2, 2]
[3, 0]	[3, 1]	[3, 2]
[4, 0]	[4, 1]	[4, 2]
[5, 0]	[5, 1]	[5, 2]
[6, 0]	[6, 1]	[6, 2]
[7, 0]	[7, 1]	[7, 2]
[8, 0]	[8, 1]	[8, 2]
But the two subscripts are misleading…there is no real element [5, 1] in the array. That is, to access element [5, 1] the computer does not go down 6 rows and then over to the right 1 [sic should be 2]. No, elements of an array are stored linearly and contiguously.
DNAunion: I fail to see how anyone who is actually trying to be reasonable could not grasp the very simple point?

I even provided a quote that demonstrated what I said.

Quote:
”The following declaration, for example, introduces a 3x3 matrix, each of whose elements is of type double:

double mat[3][3];

Conceptually, the storage for mat forms a two-dimensional structure in which the individual elements are laid out like this:

mat[0][0]….mat[0][1]….mat[0][2]
mat[1][0]….mat[1][1]….mat[1][2]
mat[2][0]….mat[2][1]….mat[2][2]

Internally, C represents the variable mat as an array of three elements, each of which is an array of three floating-point values. The memory allocated to mat consists of nine cell arranged in the following form:

--------------begin of mat[0]
mat[0][0]
mat[0][1]
mat[0][2]
--------------begin of mat[1]
mat[1][0]
mat[1][1]
mat[1][2]
--------------begin of mat[2]
mat[2][0]
mat[2][1]
mat[2][2]

In the two-dimensional diagram, the first index is assumed to indicate the row number. This choice, however, is arbitrary because the two-dimensional geometry of the matrix is entirely conceptual; in memory, these values form a one-dimensional list.” (Programming Abstractions in C: A Second Course in Computer Science, Eric S. Roberts, Addison-Wesley, 1998, p75-76)
DNAunion: How can anyone who is actually trying to understand this very simple point not eventually get it? It boggles the mind.
DNAunion is offline  
Old 07-12-2003, 09:30 AM   #88
Veteran Member
 
Join Date: Jan 2001
Location: Median strip of DC beltway
Posts: 1,888
Default

My first response to you (and further responses) were commenting on your statement that implied that it was no big deal to run past the end of an array by one element. So while I wasn't addressing anything specific in your code and was responding as a general commentary on the dangers of doing this, it wasn't exactly off topic or pointless.
NialScorva is offline  
Old 07-12-2003, 09:31 AM   #89
Veteran Member
 
Join Date: May 2003
Location: On the road to extinction. . .
Posts: 1,485
Default

DNAunion : you are explaining, but have just clarified what I was saying. The meta-representative. You r point seems pointless. Why bother?


Being a professional is not egotistic, but protecting your code to the degree you are, seems to indicate egotism.
sophie is offline  
Old 07-12-2003, 09:37 AM   #90
Moderator - Science Discussions
 
Join Date: Feb 2001
Location: Providence, RI, USA
Posts: 9,908
Default

DNAunion and sophie, please drop the personal jabs.
Jesse is offline  
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump


All times are GMT -8. The time now is 05:41 AM.

Top

This custom BB emulates vBulletin® Version 3.8.2
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.