WOW! best java forum's WTF code sniplet ever!



  • Ive posted a few WTFs from the java dev forums, but this one must take the cake... it might even be worthy of the front page.

     

    [url]http://forum.java.sun.com/thread.jspa?messageID=9421934[/url]

     

     i like that after a WTF amount of int declarations with WTF variable names, this guy has:

    <font color="navy">int</font> PIZZA = 0;

     



  • seriously we all have been students at one time, but someone please shoot the submitter of that code and plead Darwin made me do it. That person shouldn't be allowed to write anymore code and shouldn't be allowed to breed.



  • ok i said that that code is the best java forums wtf, but this one might actually be better:

     

    [url]http://forum.java.sun.com/thread.jspa?threadID=5120564[/url]

     just as long, but more complex, not just some cut and paste job, this one took some WTF talent
     



  • That is terrible, but since it's obviously amateur code in a non-production context, it's not really front page worthy.



  • From the coherence I guess he's in Middle School (or at least that's what I want to tell myself...). If his only previous experience is writing BASIC or Logo, and he spent his time playing Minesweeper in class so far during the Java course, then he just hasn't got any clue about arrays and abstraction.


    If he works at it hard, he'll be okay in a year or two. Really, this is the reason Alex doesn't post Student code - beginners make very ugly mistakes.

    Unless he's not actually in Middle School, but in his fifth semester of studying Computer Science. In that case, the above comment applies.



  • Here's my favorite part:

    	<font color="navy">if</font>(ao7==1&&ao8==1&&ao9==1)
    <font color="navy">{</font>
    g.drawString(<font color="red">"BYAAH! YOU WON!"</font>, 50, 50);
    <font color="navy">}</font>
    <font color="navy">if</font>(ax1==1&&ax2==1&&ax3==1)
    <font color="navy">{</font>
    g.drawString(<font color="red">"YOU NOOB! YOU LOST!"</font>, 50, 50);
    <font color="navy">}</font>
    <font color="navy">if</font>(ax1==1&&ax4==1&&ax7==1)
    <font color="navy">{</font>
    g.drawString(<font color="red">"YOU NOOB! YOU LOST!"</font>, 50, 50);
    <font color="navy">}</font>

     and so forth...

     

    On a related note, I'm reminded of this guy, who wrote a game called "Tic Tac Toe Plus," and thinks so highly of it he's spamming about 100 programming and game related usenet newsgroups about it's "pre-alpha release."  With updates every week!  He even responds to replies -- one of them claimed something to the effect that once he can solve a difficult algorithm like tic tac toe, he'll be ready to tackle almost any ai problem!



  • [quote user="petvirus"]http://forum.java.sun.com/thread.jspa?threadID=5120564[/quote]

    Some sort of red sticky substance started leaking from my ears shortly after I started to read that code.  That's without a doubt the stupidest and most trouble-filled program I've ever seen.  This took more diligence and effort than a simple "Brillant" job; this is a guy who's really trying, but failing miserably and violating every programming rule in the book in the process.

    Seriously, I mean:

    <font color="#000080">public</font> <font color="#000080">int</font> cometcoor1 = 0;
    <font color="#000080">public</font> <font color="#000080">int</font> cometcoor2 = 0;
    <font color="#000080">public</font> <font color="#000080">int</font> cometcoor3 = (<font color="#000080">int</font>)(Math.random() *500);
    <font color="#000080">public</font> <font color="#000080">int</font> cometcoor4 = 500;
    <font color="#000080">public</font> <font color="#000080">int</font> cometcoor11 = (<font color="#000080">int</font>)(Math.random() *500);
    <font color="#000080">public</font> <font color="#000080">int</font> cometcoor22 = (<font color="#000080">int</font>)(Math.random() *500);
    <font color="#000080">public</font> <font color="#000080">int</font> cometcoor33 = 0;
    <font color="#000080">public</font> <font color="#000080">int</font> cometcoor44 = (<font color="#000080">int</font>)(Math.random() *500);
    <font color="#000080">public</font> <font color="#000080">int</font> cometcoor111 = 0;
    <font color="#000080">public</font> <font color="#000080">int</font> cometcoor222 = 0;
    <font color="#000080">public</font> <font color="#000080">int</font> cometcoor333 = (<font color="#000080">int</font>)(Math.random() *500);
    <font color="#000080">public</font> <font color="#000080">int</font> cometcoor444 = 500;
    <font color="#000080">public</font> <font color="#000080">int</font> cometcoor1111 = (<font color="#000080">int</font>)(Math.random() *500);
    <font color="#000080">public</font> <font color="#000080">int</font> cometcoor2222 = (<font color="#000080">int</font>)(Math.random() *500);
    <font color="#000080">public</font> <font color="#000080">int</font> cometcoor3333 = 0;
    <font color="#000080">public</font> <font color="#000080">int</font> cometcoor4444 = (<font color="#000080">int</font>)(Math.random() *500);

    WTF is he even trying to do there?



  • [quote user="shadowman"]

    On a related note, I'm reminded of this guy, who wrote a game called "Tic Tac Toe Plus," and thinks so highly of it he's spamming about 100 programming and game related usenet newsgroups about it's "pre-alpha release."  With updates every week!  He even responds to replies -- one of them claimed something to the effect that once he can solve a difficult algorithm like tic tac toe, he'll be ready to tackle almost any ai problem!

    [/quote]

    Someone should show him one of those novelty arcade things where you play tic tac toe versus a chicken, to illustrate the exact level of AI he's mastered.

    And then introduce him to game theory.

     



  • [quote user="shadowman"]On a related note, I'm reminded of this guy, who wrote a game called "Tic Tac Toe Plus," and thinks so highly of it he's spamming about 100 programming and game related usenet newsgroups about it's "pre-alpha release."  With updates every week!  He even responds to replies -- one of them claimed something to the effect that once he can solve a difficult algorithm like tic tac toe, he'll be ready to tackle almost any ai problem![/quote]

    Can anybody paste (or link to) a place where I can read "The Story Behind Tic Tac Toe Plus"?  I want to read what he has to say but you have to request permission to join his stupid community to do so.

    Just for a laugh.  I mean, I did a Tic-Tac-Toe playing thing in like three days as the first assignment in my AI class in college and I'll be the first to tell you that it's trivially simple.  The code was about a page long.  I don't get how this guy thinks it's so revolutionary.  I'm curious if he'll try to charge money for it?



  • Does Java have a lint (jint?) type of program? Because that first one could desperately use it.

    Oh god, he posts hundreds of lines of commented out code and seriously expects someone to help him. 



  • The sad part is he steadfastly refuses any sort of advice to make the code better (I've only got 8 more days).

    His "This used to work but now it doesn't" complaint just reminds me of the joys of source control, and reminds me how amazing it is that I didn't accidenttaly destroy any important projects when flying without it at school.



  • [quote user="petvirus"]

    Ive posted a few WTFs from the java dev forums, but this one must take the cake... it might even be worthy of the front page.

     

    [url]http://forum.java.sun.com/thread.jspa?messageID=9421934[/url]

     

     i like that after a WTF amount of int declarations with WTF variable names, this guy has:

    <font color="#000080">int</font> PIZZA = 0;

     

    [/quote]

    I may be a boneheaded programmer, or a noob, and hate pointers and C style IO, but i wrote better code than that at an early age. and arrays aren't that hard, really. (he was complaining about being lazy so he didn't want to use arrays... sounds more like he didn't really understand them)

     



  • [quote user="shadowman"]

    Here's my favorite part:

    	<font color="navy">if</font>(ao7==1&&ao8==1&&ao9==1)
    <font color="navy">{</font>
    g.drawString(<font color="red">"BYAAH! YOU WON!"</font>, 50, 50);
    <font color="navy">}</font>
    <font color="navy">if</font>(ax1==1&&ax2==1&&ax3==1)
    <font color="navy">{</font>
    g.drawString(<font color="red">"YOU NOOB! YOU LOST!"</font>, 50, 50);
    <font color="navy">}</font>
    <font color="navy">if</font>(ax1==1&&ax4==1&&ax7==1)
    <font color="navy">{</font>
    g.drawString(<font color="red">"YOU NOOB! YOU LOST!"</font>, 50, 50);
    <font color="navy">}</font>

     and so forth...

     

    On a related note, I'm reminded of this guy, who wrote a game called "Tic Tac Toe Plus," and thinks so highly of it he's spamming about 100 programming and game related usenet newsgroups about it's "pre-alpha release."  With updates every week!  He even responds to replies -- one of them claimed something to the effect that once he can solve a difficult algorithm like tic tac toe, he'll be ready to tackle almost any ai problem!

    [/quote]

    You violated the PD! You're not supposed to post, let alone link back here. You're supposed to have your laugh at the classic, pristine beauty and move on, not invite drama (remember Virtudyne?). Geez, some never learn.

    Anyone notice how much e-peen competition is going on in the threads between those three classmates? It's a redneck contest - the muddiest one at the end wins.



  • The real WTF is this response from BlindSquirrel on the moonlander thread:


    @BlindSqurirrel said:

    My tic tac toe code has all those variables as a joke. Over 3/4 of them are not used in my program. They were used in my old copy of the program when i used all fors and ifs, and no cases. I jsut copied them over with the other accidently.



    That's ... just ... I'm speechless.


    -mike



  • [quote user="mrsticks1982"]seriously we all have been students at one time, but someone please shoot the submitter of that code and plead Darwin made me do it. That person shouldn't be allowed to write anymore code and shouldn't be allowed to breed.
    [/quote]

     

    The two best parts are the "I'm too lazy to do it better" (I look forward to mentoring this idiot at some future job). and the "my professor wants me to use arrays". Best time to learn that the "boss' doesn't know best is RIGHT NOW. Do it the right way, not the boss' way.

     



  • [quote user="foxyshadis"]

    You violated the PD! You're not supposed to post, let alone link back here. You're supposed to have your laugh at the classic, pristine beauty and move on, not invite drama (remember Virtudyne?). Geez, some never learn.

    Anyone notice how much e-peen competition is going on in the threads between those three classmates? It's a redneck contest - the muddiest one at the end wins.

    [/quote]

    Hmmm... I guess I'm just one of those guys who can't resist stirring the pot a little.  Surely it will come back to bite me in the ass one of these days. ;)

    Er, PD? Police Department?  Public Domain? Parkinson's Disease?  I give up. No wonder I violated it!

     

     



  • [quote user="unklegwar"]Best time to learn that the "boss' doesn't know best is RIGHT NOW. Do it the right way, not the boss' way.[/quote]

    ...And receive an F on the assignment for not using arrays (which I'm guessing was the whole point of the exercise, to test their knowledge of arrays which they just learned)?



  • Wow these guys are complete idiots. I think they are in like 5th grade. They must have just taken snippets of code from their book and tried to put it together. They obviously are either very young or metally retarded. They need to be sat down and talked to.



  • [quote user="petvirus"]

    ok i said that that code is the best java forums wtf, but this one might actually be better:

     

    [url]http://forum.java.sun.com/thread.jspa?threadID=5120564[/url]

     just as long, but more complex, not just some cut and paste job, this one took some WTF talent
     

    [/quote]

    Can you believe the guy who wrote the tic tac toe code comments in this post?

    This is garbage all garbage I say. You need to jsut destroy the entire thing. You are such a noob in Java intro class. My Tic Tac Toe owns your program in both lines and skill!:)



  • [quote user="BlindSquirrel"]

    Wow these guys are complete idiots. I think they are in like 5th grade. They must have just taken snippets of code from their book and tried to put it together. They obviously are either very young or metally retarded. They need to be sat down and talked to.

    [/quote]

     

    My first instinct here would be to say that this must be some other idiot who has decided to post as the original idiot for purposes noone here could ever understand (thankfully).

    However, when I read what he wrote, and how he calls someone 'metally retarded' it starts to dawn on me, I think we have the real deal here.

    Expect a lot of really stupid postings from this guy.

    Oh, and whoever informed the java forum of this post, thanks a lot. See what we get now?



  • [quote user="shadowman"][quote user="foxyshadis"]

    You violated the PD! You're not supposed to post, let alone link back here. You're supposed to have your laugh at the classic, pristine beauty and move on, not invite drama (remember Virtudyne?). Geez, some never learn.

    Anyone notice how much e-peen competition is going on in the threads between those three classmates? It's a redneck contest - the muddiest one at the end wins.

    [/quote]

    Hmmm... I guess I'm just one of those guys who can't resist stirring the pot a little.  Surely it will come back to bite me in the ass one of these days. ;)

    Er, PD? Police Department?  Public Domain? Parkinson's Disease?  I give up. No wonder I violated it!
     [/quote]

    Prime Directive, so called because of chet's nerdiness I suppose, but it comes from PoE, where pointing and laughing at the peanut gallery is a whole culture: http://www.portalofevil.com/forumrules.html 



  • A guy I was at school with wrote a program that shuffled a pack of cards, dealt out four hands of thirteen and displayed them on the screen.

    I couldn't understand why he was so proud of it until he showed me the source code and I saw he hadn't used a single array.

    I can't think how I'd even begin to write a program like that.



  • Code generator that does use arrays.



  • WOW he only has 421 lines now instead of 1600+.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.