tag:blogger.com,1999:blog-8677649049588007585.post5454772318696444041..comments2023-06-18T16:15:22.432+01:00Comments on PL/SQL Challenge: "Trickery!" cry some players re: 28 January quiz (1945)Steven Feuersteinhttp://www.blogger.com/profile/16619706770920320550noreply@blogger.comBlogger37125tag:blogger.com,1999:blog-8677649049588007585.post-31487053007757042342011-02-07T22:54:20.289+00:002011-02-07T22:54:20.289+00:00Adderek,
I suppose that didn't work out the ...Adderek, <br /><br />I suppose that didn't work out the way you suggested. It seems that Google automatically translated your code, which indeed contained many "funny looking" characters into English.<br /><br />When I tried to run your block without the Google transformation, I get this error:<br /><br />ORA-00900: invalid SQL statement<br /><br />But this doesn't have to do with my IDE, does it? It has to do with the language settings for my database. Please review the assumptions to see if I do NOT have this covered.<br /><br />SFSteven Feuersteinhttps://www.blogger.com/profile/16619706770920320550noreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-42771700213527030412011-02-07T22:26:25.544+00:002011-02-07T22:26:25.544+00:00Dear Steven,
That is a pitty that the users are p...Dear Steven,<br /><br />That is a pitty that the users are punished for the limitations in your IDE for the challenge. Not their skills but you presenting things incorrectly.<br />An example question for you: Why the compiler would fail to execute the following statement?<br /><br />dесlаrе<br />bеgin<br />dbms_оutрut.рut_line('A test '' text " ');<br />еnd;<br />/<br /><br />Why the code would fail to compile? Maybe because there are some fancy characters (I have used russian cyrylic characters there)? Or maybe I have misplaced an invisible character instead of invisible space? Or maybe...<br />Please, try to copy/paste it and execute...Unknownhttps://www.blogger.com/profile/16279008641149475715noreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-21537455006223335562011-02-05T10:36:07.334+00:002011-02-05T10:36:07.334+00:00alc> "I think Steven is being unfairly cri...alc> "I think Steven is being unfairly criticized."<br /><br />The criticism is for the spirit of quizzes. Early it was "Look at root, determine a salt of question". And semicolon was never the salt early.<br /><br />There are the hint ("rollback") to consider the (missing) semicolon as the salt of question. But this hint was insufficient, especially (as I can see) because of reviewers that introduce that faulty choice. <br /><br /><br />Steven, "perhaps never again" means "be awaiting trap every day"? :)Vitaliy Lyanchevskiyhttps://www.blogger.com/profile/03394959689295703518noreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-23277000129598358962011-02-03T03:50:31.845+00:002011-02-03T03:50:31.845+00:00And just one last point: this is a trick, not of t...And just one last point: this is a trick, not of the plsql challenge, but of the plsql COMPILER. Do not shoot the messenger. I think Steven is being unfairly criticized.alchttps://www.blogger.com/profile/05372973618706697631noreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-90378649883694683202011-02-03T03:48:19.177+00:002011-02-03T03:48:19.177+00:00When I signed up to this site, I used to get reall...When I signed up to this site, I used to get really worked up about getting a question wrong for unfair reasons, like not being able to take the test because the site was down for the last 3+ hours of the day (not that I'm still bitter).<br /><br />Now I think: 1) it's just a quiz, 2) what did I learn from this mistake? In other words, the plsql quiz is just like life: no sense standing around complaining; just learn your lesson and move on.<br /><br />In my case, I learned to take my test earlier in the day. In this case, I learned that loop labels are not required and that commit is not a reserved word (or at least in regards to loop labels), and I learned that semicolons are super important, and I even learned to always auto-format my code if I suspect something is wrong.alchttps://www.blogger.com/profile/05372973618706697631noreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-34467333827830171622011-02-01T21:45:22.272+00:002011-02-01T21:45:22.272+00:00I feel sucked in. I expect the quiz to teach somet...I feel sucked in. I expect the quiz to teach something about the PL/SQL. I'm using formatting. I'm looking at the warnings. I'm using color coding in my IDE.<br />Sorry, but this is not fair...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-33036766171044379062011-02-01T14:09:38.977+00:002011-02-01T14:09:38.977+00:00Hello All,
Kim, you are amazing !
I am extremely...Hello All,<br /><br />Kim, you are amazing !<br /><br />I am extremely happy that I am not the only addicted one, and it's not only a figure of style !!!<br /><br />Once you start, you cannot stop this daily joy <br />or excitement, or sometimes annoyance ...<br /><br />I am not sure whether sometimes Steven doesn't think by himself of already having had enough of some of us ... but in spite of all these heated discussions, I think that the PL/SQL Challenge team does have of what to be proud and does have all the reasons to only desire to see each one of us going on and growing with the Challenge, which is now part of our biographies just like that of their own !<br /><br />Let's hope that no one will quit and that the big excitements are still awaiting us in this Challenge !<br /><br />Best Regards,<br />Iudithiudithhttps://www.blogger.com/profile/04905902445036068357noreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-70077560356984590532011-02-01T07:26:49.791+00:002011-02-01T07:26:49.791+00:00No no, you are not getting rid of me this easy :-)...No no, you are not getting rid of me this easy :-). To stop playing the Challenge would be like asking an addict to quit his daily fix...<br /><br />This is just to keep you on the straight and narrow, Steven. You can't play tricks on the PL/SQL community ;-)<br /><br /></tongue-in-cheek-mode>Kim Berg Hansenhttps://www.blogger.com/profile/06491635470794828550noreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-24337478062084577802011-01-31T20:57:28.239+00:002011-01-31T20:57:28.239+00:00I hereby promise to not make every quiz a test of ...I hereby promise to not make every quiz a test of your ability to check each line to see if it contains a ";".<br /><br />:-)<br /><br />This was one quiz. It is obviously not a typical quiz. <br /><br />Of course you are not going to see lots of quizzes like this - and based on the ferocity of the reaction, perhaps never again.<br /><br />It would be a shame in any of you stopped playing the quiz just because you had such a strong disagreement with my judgment regarding this quiz (and to be clear: others may write the initial draft of a quiz, but once it is published on the PL/SQL Challenge, I take full responsibility).<br /><br />If, however, that is what you need to do, then I wish you all the best in your work as an Oracle technologist.<br /><br />SFSteven Feuersteinhttps://www.blogger.com/profile/16619706770920320550noreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-36628280982876121942011-01-31T20:26:57.708+00:002011-01-31T20:26:57.708+00:00Hello All,
I strongly agree with Kim's remark ...Hello All,<br />I strongly agree with Kim's remark above,<br />I experienced exactly the same feeling and went through the same contradictions vis-a-vis this quiz ...<br /><br />It is nice to have other players' quizes in the Challenge and there were really nice ones, like recently that of Gary Myers and a little earlier that of Jeff Kemp, but, exactly because our imagination is endless and, yes, as Steven said so truly, each one has a different life experience, I think that the overall close control of the Challenge team is at least at this stage most necessary.<br /><br />It is true that it is very difficult to create a good quiz and I am exactly going through preparing a few these days, but I really would feel very unconfortable if someone felt that my quiz just intended to lead people away from the right answer, instead of really teaching something.<br /><br />I do really appreciate Steven's feeling about the Challenge community, I personally feel less alone professionally speaking since I can express my thoughts especially on subjects that are my favorites or even defend sometimes agressively my opinions.<br /><br />As a last remark and back to this poor quiz, as well as to the today's one, I still think that both of them are BEGINNER quizes and nothing more, in spite of the authors too visible tendency of "trying to be spectacular" at all price.<br /><br />Though, as I saw, the author should specify a difficulty level when submitting a quiz, I think that this still should be revised and finally established by the Challenge leading team.<br /><br />And yes, sometimes taking a refreshment with Steven and his team's quizes is also desirable,<br />to "calm down" the challenge when it gets overheated ...<br /><br />Thanks & Best Regards,<br />Iudithiudithhttps://www.blogger.com/profile/04905902445036068357noreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-40704922422501242922011-01-31T17:54:47.315+00:002011-01-31T17:54:47.315+00:00Okay, I didn't know this was a focus on syntax...Okay, I didn't know this was a focus on syntax checking and not content and logic. 'Trickery' is right!! <br /><br />If you're trying to stir up emotion and excitement by skipping the infamous ';', I cry "foul!". <br /><br />It is obvious from the organization content of your code that a 'commit' was definitely intended (which is why most readers also got it wrong).<br /><br />I think it is silly to "trick us" and do your syntax checking.CA_Bobhttps://www.blogger.com/profile/16258570820393489960noreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-34618801720779034202011-01-31T15:43:55.627+00:002011-01-31T15:43:55.627+00:00You have moved to a whole new level of deceit with...You have moved to a whole new level of deceit with this quiz. I have learned the hard way that, not only do I need to spend time deciphering the logic and intent of the quiz, but now I need to devote time to dotting every "i" and crossing every "t" - or, in this case, checking every line for a semicolon!<br /><br />It goes without saying that I think this is a very unfair quiz. In the past you have used a fair amount of trickery, which I suppose is okay (more about that later). But now you expect us to watch for the most subtle typos - and, at the same time, have raised the bar for yourself with respect to absolute accuracy in every quiz.<br /><br />Since I assumed the quiz was intended to delve into specific aspects of PL/SQL, I have enjoyed learning - and, occasionally, being punished for not knowing - both common and obscure details of PL/SQL. Changing the intent of the quiz to an exercise of "where's the typo?", not only undermines what I thought was the underlying philosophy, but demands a different mindset as well. And, quite frankly, I'm not sure I want to devote daily time to debugging possible typos.<br /><br />Please get the quiz back on track with the intent.-Dan-https://www.blogger.com/profile/14232500880533270596noreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-32850626507466023842011-01-31T12:22:37.858+00:002011-01-31T12:22:37.858+00:00It would not be a trickery unless the PL/SQL chall...It would not be a trickery unless the PL/SQL challenge prehistory (quizes with missing semicolons, quizs where last-line slash was considered as an inherent part of PL/SQL code (it is not) and so on...<br />But it this context - it is a trickery.al0https://www.blogger.com/profile/15743792964167204705noreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-60932538411605250882011-01-31T08:29:47.099+00:002011-01-31T08:29:47.099+00:00Hey Steven
I didn't say you were lying (but y...Hey Steven<br /><br />I didn't say you were lying (but yes, I agree, it looked like I said that), I said that everybody lied.<br /><br />Saying "Everybody lies" (http://www.amazon.co.uk/Dr-House-Everybody-Shirt-T-Shirt/dp/B002JJHNAK/ref=sr_1_1?ie=UTF8&qid=1296461696&sr=8-1) in reference to Gregory House (http://en.wikipedia.org/wiki/Gregory_House) really means not to trust anyone ever and always check and verify everything.<br /><br />I hoped you would have known who Gregory House was so you would have understood the meaning. Wrong assumption :)<br /><br />Good luck with PL/SQL Challenge!<br /><br />Have a good day.<br /><br />Regards<br />LudoUnknownhttps://www.blogger.com/profile/03813440070210845954noreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-89041050308071767372011-01-31T07:30:58.991+00:002011-01-31T07:30:58.991+00:00The "trick" part is not about the missin...The "trick" part is not about the missing semicolon. The "trick" is that the question topic is not clear from the question text. It is very easy to assume this is beginner level question on transaction control. In the survey I clicked "Too easy" because the question very clearly in my mind was about transactions.<br /><br />When I received the quiz results email I noticed the topic of the quiz stated "Labeling a PL/SQL loop" - my first reaction was "What! That wasn't the topic. They must have sent a mail about a different quiz?"<br /><br />Advice to question submitters: The "topic name" of the quiz is not visible when players take the quiz. The question text by itself ought to be fairly clear to players what the question is testing our knowledge about...<br /><br />Apart from that I second Stevens motion that more players submit quizzes. It is very enlightening to see other developers point of view. I'll even attempt to make a few myself, even though I am better at SQL than PL/SQL :-)Kim Berg Hansenhttps://www.blogger.com/profile/06491635470794828550noreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-10128341767189676962011-01-30T23:14:03.674+00:002011-01-30T23:14:03.674+00:00I think JHall62 hits the nail on the head - if a p...I think JHall62 hits the nail on the head - if a programmer ran this code and it "worked" with incorrect results, that's part of the feedback a programmer receives in debugging code. That's missing in this can, as well as those who use IDE formatters.<br /><br />Where the quiz had integer as a variable name, it was highlighted as a quiz looking at viable names. This question may have passed regular muster if it was identified as something like "why will this compile ok?"<br /><br />In regard to identifying mistakes, I've found myself reading the quizzes not looking for them, hence I make the presumption that there are semi-colons at the end of each line - as there should be - moreso concentrating on the logic unless I've been otherwise directed by the question.<br /><br />I did learn from this quiz, as I've learned from making silly mistakes in recent quizzes that I should have got right. I'm just not sure it was quite in the "spirit" of regular questions.Scott Wesleyhttps://www.blogger.com/profile/18106937181788036683noreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-10322431374249893622011-01-30T22:54:46.420+00:002011-01-30T22:54:46.420+00:00You are, of course, welcome to continue commenting...You are, of course, welcome to continue commenting on this issue for as long as you'd like. I would like, however, to attempt to offer some closure and some advice.<br /><br />First, while I really, really hate to read that players feel betrayed or tricked, that the Challenge might in some way be tainted for them, etc., I also feel very positive about the community that has come together around the Challenge. The level of connection that many of you have both evokes strong responses and leads to strong contributions. <br /><br />Second, one thing that this thread reminded me of so strongly is that in any large, globe-spanning group of people, there will always be a strong mix of reactions and experiences. This has to do not only with the response to this quiz, but also your experiences with code in the "real world." Almost any piece of code we can imagine (or have nightmares about) has been written by someone, somewhere, or will be written tomorrow. And there are lessons to be learned from all of it. So if you ever find yourself saying "This quiz is worthless", take a deep breath and a step back, and consider the possibility that while this quiz didn't do much for you, it could very likely be of great assistance or relevance to others.<br /><br />Third, if you ever experience dissatisfaction with a quiz, I strongly encourage you to consider submitting a quiz for use that demonstrates the much better way to do a quiz. It takes a whole lot of time and creative thinking to come up with five excellent quizzes a week - I will take all the help I can get, and of course I want to leverage the varied experiences you have and can bring to bear in a quiz. In other words, if you have a deep specialization in an area of Oracle technology (PL/SQL-related), share that with us through quizzes!<br /><br />Fourth, please make every effort to be civil in your postings. I have, in the past, posted comments that offended some of you - with good reason (though not with intention). In this thread, one player, however tongue in cheek, accused me of lying. In another comment, one player categorically rejected another player's experience of this quiz. It's OK to say your experience was different, but everyone's interpretation and viewpoint is valid, and should be accepted as the starting point of discussion, not something you reject as if their experience is somehow invalid. So remember: in the world of email, texting and comments, we can't see your face. All we have are your words, and it is easy to take them the wrong way.<br /><br />OK, back to work on version 2.0 of the PL/SQL Challenge. Won't be ready for a couple of months, but I am sure you will be delighted with the new features and flexibility. More on that to come....<br /><br />Best of luck this week at the PL/SQL Challenge!<br />StevenSteven Feuersteinhttps://www.blogger.com/profile/16619706770920320550noreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-64381955681966690242011-01-30T18:48:33.727+00:002011-01-30T18:48:33.727+00:00Hi,
to me it was beneficial. I did learn another ...Hi,<br /><br />to me it was beneficial. I did learn another form of mistake the compiler allows. <br /><br />Is this a bad practise I do not follow? Sure<br />Should the compiler catch it? Sure<br />But...<br />Can I encounter it in legacy code I maintain? Sure! That's the reason I am grateful it appeared.<br /><br />And this wasn't a typo. It was intended "mistake". And it wasn't malformatted to hide it. The code was formatted as any reasonable human would do it. I think that by creating "verification" code section Steven and his team of angels pretty much eliminated compile typo's. So no player should assume a "mistake" is a possible typo anymore.<br /><br />MPUnknownhttps://www.blogger.com/profile/16692956267745310496noreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-22089968169959089842011-01-30T15:13:44.370+00:002011-01-30T15:13:44.370+00:00Hello,
Sorry, but I cannot agree with Urs's re...Hello,<br />Sorry, but I cannot agree with Urs's remark.<br /><br />If this quiz "did teach" anybody anything,<br />then it indeed should have taught the pl/sql compiler creators that they have an ugly "flaw" in the compiler's logic:<br /><br />A label SHOULD NOT be allowed to be specified <br />in "referring" places like AFTER an END LOOP and similar, without having been specified at the relevant "defining" place, like at the start of that loop.<br />It is the same thing as not allowing a closing bracket alone, without its opening counterpart.<br /><br />Regarding IDE tools: All those that express attachment for using IDE tools do in fact forget<br />that pl/sql challenge is exactly designed for NOT using any helper tool while playing,<br />even not a simple cut/paste operation,<br />so any recommendation related to such a tool<br />in the context of this quiz is NOT in place.<br /><br />In the real life, each one is free to act as it suits him best and as it makes him more productive.<br />I myself was unable even to copy this quiz text word by word and reproduce the same mistake,<br />I copied it without that mistake, just as probably many other players did ...<br /><br />Without any false modesty, but I do indeed believe that those who are (still) making such mistakes should indeed NOT think yet of any competition like the Challenge ...<br /><br />To be honest, this was a BEGINNER question,<br />and not an Intermediate one ...<br />Putting a semicolon at the end of a statement<br />is taught I think in the first hour of the first level pl/sql class ...<br /><br />It's nice to know that Oracle11g has already done something to improve the issue of warning<br />about such worse practices as using reserved words for custom purposes ...<br />I would go that far as to turn it into an error<br />always, not just on demand !.<br /><br />If it were not for backward compatibility issues,<br />maybe it would have been easier for Oracle to simply forbid all those usages, without caring to make differences between STANDARD package constructs, SQL built-ins, pseudocolumns, a.s.o.<br />When it comes to best practices, ALL these should be treated alike.<br /><br />Best Regards,<br />Iudithiudithhttps://www.blogger.com/profile/04905902445036068357noreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-6939539004766917322011-01-30T12:43:48.103+00:002011-01-30T12:43:48.103+00:00I have hardly ever learned as much from a quiz as ...I have hardly ever learned as much from a quiz as from this one. This is exactly the kind of mistakes that come across in real life. And I feel it's no shame to use tools which help to find out errors like this one.<br />IMHO the Challenge is not only about competition and awards, but mostly about learning and teaching things you didn't know before. From this point of view, this quiz has done a superb job.<br /><br />UrsUrs Metzgernoreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-26497930878697520942011-01-30T12:41:58.709+00:002011-01-30T12:41:58.709+00:00FYI: Oracle Database 11g already offers a compile-...FYI: Oracle Database 11g already offers a compile-time warning as suggested by Mike above:<br /><br />PLW-05004: identifier string is also declared in STANDARD or is a SQL builtin<br /><br />Cause: The indicated identifier was also either: o) declared in package STANDARD, or o) a SQL builtin function, or o) a pseudo-column. This situation can result in name resolution issues since the STANDARD/builtin declaration will be chosen over the local declaration in SQL statements; however the local declaration will be chosen over the STANDARD/builtin declaration outside SQL scope. (See the documentation on PL/SQL name resolution.)<br /><br />Action: Either: o) rename the given identifier, o) qualify any references to the identifier with the containing scope's name, or o) make sure the intended resolution occurs if using the identifier in SQL scope.Steven Feuersteinhttps://www.blogger.com/profile/16619706770920320550noreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-70798687406530813142011-01-30T08:18:56.802+00:002011-01-30T08:18:56.802+00:00Hello All,
I can hardly see how one can add anythi...Hello All,<br />I can hardly see how one can add anything more as a remark to this quiz.<br />It WAS trickery, I would say even close to TREACHERY !!!<br /><br />I should witness that in my about 20 years of PL/SQL I have NEVER made such a mistake of forgetting a semicolon after a statement !!!<br />And I should also underline that I AM NOT using any code formatter !!!<br />I think just the opposite is true:<br />If YOU KNOW that you should put a semicolon at the end of a statement, then you will surely not forget it, while if you rely on a machine to correct your mistakes, then they may pass unnoticed by you ...<br /><br />I truly think that this quiz DID NOT teach us<br />ANYTHING and the fact that almost all players made the same mistake just shows that we are normal people, normal pl/sql programmers that have a common sense of how code should look and behave !!!<br /><br />But, YES !<br />It again emphasizes those weaknesses of the PL/SQL compiler.<br />I think that time has arrived for an essential change in the restrictions related to reserved words.<br />In my opinion, both INTEGER and COMMIT should be considered as reserved words and be forbidden for being used otherwise that intended.<br />The list of reserved words in not that long<br />so that to make it impossible to have it enforced, I would say even through issuing compilation errors, not just warnings.<br /><br />Also, the presence of a "label" at the end of a loop without its presence at the start of the loop should by all means have been signalled as a compilation error and I wonder that it is not !<br /><br />A more severe compiler would surely not have allowed even for that space line that separates the END LOOP from its presumed "label" ...<br /><br />In my opinion, the purpose of PL/SQL Challenge is also to teach the players best practices<br />and using reserved words in other places than expected IS CLEARLY A WRONG PRACTICE, that should be discouraged, even if (hopefully just still) allowed by the pl/sql compiler.<br /><br />There exist not few organizations where the discipline of coding goes until imposing a specific number of blanks for code indentation, a.s.o. ...<br /><br />The older ones like myself, that were born before the era of the IDE tools and who have always followed best practices well learnt and acknowledged and always doubled by common sense did NEVER feel the need for a mecahnical tool to do this work for them ...<br /><br />It's a pity that so much was invested in tools<br />that "help in correcting compilation errors",<br />which can easily be solved by almost anyone,<br />while most developers strive with real life and hard to solve performance issues, that most of the time remain without a satisfactory solution ... in spite of the money spent for<br />"mechanical code reviewers".<br /><br />I am sure that on a second thought, the reviewer team would have NOT chosen such a quiz for the Challenge ...<br />It did not make anything except causing frustration to everybody ...<br /><br />Best Regards,<br />Iudithiudithhttps://www.blogger.com/profile/04905902445036068357noreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-80066102603922501722011-01-30T07:01:36.276+00:002011-01-30T07:01:36.276+00:00Despite the uproar and the fact that I had it wron...Despite the uproar and the fact that I had it wrong too, the quiz is valid. Missing semicolons are a fact of life and are hard to debug. The code I maintain is formatted in a special way, that I don't like and for that reason I don't use the Toad formatter. I would have missed this one.<br />Maybe time to investigate if Toad can use multiple formatting settings. My preferred choice and the format that is used in the code.Wim de Langehttps://www.blogger.com/profile/05505341375827859005noreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-47835675303137341662011-01-30T06:02:59.621+00:002011-01-30T06:02:59.621+00:00I do not know why people are cribbing about the qu...I do not know why people are cribbing about the quiz. People are so much obsessed with the formatters, that they really forget about the visual reasoning capability of their brains ;)Nitin Arorahttp://www.nitinarora.co.innoreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-25650862349488647092011-01-30T03:28:13.013+00:002011-01-30T03:28:13.013+00:00I disagree with those who advocate against using c...I disagree with those who advocate against using code formatters to reveal code issues. Of course one should strive to write correct and readable code; however, even the most proficient programmers occasionally make mistakes. Code formatters and compiler warnings provide valuable feedback that can help one identify these lapses. These tools may be even more valuable when investigating or reviewing code that one didn’t write. As this quiz demonstrates, one can be easily influenced by expectations based on the visual structure of the code. Humans are notoriously inept when it comes to spotting minor textual mistakes. Consistent formatting provides additional visual cues that can assist one in correctly analyzing a piece of code.<br /><br />This quiz used visual layout to intentionally mislead the players, much as a magician uses misdirection to trick the audience. There is a difference, however: a magician generally admits intent to trick the audience, but the players of the quiz were assured that there would be no such trickery. This quiz had several tricks: the aforementioned formatting, the deliberate choice of <i>COMMIT</i> as the label (as mentioned by Sean), the inclusion of <i>ROLLBACK</i> to reinforce the appearance of <i>COMMIT</i> as a statement, and the absence of the label preceding the <i>FOR … LOOP</i> portion of the code. This last item exposes a defect in the PL/SQL compiler: identifiers that are not defined as labels may be accepted where a reference to a label is expected.<br /><br />Knowing the author’s intended topic and answer likely made it much easier for the reviewers to correctly analyze the code than it was for the players. Having this information may have made the code seem less tricky for the reviewers. There are changes to the quiz that could have reduced the appearance of trickery to the players; for example, presenting the intended output and then asking for the actual output due to an unidentified code defect.jhall62https://www.blogger.com/profile/10339038131928463003noreply@blogger.com