Table Masturbation occurs when a human continually visualizes tables in his mind, while spewing out comments about how everything should be put into a table. All arrays in programs, all lists, and all structs/records and objects should be tables. Strings and buffers are wrong. They are tables. Pointers to chars are much better as tables. For the sake of masturbating about the table (visualizing her in our mind) we will see '''everything''' as a table - even if it is not practical for everything to be a table (especially on C2 wiki where we have the chance to masturbate the table thoughts out aloud). Consider the following program: var s: string; b s = 'hello'; ''// bad.. should be a database insert'' s = s + ' world'; ''// bad.. concatenation is just reinventing inserts'' outln(s); e. Someone skilled in TableMasturbation will immediately see a problem with the above program. The problem is that the string "hello world" should actually be in a table. Each character or the entire string should be indexed with a primary key in a table. According to one skilled in TableMasturbation, the "hello world" string cannot be placed into that program and one is just reinventing the table and database with such a program. Consider also var s: array [1..100] of string; The above array should be placed into a table immediately, even if it doesn't need to be in a table - because we prefer TableMasturbation. If there is a valid need for a table, then it is no longer masturbation - but rather practical use of a table. Ideally, one should use a RelVar, and think about the relations rather than masturbating about ''tables''. ---- You want table masturbation? I'll give you table masturbation. This is from http://99-bottles-of-beer.net/language-rel-1149.html /* 99 Bottles of Beer in Rel. Rel implements an extended subset of Date and Darwen's "Tutorial D" true relational database language. This example (unecessarily and inefficiently) creates a relation variable to hold the bottles, which provides an opportunity to demonstrate some of the built-in relational operators. See http://dbappbuilder.sourceforge.net Copyright (c) 2006 Dave Voorhis */ VAR bottles LOCAL RELATION { bottlecount INTEGER, description CHAR } KEY {bottlecount}; VAR i INTEGER; DO i := 1 TO 99 VAR descript CHAR; IF i > 1 THEN descript := "bottles of beer on the wall, " || i || " bottles of beer. Take one down, pass it around,"; ELSE descript := "bottle of beer on the wall, " || i || " bottle of beer. Take it down, pass it around," || " no more bottles of beer on the wall."; END; bottles += TUPLE {bottlecount i, description descript}; END; FOR bottles ORDER DESC bottlecount BEGIN WRITELN bottlecount || " " || description; END; Note: The above is Rel2 (see RelProject) syntax. It will not work in Rel3. -- DaveVoorhis ''Dave, thank you for the "DO" loop idea in Rel. Do is shorter, and more concise than "FOR" in you first loop. I may consider this loop style for Qomp. Although you could have just used FOR instead of DO for the notation/syntax in the first loop, I suppose.'' ''DateAndDarwen deserve credit for "DO". The "FOR" that appears later is mine.'' -- DaveVoorhis ------ I believe this topic is in retaliation. Tables don't qualify if one uses them because they fit the way one thinks. They are not an experiment for the sake of experiment, but a "user interface" from the developer's perspective. Thus, claiming thinking in tables is MentalMasturbation would be like claiming that GUI's are "interface masturbation" because users better relate to them than CUI's. Thus, its it's not equivalent. --top * The same argument could be made for an array. Arrays don't qualify if one uses them because they fit the way one thinks. However, this is not the reason I use arrays. I pick the appropriate data structure for the problem. I don't go based on "gut instincts" or "hunches" or "the way I thought for 24 years". Rather, I try to learn and pick the right algorithm and data structure for the situation. If a relation is suited to the task and if the relational DB is very accessible, then I use it. If I just need a list of integers without it needing to be associative, then I use an array. I don't bend every thing intoa table just for the sake of bending it into a table, nor do I bend everything into an 1D or 2D array just for the sake of bending it into an array. * ''I agree with using TheRightToolForTheJob, but measuring which is the "right tool" is very tricky and probably highly subjective. If a group of developers "think in tables", then perhaps using a lot of tables will make software easier ''for them'' to produce or maintain. PsychologyMatters. If heavy objects or arrays works for others, then so be it. -t'' * ''Further, being a table and being an "array" is not necessarily mutually-exclusive. One could be merely a view of the other. An array can be viewed as a table with certain constraints put upon it, for example. Ideally, our tools would allow us to incrementally morph one into the other (or act as the other) as needs change. If performance is a key, then ideally a smart compiler/interpreter would select the best fitting physical implementation similar to how some RDBMS can select the optimum (or pretty good) execution path based on query analysis. -t'' ''While I agree that this topic is retaliatory, if I'm not mistaken you said this.'' * Re: "While I agree that this topic is retaliatory..." - I appreciate your honesty here. You could have claimed it served a technological educational purposes as guise, but instead admitted the real reason. Kudos. --top "If there is no significant evidence that closures or OOP makes stuff significantly better, then "that" itself is evidence for MM. " ''Again, if I remember correctly, you didn't accept fitting the way one thinks as a good enough reason to drop the label. In addition, I recall your attitude when you were shown an example of a significant improvement. Your response indicated that it was still MM because the example wasn't from your limited domain. Thus, it is representative of one way you use it.'' I sure the hell wish you paid as much attention and effort to providing evidence for your HobbyHorse technologies as you do in indexing my statements. Revenge is a waste of human energy. I would like to see the context of the above. I suspect it was taken out of context. As stated above without context, I reject it. If I made it without any ties to context, then I withdraw that statement as an error on my part. And even if I didn't reject it, that is not a valid reason to fill up wiki with '''personal''' catfight topics. --top * TableMasturbation is a serious problem and a serious AntiPattern. There are cases, when one needs to use an integer or an array - and not a table. TableMasturbators have a serious problem that needs to be patterned on this wiki - despite your claims that this is purely a retaliation. It is in part a humorous semi retaliation - but also a serious effort to categorize a pattern. I see people commonly picking the wrong algorithm. Everything should be a table, everything is fine as an associative array. Use what the language gives you, don't define any types. Etc. Etc. The pattern is people are continually masturbating about their pet (in this case tables) instead of picking the correct data structure and algorithm for the situation at hand. A table has its uses, and an array does too. One should not bend and force everything into a table, or an array, or a hash list. One should pick the correct tool for the job. Type systems help one create these tools. Continually visualizing and masturbating only about tables can lead to BrainDamage and CodeStains. * ''How are you measuring "wrong tool" or "wrong structure"? What is your criteria for wrong-ness? Is it based purely on machine performance? What if machine performance is not the bottleneck for a particular application or need? Generally I'll pick the tool that best fits my mind before picking one that best fits the machine, unless of course the machine becomes a limiting factor. Otherwise, let the machine slave away instead of humans slave away. If you have an objective and tested Universal Formula for determining "right tool" or "right data-structure", I'd like to inspect it. Such a tool would likely qualify you for a TuringAward. -t'' ''See EvidenceRantsContinued for the context of your statement. It only took a few minutes to find it, and I am willing to back up any statement I make. In fact, that is why I took the few minutes to find that quote in the first place. I agree that revenge is a waste, but it wasn't among my motives. BTW, if you wish to see fewer cat fights here, you might want to consider dropping the terms "HobbyHorse", "MentalMasturbation", "bloat", "red eTape", etc. from your writing. They appear to be the root causes of many of the cat fights.'' Or "naive script kiddie", "brain damage", "lazy", etc. At least I don't create new topics to complain about each and every new occurrence. Your reaction is much stronger than mine. You escalate rather than return in equivalence. Your "e-sin" is greater. (My only recent topic rename, "brain damage" to something like "languages that teach bad habits", was in no way intended to retaliate or offend. I merely made it less offensive and more self-describing.) * You're very quick to rename pages like BrainDamage (which is a common pattern formed by Dijkstra), yet you commonly use inflammatory pages in your writings such as MentalMasturbation - while calling languages "anal languages". * ''Insulting an author (the brain) is a step up on the "sin scale" from insulting their ideas by most social scales. "Doing X is bad", and "Person X is bad/broken" are different things.'' ''Yep, creator of this topic is no better. And I have neither created nor renamed any topics to complain about anything, so your accusation here is way off target.'' Because you don't sign your content, you have to live with errors in identification. ''You ought to consider not making rash accusations. You had no evidence that I had done any of the things you have accused me of, yet you still made the accusations.'' If they don't apply to you then they apply to the other non-signer(s). So why the fuss? I'm chewing out an e-ghost. ---- So, I guess TableWeenies like TableMasturbation, and ObjectWeenies like ObjectMasturbation... and RelationalWeenies like RelationMasturbation and... see the pattern? Maybe we need a topic called ConceptMasturbation or TheRelationofMasturbationAndWeenies ;) ''CategoryMasturbation'' MayZeroEight