Galapagos

« Return to Article
  • Memleak 2013-08-05 06:25
    Dim F As String
    Dim R As String
    Dim I As String
    Dim S As String
    Dim T As String

    comment.text = F & R & I & S & T
  • moz 2013-08-05 06:27
    I'm still trying to work out whether the code is better or worse than the paragraphs above it.
  • God... 2013-08-05 06:34

    When Darwin visited the Galapagos, he saw that the relative isolation of the islands had allowed species to evolve into forms that would never have happened on the mainland. This insight helped him to refine his theory of evolution by natural selection.


    This is TRWTF. Everyone knows I created everything 6000 years ago.
  • justsomedudette 2013-08-05 06:35
    One can only hope that that particular code is heading down an evolutionary cul-de-sac.
  • Mike 2013-08-05 06:39
    Better hope that code isn't an aggressive invasive species
  • John Jiang 2013-08-05 06:47
    As for the "e3" variable, probably just an event handler. EventArgs usually get the variable "e".
  • ubersoldat 2013-08-05 06:49
    Man, imagine if God used VB to write our genetic code and everything was like this.

    Hmmm... it would be funny if someone had the time to write some "If God used programming language X" jokes.

    If God used Java we all be snails
    If God used C++ we all be gazelles with a heart problem
    If God used C we all be virus
    If God used PHP we all be Chimeras
    If God used Bash we all be droids
    If God used VB we wouldn't exist
    If God used Perl we would all be plants (my imagination has a limit)
    If God used Python we would all be British
    If God used Brainfuck we would all be Humans
    If God used JavaScript we would all be males (you know, because of single threading in JS)
    If God used C# we would all be slaves!!!

    Feel free to modify or extend, this work is CC BY-SA
  • I see what you did there... 2013-08-05 06:50
    I can see that the REAL wtf is variable 'e3'. The name completely disregards the logical, alphabetical naming scheme for no discernable reason. The code would be much better if this variable was renamed into 'e'.
  • QJo 2013-08-05 06:55
    moz:
    I'm still trying to work out whether the code is better or worse than the paragraphs above it.


    I notice there's been a lot of rudeness currently being expressed at the presentational style (by which I mean the surrounding text into which the WTF is customarily framed).

    I would opine that this is just a case of "them as can, does; them as can't, teach; them as can't teach, criticise."

    In short, if you think you can do better yourself, start your own website. If not, shut up.
  • I_Taught_VB3 2013-08-05 06:58
    Visual Basic - the language of brittle, sharp coral islands barely above water at the best of times.
  • QJo 2013-08-05 06:59
    ubersoldat:
    Man, imagine if God used VB to write our genetic code and everything was like this.

    Hmmm... it would be funny if someone had the time to write some "If God used programming language X" jokes.

    If God used Java we all be snails
    If God used C++ we all be gazelles with a heart problem
    If God used C we all be virus
    If God used PHP we all be Chimeras
    If God used Bash we all be droids
    If God used VB we wouldn't exist
    If God used Perl we would all be plants (my imagination has a limit)
    If God used Python we would all be British
    If God used Brainfuck we would all be Humans
    If God used JavaScript we would all be males (you know, because of single threading in JS)
    If God used C# we would all be slaves!!!

    Feel free to modify or extend, this work is CC BY-SA


    If God used BASIC we'd all be Disney cartoon characters.
    If God used FORTRAN we'd all be dinosaurs.
    If God used Ada we'd all be military tanks.
    If God used Ook we'd all be at Unseen University.
  • nulla 2013-08-05 07:00
    London is not a vacation destination.
  • eViLegion 2013-08-05 07:03
    This is some of the cleanest, tightest, well engineered VB.NET code I have ever seen.

    Nice work, whoever wrote it!
  • Mohn JcCarthy 2013-08-05 07:04
    Galapapos;
  • eViLegion 2013-08-05 07:05
    nulla:
    London is not a vacation destination.


    (1) Yeah it is. It has over 15 million tourists a year.
    (2) Why are you attempting to contradict nothing?
  • Herwig 2013-08-05 07:10
    eViLegion:
    This is some of the cleanest, tightest, well engineered VB.NET code I have ever seen.

    Nice work, whoever wrote it!

    I agree.
  • moz 2013-08-05 07:12
    QJo:
    I would opine that this is just a case of "them as can, does; them as can't, teach; them as can't teach, criticise."

    In short, if you think you can do better yourself, start your own website. If not, shut up.

    Thank you for your constructive comments.
  • eViLegion 2013-08-05 07:24
    QJo:
    "them as can, does; them as can't, teach; them as can't teach, criticise."


    Yeah, but that is just bullshit.

    If "them as can, does" then there are a body of capable people, who are in a privileged position to look at "them as can't, teaching".

    From that position, it is entirely justified to criticize the poor quality of teaching.
  • Remy Porter 2013-08-05 07:32
    Use the source, eViLegion, use the source.

    And yeah, it's totally a vacation destination.
  • snoofle 2013-08-05 07:33
    nulla:
    London is not a vacation destination.
    Whenever I go on vacation, it rains. We went to London some time back. It rained. Ergo, London is a vacation destination!
  • QJo 2013-08-05 07:38
    eViLegion:
    QJo:
    "them as can, does; them as can't, teach; them as can't teach, criticise."


    Yeah, but that is just bullshit.

    If "them as can, does" then there are a body of capable people, who are in a privileged position to look at "them as can't, teaching".

    From that position, it is entirely justified to criticize the poor quality of teaching.


    It is frequently the case where people who are unable to perform adequately at the proverbial coalface of Making Things Happen in an industrial environment are perfectly capable, and more than adequate, of passing on the knowledge of the business for which they were trained.

    On the other hand, from my experience, those who are in their element at the white-hot end of high-intensity development are complete rubbish at being able to pass on their knowledge to others.

    But then I will have to concede that the end results of mediocre teaching can often end up warming the chairs of offices within the same vicinity of those genii who, while themselves are unable to teach, are in a position to judge whether the results of that teaching indicate whether the process itself has been adequate or not.

    On the other hand, the question always needs to be asked: is a rubbish graduate the fault of a rubbish teacher or the fault of themselves being intrinsically rubbish?
  • QJo 2013-08-05 07:40
    QJo:
    eViLegion:
    QJo:
    "them as can, does; them as can't, teach; them as can't teach, criticise."


    Yeah, but that is just bullshit.

    If "them as can, does" then there are a body of capable people, who are in a privileged position to look at "them as can't, teaching".

    From that position, it is entirely justified to criticize the poor quality of teaching.


    It is frequently the case where people who are unable to perform adequately at the proverbial coalface of Making Things Happen in an industrial environment are perfectly capable, and more than adequate, of passing on the knowledge of the business for which they were trained.

    On the other hand, from my experience, those who are in their element at the white-hot end of high-intensity development are complete rubbish at being able to pass on their knowledge to others.

    But then I will have to concede that the end results of mediocre teaching can often end up warming the chairs of offices within the same vicinity of those genii who, while themselves are unable to teach, are in a position to judge whether the results of that teaching indicate whether the process itself has been adequate or not.

    On the other hand, the question always needs to be asked: is a rubbish graduate the fault of a rubbish teacher or the fault of themselves being intrinsically rubbish?


    Sorry, the 2nd para should have read: "... are often complete rubbish at being able to pass on their knowledge to others.
  • Franky 2013-08-05 07:47
    Can someone spell out to me what that code does? My eyes hurt too much before I could discern the logic ;)

    captcha: inhibeo - I suppress
  • jEDI 2013-08-05 07:55
    QJo:

    I would opine that this is just a case of "them as can, does; them as can't, teach; them as can't teach, criticise."


    I've always wondered who teaches the teachers
  • Erik 2013-08-05 08:07
    I'd say the real WTF would be: "This co-worker didn’t work on any of the regular teams, and SPENT ALL OF THEIR TIME WORKING IN ISOLATION on projects no one else ever touched."

    Personally I always perform badly when pushed aside in a corner with obscure systems or languages no one wants to touch. Most programming tasks would be helped by a little team work.

    Although I guess in the mindset of my manager just making it work is a splendid result...
  • RonBeck62 2013-08-05 08:09
    Frankly:
    Can someone spell out to me what that code does?


    Mostly it generates fodder for the garbage collector. As a side effect, it builds a series of HTML pages to display the contents of a database. It was written by a dinosaur who hasn't updated his programming skill set since he learned how to use QuickBasic. At the very least, he needs to discover the magic of collections. Especially System.Text.StringBuilder
  • DonaldK 2013-08-05 08:11
    QJo:
    If God used Ook we'd all be at Unseen University.


    Ook oooooook!!!! Hahaha good one. Love the Discworld too.
  • n1ghtmare 2013-08-05 08:14
    This made me LOL !
  • Alvie 2013-08-05 08:16
    return f & a & i & l;
  • minusSeven 2013-08-05 08:19
    Brought tears to my eyes. Once upon a time I used to write code like that. Those were the days!!!!
  • 50% Opacity 2013-08-05 08:25
    ubersoldat:

    If God used PHP we all be Chimeras


    I for one... would find that pretty awesome!
  • QJo 2013-08-05 08:31
    QJo:
    ubersoldat:
    Man, imagine if God used VB to write our genetic code and everything was like this.

    Hmmm... it would be funny if someone had the time to write some "If God used programming language X" jokes.

    If God used Java we all be snails
    If God used C++ we all be gazelles with a heart problem
    If God used C we all be virus
    If God used PHP we all be Chimeras
    If God used Bash we all be droids
    If God used VB we wouldn't exist
    If God used Perl we would all be plants (my imagination has a limit)
    If God used Python we would all be British
    If God used Brainfuck we would all be Humans
    If God used JavaScript we would all be males (you know, because of single threading in JS)
    If God used C# we would all be slaves!!!

    Feel free to modify or extend, this work is CC BY-SA


    If God used BASIC we'd all be Disney cartoon characters.
    If God used FORTRAN we'd all be dinosaurs.
    If God used Ada we'd all be military tanks.
    If God used Ook we'd all be at Unseen University.



    /
    | we
    | occam
    | be
    | once
    | God
    / all
    \ If
    | once
    | would
    | at
    | used
    \
  • EvilSnack 2013-08-05 08:36
    In the United States, it turns out to be people of dubious competence.

    Captcha 'luctus': "We luctus onto a good teacher for once."
  • Damien 2013-08-05 08:41
    Unfortunately, the e3 variable has an "explanation". This is almost certainly running inside an event handler, that be default has a parameter declared as "e as EventArgs", and we all know that you cannot rename parameters, ever, so e had to be avoided.
  • Krunt 2013-08-05 08:50
    MFW "programmers" posting here think the language used dictates the quality of the code.

    MFW "programmers" posting here think a language's semantics dictate the outcome.

    MFW I have no face.
  • eViLegion 2013-08-05 08:57
    E3 is defunct?

    E3 isn't defunct!

    Oh... defuct... I suppose E3 might be that, but I don't know what that is.
  • dkf 2013-08-05 09:05
    snoofle:
    nulla:
    London is not a vacation destination.
    Whenever I go on vacation, it rains. We went to London some time back. It rained. Ergo, London is a vacation destination!
    That proves it for sure.
  • Rnd( 2013-08-05 09:06
    QJo:
    ubersoldat:
    Man, imagine if God used VB to write our genetic code and everything was like this.

    Hmmm... it would be funny if someone had the time to write some "If God used programming language X" jokes.

    If God used Java we all be snails
    If God used C++ we all be gazelles with a heart problem
    If God used C we all be virus
    If God used PHP we all be Chimeras
    If God used Bash we all be droids
    If God used VB we wouldn't exist
    If God used Perl we would all be plants (my imagination has a limit)
    If God used Python we would all be British
    If God used Brainfuck we would all be Humans
    If God used JavaScript we would all be males (you know, because of single threading in JS)
    If God used C# we would all be slaves!!!

    Feel free to modify or extend, this work is CC BY-SA


    If God used BASIC we'd all be Disney cartoon characters.
    If God used FORTRAN we'd all be dinosaurs.
    If God used Ada we'd all be military tanks.
    If God used Ook we'd all be at Unseen University.


    If God used COBOL we'd all be?
  • QJo 2013-08-05 09:08
    QJo:
    QJo:
    ubersoldat:
    Man, imagine if God used VB to write our genetic code and everything was like this.

    Hmmm... it would be funny if someone had the time to write some "If God used programming language X" jokes.

    If God used Java we all be snails
    If God used C++ we all be gazelles with a heart problem
    If God used C we all be virus
    If God used PHP we all be Chimeras
    If God used Bash we all be droids
    If God used VB we wouldn't exist
    If God used Perl we would all be plants (my imagination has a limit)
    If God used Python we would all be British
    If God used Brainfuck we would all be Humans
    If God used JavaScript we would all be males (you know, because of single threading in JS)
    If God used C# we would all be slaves!!!

    Feel free to modify or extend, this work is CC BY-SA


    If God used BASIC we'd all be Disney cartoon characters.
    If God used FORTRAN we'd all be dinosaurs.
    If God used Ada we'd all be military tanks.
    If God used Ook we'd all be at Unseen University.



    /
    | we
    | occam
    | be
    | once
    | God
    / all
    \ If
    | once
    | would
    | at
    | used
    \


    Sorry, should have been:


    /
    | we
    | occam
    | be
    | once
    | God
    / all
    \ If
    | alive
    | would
    | at
    | used
    \
  • pjt33 2013-08-05 09:26
    Damien:
    Unfortunately, the e3 variable has an "explanation". This is almost certainly running inside an event handler, that be default has a parameter declared as "e as EventArgs", and we all know that you cannot rename parameters, ever, so e had to be avoided.

    That doesn't explain x2, y2, z2. An alternative hypothesis would be that the programmer handled change requests by creating a new variable, but not removing the old one until he was sure that the new one was giving correct output.
  • QJo 2013-08-05 09:29
    Rnd(:
    QJo:
    ubersoldat:
    Man, imagine if God used VB to write our genetic code and everything was like this.

    Hmmm... it would be funny if someone had the time to write some "If God used programming language X" jokes.

    If God used Java we all be snails
    If God used C++ we all be gazelles with a heart problem
    If God used C we all be virus
    If God used PHP we all be Chimeras
    If God used Bash we all be droids
    If God used VB we wouldn't exist
    If God used Perl we would all be plants (my imagination has a limit)
    If God used Python we would all be British
    If God used Brainfuck we would all be Humans
    If God used JavaScript we would all be males (you know, because of single threading in JS)
    If God used C# we would all be slaves!!!

    Feel free to modify or extend, this work is CC BY-SA


    If God used BASIC we'd all be Disney cartoon characters.
    If God used FORTRAN we'd all be dinosaurs.
    If God used Ada we'd all be military tanks.
    If God used Ook we'd all be at Unseen University.


    If God used COBOL we'd all be?


    #DECLARE

    IF IT WAS THE CASE THAT GOD WAS IN THE HABIT OF UTILISING COBOL AS HIS MAIN TOOL FOR THE MANUFACTURE OF CREATION ALGORITHMS, IT WOULD VERY LIKELY BE THE CASE THAT WE WOULD ALL BE CONSIDERABLY MORE VERBOSE THAN WE ALREADY HAVE THE UNFORTUNATE TENDENCY SOMETIMES TO BE
  • radarbob 2013-08-05 09:33
    Einstein was right!
  • radarbob 2013-08-05 09:34
    eViLegion:
    This is some of the cleanest, tightest, well engineered VB.NET code I have ever seen.

    Nice work, whoever wrote it!


    Einstein was right!
  • Rob G 2013-08-05 09:37
    OK, I'll shut up and you've just lost a reader by being rude to other readers.

    If you can't take criticism, stop publishing.
  • mockmyberet 2013-08-05 09:39
    Ever wonder if these guys wrote a script to write their script?
  • to p or not to p 2013-08-05 09:39
    Why is the p variable not concatenated with the rest? This, of course, is the REAL wtf.
  • bjolling 2013-08-05 09:40
    RonBeck62:
    Frankly:
    Can someone spell out to me what that code does?


    Mostly it generates fodder for the garbage collector. As a side effect, it builds a series of HTML pages to display the contents of a database. It was written by a dinosaur who hasn't updated his programming skill set since he learned how to use QuickBasic. At the very least, he needs to discover the magic of collections. Especially System.Text.StringBuilder
    StringBuilder?? Nowadays .NET includes something called ASP.NET for generating HTML.
  • eViLegion 2013-08-05 09:40
    Rob G:
    OK, I'll shut up and you've just lost a reader by being rude to other readers.

    If you can't take criticism, stop publishing.


    Who invited THAT guy?

    Go on... own up...

    Surely SOMEONE knows who the hell he was?
  • Damien 2013-08-05 09:47
    pjt33:
    Damien:
    Unfortunately, the e3 variable has an "explanation". This is almost certainly running inside an event handler, that be default has a parameter declared as "e as EventArgs", and we all know that you cannot rename parameters, ever, so e had to be avoided.

    That doesn't explain x2, y2, z2. An alternative hypothesis would be that the programmer handled change requests by creating a new variable, but not removing the old one until he was sure that the new one was giving correct output.


    All of the other numbered variables appear in sequence. Note that the comments indicate that some snipping has occurred in the declarations and assignments.
  • anonymous_coder() 2013-08-05 09:57
    eViLegion:
    Rob G:
    OK, I'll shut up and you've just lost a reader by being rude to other readers.

    If you can't take criticism, stop publishing.


    Who invited THAT guy?

    Go on... own up...

    Surely SOMEONE knows who the hell he was?


    A special snowflake, whose opinions are far more valid than the rest of the world's. Kind of adorable, showing their ability to passive-agressively call others out for behaving however the f**k they want ON THEIR OWN BLOG.
  • tragomaskhalos 2013-08-05 10:06
    I have seen code exactly like this to create monster SQL queries (complete with the obligatory injection vulnerabilities).

    "Give me Here documents or give me death" ....
  • eViLegion 2013-08-05 10:09
    Strangely, he was having a go at QJo. I was under the (possibly mistaken) impression that QJo is just another regular, not one of the staff?
  • QJo 2013-08-05 10:16
    eViLegion:
    Strangely, he was having a go at QJo. I was under the (possibly mistaken) impression that QJo is just another regular, not one of the staff?


    No, definitely not on the staff, a devoted regular, getting irritated at the low levels of tolerance towards the writing.

    Apologies if I have been the cause of people who don't like this site no longer reading it. As for me, I don't believe people should be allowed that sort of choice. Pardon my irony.
  • Paul Neumann 2013-08-05 10:17
    Rob G:
    OK, I'll shut up and you've just lost a reader by being rude to other readers.

    If you can't take criticism, stop publishing.
    QFT! i.e. practice what you preach.

    Also, learn to read the meta.
  • Guestimate 2013-08-05 10:27
    I would opine that this is just a case of "them as can, does; them as can't, teach; them as can't teach, criticise."

    In short, if you think you can do better yourself, start your own website. If not, shut up.

    And lets not forget the next one:

    "Them who can't stand critique utter some forbidding others to do the same" :-)
  • foo 2013-08-05 10:28
    QJo:
    moz:
    I'm still trying to work out whether the code is better or worse than the paragraphs above it.


    I notice there's been a lot of rudeness currently being expressed at the presentational style (by which I mean the surrounding text into which the WTF is customarily framed).

    I would opine that this is just a case of "them as can, does; them as can't, teach; them as can't teach, criticise."

    In short, if you think you can do better yourself, start your own website. If not, shut up.
    Your criticism is appreciated.
  • IBM 3277 2013-08-05 10:32
    If God used COBOL we all see the world thru 80x24 tty instead of Google glasses
  • foo 2013-08-05 10:33
    God...:

    When Darwin visited the Galapagos, he saw that the relative isolation of the islands had allowed species to evolve into forms that would never have happened on the mainland. This insight helped him to refine his theory of evolution by natural selection.


    This is TRWTF. Everyone knows I created everything 6000 years ago.
    Then why did you create Darwin?
  • Zylon 2013-08-05 10:33
    Memleak:
    Dim F As String
    Dim R As String
    Dim I As String
    Dim S As String
    Dim T As String

    comment.text = F & R & I & S & T

    Congratulations, you just concatenated five undefined variables.
  • eViLegion 2013-08-05 10:37
    foo:
    God...:

    When Darwin visited the Galapagos, he saw that the relative isolation of the islands had allowed species to evolve into forms that would never have happened on the mainland. This insight helped him to refine his theory of evolution by natural selection.


    This is TRWTF. Everyone knows I created everything 6000 years ago.
    Then why did you create Darwin?


    Trying to have a rational discussion about evolution with someone role-playing God, isn't likely to lead to the satisfying victory that you're looking for.
  • fgfg 2013-08-05 10:37
    Franky:
    Can someone spell out to me what that code does? My eyes hurt too much before I could discern the logic ;)


    It sends an email to the presidents daughter, asking for a date.
  • anonymous 2013-08-05 10:45
    Franky:
    Can someone spell out to me what that code does? My eyes hurt too much before I could discern the logic ;)

    captcha: inhibeo - I suppress
    Basically this: it generates a list of demographics and spits out a mass of godawful HTML for each one.
    'Get Demographics
    
    Dim list As ArrayList = GetDemographics()
    If list.Count > 0 Then
    For Each
    item As Demographics In list
    If item.Dem_last_name > "" And item.Dem_first_name > "" Then
    Dim
    elem As New Label
    elem.ID = item.email_address
    elem.Text = "<table width='100%'><tr><td align='center'><img src='/content/images/logo.png' Width='150px' />" _
    & "<br /><big><big><big><b>Demographics</b></big></big></big><br />" _
    & "<small>Patient Name:</small><br />" & item.Dem_first_name & " " & item.Dem_last_name _
    & "<br /><br /></td></tr></table><table cellpadding='0' cellspacing='0' width='85%' bgcolor='#ffffff'>" _
    & "<tr><td colspan='5'><b>How did you hear about us?</b><br />" & item.marketing & "</td></tr>" _
    & "<tr><td colspan='2' width='49%' class='formsheader'><br /><br /><b>Billing Address</b></td>" _
    & "<td width='1%'></td><td colspan='2' width='49%' class='formsheader'><br /><br />" _
    & "Secondary Address</td></tr><tr><td colspan='2' valign='top'>" & item.address_line_1 & "<br />" _
    & item.address_line_2 & "<div class='formsx'><small>Street</small></div></td>" _
    & "<td rowspan='2' style='border-left:solid #999;'><img src='/content/images/spacer.png' " _
    & "width='1px' height='1px' /></td><td colspan='2' valign='top'>" _
    & item.sec_address_line_1 & "<br />" & item.sec_address_line_2 _
    'Cut, so as not to belabor the point
    & item.PharmName & "<div class='formsx'><small>Pharmacy Name</small></div><br />" _
    & item.PharmStreet & "<br /> " & item.PharmCity & ", " & item.PharmState & " " & item.PharmZip _
    & "<br /><div class='formsx'><small>Pharmacy Address</small></div></td><td valign='top'><br />" _
    & item.PharmFax & "<br /><div class='formsx'><small>Pharmacy Fax</small></div><br />" _
    & item.PharmPhone & "<br /><div class='formsx'><small>Pharmacy Phone</small></div></td>" _
    & "</tr><tr><td><div style='page-break-after:always;'></div></td></tr></table>"
    PlaceHolder2.Controls.Add(elem)
    End If
    Next

    Else
    Dim
    elem As New Label
    elem.ID = "email_address"
    elem.Text = "No Results"
    PlaceHolder2.Controls.Add(elem)
    End If
  • Steve The Cynic 2013-08-05 10:50
    tragomaskhalos:
    I have seen code exactly like this to create monster SQL queries (complete with the obligatory injection vulnerabilities).

    "Give me Here documents or give me death" ....

    OK, here's some Here documents. Please keep them to yourself.
  • eViLegion 2013-08-05 11:22
    Steve The Cynic:
    tragomaskhalos:
    I have seen code exactly like this to create monster SQL queries (complete with the obligatory injection vulnerabilities).

    "Give me Here documents or give me death" ....

    OK, here's some Here documents. Please keep them to yourself.


    Gah? He offered the opportunity to kill him, and you went with handing over the documents?
  • qbolec 2013-08-05 11:39
    I think that author was asked to reorder the output so that the e3 column was moved to the left.

    TRWTF is then that author reordered variables' declartaions as well.
  • Coyne 2013-08-05 11:39
    Hmmmm...match-book school of computer programming?
  • Brompot 2013-08-05 11:39
    nulla:
    London is not a vacation destination.


    Quite right. London is a holiday destination.
  • eViLegion 2013-08-05 11:48
    Brompot:
    nulla:
    London is not a vacation destination.


    Quite right. London is a holiday destination.


    Yeah... I've always thought the American "vacation" is a weird term; why use a word which essentially means "making the home empty"?
    I mean, yeah, you do make your home empty, but that is entirely a side effect of "going somewhere else that's nicer, for a while".

    Then again, I guess it makes no more sense than using a word for single day's religious festival.
  • operagost 2013-08-05 12:17
    I_Taught_VB3:
    Visual Basic - the language of brittle, sharp coral islands barely above water at the best of times.
    I'm not sure how VB is at fault when the programmer doesn't even know how to use arrays.
  • Adin Falkhoff 2013-08-05 12:19
    At least he typed them. I had a gig about a decade ago where I was welcomed by this:

    ON ERROR RESUME NEXT

    Dim A,B,C,D,E,F,...ZZ

    A = code
    B = A + CODE
    S = "Address "

    etc

    And everything a VARIANT
  • ¯\(°_o)/¯ I DUNNO LOL 2013-08-05 12:22
    pjt33:
    That doesn't explain x2, y2, z2. An alternative hypothesis would be that the programmer handled change requests by creating a new variable, but not removing the old one until he was sure that the new one was giving correct output.
    Notice the snippage? There were apparently 78 lines being generated. If there had been 83 or more, e3 would have been changed to e4! (Obviously we're dealing with an inferior lifeform that doesn't understand the concept of zero.)

    If he had two brain cells instead one, he could have at least named them a01...a99 and not had the problem with 'e'. But that would be one step away from an array and a loop, which would be another slight evolutionary improvement (of the hundreds on the way to actual sane code).

    After all, if there's one thing about the Galapagos, it's that life there didn't evolve to survive around mainland animals. Its native species are just as fragile and hard to maintain as the code of Roberto's cow-orker.
  • operagost 2013-08-05 12:23
    eViLegion:
    Brompot:
    nulla:
    London is not a vacation destination.


    Quite right. London is a holiday destination.


    Yeah... I've always thought the American "vacation" is a weird term; why use a word which essentially means "making the home empty"?
    I mean, yeah, you do make your home empty, but that is entirely a side effect of "going somewhere else that's nicer, for a while".
    The fact that you're not home is the important part to other people.

    Then again, I guess it makes no more sense than using a word for single day's religious festival.

    My thought exactly. Ridiculing dialects is like playing global thermonuclear war.
  • God 2013-08-05 12:32
    If God used...


    You're all wrong. I used Ruby. Which is why there are ginger people.
  • ENOTTY 2013-08-05 12:38
    You could at least use XML literals to avoid those godawful line continuations.

    Dim html as String = <html>
    fuckity
    fuck
    bye
    </html>.Value

    I wish I never had to learn this.
  • The Bytemaster 2013-08-05 12:42
    Not only does this code pattern itself stink, but hits just about every one of my .Net pet peeves that coders do.

    • Use of ArrayList in any code after .Net 2.0 (extremely inefficient – requires casting everything to Object, which incurs boxing/unboxing)
    • Meaningless Variable names other than iterators
    • String concatenation, especially inside of a loop – that is what a StringBuilder is for, unless you really like creating and allocating hundreds of objects.
    • Has to call a method (GetDemographics) just to get a count of the array. If that is an expensive method, you just did it twice.
    • Comparison to an empty string before checking for null/nothing – Do you want to crash if the string is not initialized?
    • Use of the And operator in an if statement (& in C/C#) instead of AndAlso (&& in C/C#). Short-circuit that call, you are in a loop!

    If there was a bunch of conditional statements on the lines I might think theprogrammer could have been trying to speed up their code and did not know about StringBuilder. Concatenating the smaller with the logic there and then concatenating them at the end would likely have been faster. Though, this is VB with the & operator instead of the + operator, so it may behave differently. Normally, + in VB and C# is compiled to use String.Concat() which, with this many arguments, will take the length of all of the strings and allocate memory once for the total rather than the creation and release of immutable objects. Without the conditional statements, though, it would have been better to just put the entire statement into one big concatenation statement , for speed. Though, if you are doing that why would you be using a label object in the first place.

    Now that I reason through it, this classifies as a WTF no matter which direction you look at it.
  • Tom 2013-08-05 12:43
    One can argue whether that code evolved, or was created. But it certainly refutes the theory of intelligent design.

    And if God wrote our genetic code in SQL, we'd all be related.
  • The Bytemaster 2013-08-05 12:44
    ENOTTY:
    You could at least use XML literals to avoid those godawful line continuations.

    Dim html as String = <html>
    bye
    </html>.Value

    I wish I never had to learn this.

    Yes, but XML Literals were only introduced in the .Net 3.5 compilers alongside LINQ to .Net.

    Personally, the XML literals and processing in VB.Net is a good thing when you have to work with XML docuemnts, it is a real time saver. Just about the only thing I like about VB.Net vs other .Net languages.
  • JC 2013-08-05 12:47
    The Bytemaster:

    • Use of ArrayList in any code after .Net 2.0 (extremely inefficient – requires casting everything to Object, which incurs boxing/unboxing)


    As long as the elements in the ArrayList are reference types they won't be boxed/unboxed.
    It's still a sucky to do though.
  • Harrow 2013-08-05 12:49
    QJo:
    It is frequently the case where people who are unable to perform adequately at the proverbial coalface of Making Things Happen in an industrial environment are perfectly capable, and more than adequate, of passing on the knowledge of the business for which they were trained.

    On the other hand, from my experience, those who are in their element at the white-hot end of high-intensity development are complete rubbish at being able to pass on their knowledge to others.
    You realize, of course, that a white-hot intensity brought to a coalface might produce a problematical environment? This shows again the extreme danger of mixing metaphors, or even letting them get too near each other.

    -Harrow.
  • herby 2013-08-05 12:50
    eViLegion:
    nulla:
    London is not a vacation destination.


    (1) Yeah it is. It has over 15 million tourists a year.
    (2) Why are you attempting to contradict nothing?


    Wonderful place to visit. Do yourself a favor and get a 1 week pass for the underground. Saves LOTS of time, etc.

    Of course, visiting outside of the "rush" season (May-September) improves things. I last did it in the fall (late November). Be sure to bring a raincoat.

    If you want to have fun, go to the Underground Lost & Found and mention that you lost a black umbrella. Always a good joke!
  • eViLegion 2013-08-05 13:05
    operagost:
    The fact that you're not home is the important part to other people.


    Well screw them... I'm on holiday! I can't let the drudgery of their normal lives ruin my piña colada.

    operagost:
    Ridiculing dialects is like playing global thermonuclear war.


    Or tic tac toe!
  • David Carter 2013-08-05 13:08
    I used to write code like this. Hopefully not so much anymore.

    Looks like a good place for the Factory Pattern.

    Why is the output being put directly into a label?
  • foo 2013-08-05 13:11
    eViLegion:
    foo:
    God...:

    When Darwin visited the Galapagos, he saw that the relative isolation of the islands had allowed species to evolve into forms that would never have happened on the mainland. This insight helped him to refine his theory of evolution by natural selection.


    This is TRWTF. Everyone knows I created everything 6000 years ago.
    Then why did you create Darwin?


    Trying to have a rational discussion about evolution with someone role-playing God, isn't likely to lead to the satisfying victory that you're looking for.
    I'm not trying to have a rational discussion. I'm trying to get him to accidentally admit he exists which, by his own logic, means he doesn't exist.
  • The Sauce 2013-08-05 13:15
    I've been one to complain about the "flavor text" accompanying the articles from time to time, and yeah it's often pretty bad.

    But I thought it was pretty good here. A new high for Remy, even!
  • Anonymous Coward 2013-08-05 13:20
    QJo:
    ubersoldat:
    Man, imagine if God used VB to write our genetic code and everything was like this.

    Hmmm... it would be funny if someone had the time to write some "If God used programming language X" jokes.

    If God used Java we all be snails
    If God used C++ we all be gazelles with a heart problem
    If God used C we all be virus
    If God used PHP we all be Chimeras
    If God used Bash we all be droids
    If God used VB we wouldn't exist
    If God used Perl we would all be plants (my imagination has a limit)
    If God used Python we would all be British
    If God used Brainfuck we would all be Humans
    If God used JavaScript we would all be males (you know, because of single threading in JS)
    If God used C# we would all be slaves!!!

    Feel free to modify or extend, this work is CC BY-SA


    If God used BASIC we'd all be Disney cartoon characters.
    If God used FORTRAN we'd all be dinosaurs.
    If God used Ada we'd all be military tanks.
    If God used Ook we'd all be at Unseen University.


    Quad-Quote <- Backwards all we would be God if used APL.
  • SpewinCoffee 2013-08-05 13:35
    Nope. Not surprised. Seems to reference the medical industry which is TRWTF.
  • Damien 2013-08-05 13:37
    Zylon:
    Memleak:
    Dim F As String
    Dim R As String
    Dim I As String
    Dim S As String
    Dim T As String

    comment.text = F & R & I & S & T

    Congratulations, you just concatenated five undefined variables.


    Someone seems to be confused on the difference between definition and initialization. They may be uninitialized variables, but they're definitely defined.
  • Anonymouse 2013-08-05 13:44
    ubersoldat:
    If God used Java we all be snails
    If God used C++ we all be gazelles with a heart problem
    If God used C we all be virus
    If God used PHP we all be Chimeras
    If God used Bash we all be droids
    If God used VB we wouldn't exist
    If God used Perl we would all be plants (my imagination has a limit)
    If God used Python we would all be British
    If God used Brainfuck we would all be Humans
    If God used JavaScript we would all be males (you know, because of single threading in JS)
    If God used C# we would all be slaves!!!

    If God used JavaScript we would all be cookies
  • chubertdev 2013-08-05 13:47
    Oddly enough, I see magic variables about three times as often in C# .NET as I do in VB .NET. The VB .NET WTFs are a whole separate class, though.

    Remy, was this originally submitted as VB .NET code?
  • eViLegion 2013-08-05 14:17
    Damien:
    Zylon:
    Memleak:
    Dim F As String
    Dim R As String
    Dim I As String
    Dim S As String
    Dim T As String

    comment.text = F & R & I & S & T

    Congratulations, you just concatenated five undefined variables.


    Someone seems to be confused on the difference between definition and initialization. They may be uninitialized variables, but they're definitely defined.


    My VB.NET is a little rusty, but I was under the impression that by declaring a variable without initialisation, it would get automatically initialised by the compiler to NULL for most reference types, or some default for value types?

    I may be wrong, but assuming I'm not, concattenating 5 uninitialised strings would give you the empty string.
  • Oh THAT Brian! 2013-08-05 14:38
    I see it only took 7 comments before the VB bashing began.
  • chubertdev 2013-08-05 14:42
    eViLegion:
    My VB.NET is a little rusty, but I was under the impression that by declaring a variable without initialisation, it would get automatically initialised by the compiler to NULL for most reference types, or some default for value types?

    I may be wrong, but assuming I'm not, concattenating 5 uninitialised strings would give you the empty string.


    "Nothing", not NULL.

    But yes, the concatenation that you describe will give you an empty string, along with five compiler warnings.
  • Flaming Shearer 2013-08-05 14:52
    QJo:
    Rnd(:
    QJo:
    ubersoldat:
    Man, imagine if God used VB to write our genetic code and everything was like this.

    Hmmm... it would be funny if someone had the time to write some "If God used programming language X" jokes.

    If God used Java we all be snails
    If God used C++ we all be gazelles with a heart problem
    If God used C we all be virus
    If God used PHP we all be Chimeras
    If God used Bash we all be droids
    If God used VB we wouldn't exist
    If God used Perl we would all be plants (my imagination has a limit)
    If God used Python we would all be British
    If God used Brainfuck we would all be Humans
    If God used JavaScript we would all be males (you know, because of single threading in JS)
    If God used C# we would all be slaves!!!

    Feel free to modify or extend, this work is CC BY-SA


    If God used BASIC we'd all be Disney cartoon characters.
    If God used FORTRAN we'd all be dinosaurs.
    If God used Ada we'd all be military tanks.
    If God used Ook we'd all be at Unseen University.


    If God used COBOL we'd all be?


    #DECLARE

    IF IT WAS THE CASE THAT GOD WAS IN THE HABIT OF UTILISING COBOL AS HIS MAIN TOOL FOR THE MANUFACTURE OF CREATION ALGORITHMS, IT WOULD VERY LIKELY BE THE CASE THAT WE WOULD ALL BE CONSIDERABLY MORE VERBOSE THAN WE ALREADY HAVE THE UNFORTUNATE TENDENCY SOMETIMES TO BE


    +1E11
  • Anonypony 2013-08-05 14:56
    Dim _alphalist As String = a & b & c & d & e3 & f & g & h & i & j & k & l & m & n & o & q & r & s & t & u & v & w & x & y & z & a1 & b1 & c1 & d1 & e1 & f1 & g1 & h1 & i1 & j1 & k1 & l1 & m1 & n1 & o1 & p1 & q1 & r1 & s1 & t1 & u1 & v1 & w1 & x1 & y1 & z1 & a2 & b2 & c2 & d2 & e2 & f2 & g2 & h2 & i2 & j2 & k2 & l2 & m2 & n2 & o2 & p2 & q2 & r2 & s2 & t2 & u2 & v2 & w2 & x2 & y2 & z2


    I am brought to tears by the beauty of this code. It is like looking into the untamed face of the wrathful Divine. I AM UNWORTHY!

    Captcha: duis - unis duis tris Tetris!
  • Anonypony 2013-08-05 15:09
    If God used Lua we'd all be hookworms.
    If God used Mumps we'd all be X(^DNA("OID"))
    If God used SQL we'd all be <?= mysql_fetch_array(mysql_query("SELECT `trait` from `traits` where `lang` = '" . $_GET['lang'] . "'") ?>

  • Everyone 2013-08-05 15:18
    Yeah....listen, we've been meaning to talk to you about that.
  • ANON 2013-08-05 15:23
    God actually used Perl as scientific researchers have found out:

    http://xkcd.com/224/

    CAPTCHA: Eros - Didn't Eros create the world according to Greek mythology?
  • Steve Holdoway 2013-08-05 15:35
    -1 You missed the final full stop.
  • chubertdev 2013-08-05 15:38

    Dim _demox As New Label
    _demox.ID = p.email_address


    I wonder how well that works when two records have the same email address.
  • Lisp lover 2013-08-05 16:07
    Let's be honest, we all know that God wrote in LISP
    http://www.youtube.com/watch?v=5-OjTPj7K54 The Eternal Flame
  • foo 2013-08-05 16:44
    Flaming Shearer:
    QJo:
    Rnd(:
    QJo:
    ubersoldat:
    Man, imagine if God used VB to write our genetic code and everything was like this.

    Hmmm... it would be funny if someone had the time to write some "If God used programming language X" jokes.

    If God used Java we all be snails
    If God used C++ we all be gazelles with a heart problem
    If God used C we all be virus
    If God used PHP we all be Chimeras
    If God used Bash we all be droids
    If God used VB we wouldn't exist
    If God used Perl we would all be plants (my imagination has a limit)
    If God used Python we would all be British
    If God used Brainfuck we would all be Humans
    If God used JavaScript we would all be males (you know, because of single threading in JS)
    If God used C# we would all be slaves!!!

    Feel free to modify or extend, this work is CC BY-SA


    If God used BASIC we'd all be Disney cartoon characters.
    If God used FORTRAN we'd all be dinosaurs.
    If God used Ada we'd all be military tanks.
    If God used Ook we'd all be at Unseen University.


    If God used COBOL we'd all be?


    #DECLARE

    IF IT WAS THE CASE THAT GOD WAS IN THE HABIT OF UTILISING COBOL AS HIS MAIN TOOL FOR THE MANUFACTURE OF CREATION ALGORITHMS, IT WOULD VERY LIKELY BE THE CASE THAT WE WOULD ALL BE CONSIDERABLY MORE VERBOSE THAN WE ALREADY HAVE THE UNFORTUNATE TENDENCY SOMETIMES TO BE


    +1E11
    Steve Holdoway:
    -1 You missed the final full stop.
    So it's only +9.9999999999E10.
  • foo 2013-08-05 16:45
    Anonypony:
    If God used SQL, Bobby Tables would be a very dangerous person.
  • foo 2013-08-05 16:45
    Oh THAT Brian!:
    I see it only took 7 comments before the VB bashing began.
    Still 6 too many. (We need frist.)
  • n_slash_a 2013-08-05 16:46
    QJo:
    ubersoldat:
    Man, imagine if God used VB to write our genetic code and everything was like this.

    Hmmm... it would be funny if someone had the time to write some "If God used programming language X" jokes.

    If God used Java we all be snails
    If God used C++ we all be gazelles with a heart problem
    If God used C we all be virus
    If God used PHP we all be Chimeras
    If God used Bash we all be droids
    If God used VB we wouldn't exist
    If God used Perl we would all be plants (my imagination has a limit)
    If God used Python we would all be British
    If God used Brainfuck we would all be Humans
    If God used JavaScript we would all be males (you know, because of single threading in JS)
    If God used C# we would all be slaves!!!

    Feel free to modify or extend, this work is CC BY-SA


    If God used BASIC we'd all be Disney cartoon characters.
    If God used FORTRAN we'd all be dinosaurs.
    If God used Ada we'd all be military tanks.
    If God used Ook we'd all be at Unseen University.

    +1 for the Color of Magic reference :)
  • foo 2013-08-05 16:50
    ubersoldat:
    Man, imagine if God used VB to write our genetic code and everything was like this.

    Hmmm... it would be funny if someone had the time to write some "If God used programming language X" jokes.

    If God used Java we all be snails
    If God used C++ we all be gazelles with a heart problem
    If God used C we all be virus
    If God used PHP we all be Chimeras
    If God used Bash we all be droids
    If God used VB we wouldn't exist
    If God used Perl we would all be plants (my imagination has a limit)
    If God used Python we would all be British
    If God used Brainfuck we would all be Humans
    If God used JavaScript we would all be males (you know, because of single threading in JS)
    If God used C# we would all be slaves!!!

    Feel free to modify or extend, this work is CC BY-SA
    If God used TDWTF, we'd all be renamed, displaced from our familiar environment, embellished with dozens of extra, useless body parts and completely unrecognizable to anyone, including ourselves.

    And constantly updating our resumes.
  • The Bytemaster 2013-08-05 17:35
    eViLegion:
    Damien:
    Zylon:
    Memleak:
    Dim F As String
    Dim R As String
    Dim I As String
    Dim S As String
    Dim T As String

    comment.text = F & R & I & S & T

    Congratulations, you just concatenated five undefined variables.


    Someone seems to be confused on the difference between definition and initialization. They may be uninitialized variables, but they're definitely defined.


    My VB.NET is a little rusty, but I was under the impression that by declaring a variable without initialisation, it would get automatically initialised by the compiler to NULL for most reference types, or some default for value types?

    I may be wrong, but assuming I'm not, concattenating 5 uninitialised strings would give you the empty string.

    The default for reference types in VB.Net is Nothing, which is identical to NULL in C# an most .Net languages. In fact, one of the best ways to handle this comparison is using String.IsNullOrEmpty().

    VB.Net has two operators for strings. The "+" operator causes the string joing to act like it would in C# and other .Net languages. The special "&" concatination operator in VB.Net works more like older versions of VB and I believe uses the Visual Basic library to handle the concatination instead of String.Concat. This allows you to concatinate different data types and they will be converted usinge their ToString() method and also means that you don't have to worry about strings being Nothing/NULL, they will be treated just like empty strings with the "&" operator.

    So you are right - in VB.Net concatinating 5 unitialized strings, using &, will give you an empty string. Using + will cause an error.
  • chubertdev 2013-08-05 17:49
    The Bytemaster:
    The default for reference types in VB.Net is Nothing, which is identical to NULL in C# an most .Net languages. In fact, one of the best ways to handle this comparison is using String.IsNullOrEmpty().


    It's never null, haha.

    http://stackoverflow.com/questions/3002978/vb-net-documentation-and-exception-question

    The Bytemaster:
    VB.Net has two operators for strings. The "+" operator causes the string joing to act like it would in C# and other .Net languages. The special "&" concatination operator in VB.Net works more like older versions of VB and I believe uses the Visual Basic library to handle the concatination instead of String.Concat. This allows you to concatinate different data types and they will be converted usinge their ToString() method and also means that you don't have to worry about strings being Nothing/NULL, they will be treated just like empty strings with the "&" operator.

    So you are right - in VB.Net concatinating 5 unitialized strings, using &, will give you an empty string. Using + will cause an error.


    Super-WTFery. Consistently inconsistent.
  • God 2013-08-05 18:06
    foo:
    eViLegion:
    foo:
    God...:

    When Darwin visited the Galapagos, he saw that the relative isolation of the islands had allowed species to evolve into forms that would never have happened on the mainland. This insight helped him to refine his theory of evolution by natural selection.


    This is TRWTF. Everyone knows I created everything 6000 years ago.
    Then why did you create Darwin?


    Trying to have a rational discussion about evolution with someone role-playing God, isn't likely to lead to the satisfying victory that you're looking for.
    I'm not trying to have a rational discussion. I'm trying to get him to accidentally admit he exists which, by his own logic, means he doesn't exist.


    I'll have you know I am a lady. Also, if everyone stopped believing in me I would cease to exist.
  • foo 2013-08-05 18:09
    God:
    foo:
    eViLegion:
    foo:
    God...:

    When Darwin visited the Galapagos, he saw that the relative isolation of the islands had allowed species to evolve into forms that would never have happened on the mainland. This insight helped him to refine his theory of evolution by natural selection.


    This is TRWTF. Everyone knows I created everything 6000 years ago.
    Then why did you create Darwin?


    Trying to have a rational discussion about evolution with someone role-playing God, isn't likely to lead to the satisfying victory that you're looking for.
    I'm not trying to have a rational discussion. I'm trying to get her to accidentally admit she exists which, by her own logic, means she doesn't exist.


    I'll have you know I am a lady.
    Voila, you did admit it, so you don't exist. :)
  • God 2013-08-05 18:28
    foo:
    God:
    foo:
    eViLegion:
    foo:
    God...:

    When Darwin visited the Galapagos, he saw that the relative isolation of the islands had allowed species to evolve into forms that would never have happened on the mainland. This insight helped him to refine his theory of evolution by natural selection.


    This is TRWTF. Everyone knows I created everything 6000 years ago.
    Then why did you create Darwin?


    Trying to have a rational discussion about evolution with someone role-playing God, isn't likely to lead to the satisfying victory that you're looking for.
    I'm not trying to have a rational discussion. I'm trying to get her to accidentally admit she exists which, by her own logic, means she doesn't exist.


    I'll have you know I am a lady.
    Voila, you did admit it, so you don't exist. :)


    Well I can't hang around here all night. You lot don't smite yourselves you know. Although, you're pretty good at smiting each other.

    *poof*
  • Narrator 2013-08-05 19:30
    God:
    foo:
    God:
    foo:
    eViLegion:
    foo:
    God...:

    When Darwin visited the Galapagos, he saw that the relative isolation of the islands had allowed species to evolve into forms that would never have happened on the mainland. This insight helped him to refine his theory of evolution by natural selection.


    This is TRWTF. Everyone knows I created everything 6000 years ago.
    Then why did you create Darwin?


    Trying to have a rational discussion about evolution with someone role-playing God, isn't likely to lead to the satisfying victory that you're looking for.
    I'm not trying to have a rational discussion. I'm trying to get her to accidentally admit she exists which, by her own logic, means she doesn't exist.


    I'll have you know I am a lady.
    Voila, you did admit it, so you don't exist. :)


    Well I can't hang around here all night. You lot don't smite yourselves you know. Although, you're pretty good at smiting each other.

    *poof*
    And that, dear children, was the end of so called God. Time for another fairy tale?
  • Friedrice The Great 2013-08-05 19:40
    Narrator:
    God:
    foo:
    God:
    foo:
    eViLegion:
    foo:
    God...:

    When Darwin visited the Galapagos, he saw that the relative isolation of the islands had allowed species to evolve into forms that would never have happened on the mainland. This insight helped him to refine his theory of evolution by natural selection.


    This is TRWTF. Everyone knows I created everything 6000 years ago.
    Then why did you create Darwin?


    Trying to have a rational discussion about evolution with someone role-playing God, isn't likely to lead to the satisfying victory that you're looking for.
    I'm not trying to have a rational discussion. I'm trying to get her to accidentally admit she exists which, by her own logic, means she doesn't exist.


    I'll have you know I am a lady.
    Voila, you did admit it, so you don't exist. :)


    Well I can't hang around here all night. You lot don't smite yourselves you know. Although, you're pretty good at smiting each other.

    *poof*
    And that, dear children, was the end of so called God. Time for another fairy tale?

    Yes. "Professional programmers." ;-)
  • FWE 2013-08-05 19:54
    I'm glad Remy acknowledges that the Aussies have evolved into a superior race.....oh, maybe he means the Australian Aborigine....let's not start the ancestor debates again.
  • FWE 2013-08-05 19:57
    The String variables should have been A$, B$, ....A$, ........ everyone who's ever used BASIC in any incarnation knows that....
  • Mohammed Ali 2013-08-05 20:17
    The Bytemaster:

    • Use of ArrayList in any code after .Net 2.0 (extremely inefficient – requires casting everything to Object, which incurs boxing/unboxing)
    Does unboxing mean hitting the net?

    JC:
    As long as the elements in the ArrayList are reference types they won't be boxed/unboxed.
    It's still a sucky to do though.
    Try putting me in your ArrayList and you'll find your jaw in a cast.
  • Michael Clarke 2013-08-05 20:54
    snoofle:
    nulla:
    London is not a vacation destination.
    Whenever I go on vacation, it rains. We went to London some time back. It rained. Ergo, London is a vacation destination!
    It rained in Manchester yesterday, and it made us all sad. But I think Matt Westwoo would be happy.
  • Jo 2013-08-05 22:36
    Paul Neumann:
    Rob G:
    OK, I'll shut up and you've just lost a reader by being rude to other readers.

    If you can't take criticism, stop publishing.
    QFT! i.e. practice what you preach.

    Also, learn to read the meta.
    I thunk he said he's gone, so I assume he's not reading these either.....

    Incidentally, given that the site is free (and that a lot of comments suggest people block adds), I'm not sure why he thinks that Alex and co would care too much about losing a highly-strung reader.....

    I lost a reader when I was in primary school, and my p[arents had to pay for it.
  • MixMaster Steve 2013-08-05 22:46
    The Bytemaster:
    Not only does this code pattern itself stink, but hits just about every one of my .Net pet peeves that coders do.

    • Use of ArrayList in any code after .Net 2.0 (extremely inefficient – requires casting everything to Object, which incurs boxing/unboxing) Casting is just a minor headache and clrify intent. ArrayLists are only inefficient if used in place where they shouldn't
    • Meaningless Variable names other than iterators Obfuscated for security
    • String concatenation, especially inside of a loop – that is what a StringBuilder is for, unless you really like creating and allocating hundreds of objects. I have a Garbage Collector
    • Has to call a method (GetDemographics) just to get a count of the array. If that is an expensive method, you just did it twice. I don't see how its expense relates to the number of times it's called
    • Comparison to an empty string before checking for null/nothing – Do you want to crash if the string is not initialized? It works, it defaults to an empty string
    • Use of the And operator in an if statement (& in C/C#) instead of AndAlso (&& in C/C#). Short-circuit that call, you are in a loop! sorry, didn't know that one

    If there was a bunch of conditional statements on the lines I might think theprogrammer could have been trying to speed up their code and did not know about StringBuilder. Concatenating the smaller with the logic there and then concatenating them at the end would likely have been faster. Though, this is VB with the & operator instead of the + operator, so it may behave differently. Normally, + in VB and C# is compiled to use String.Concat() which, with this many arguments, will take the length of all of the strings and allocate memory once for the total rather than the creation and release of immutable objects. Without the conditional statements, though, it would have been better to just put the entire statement into one big concatenation statement , for speed. Though, if you are doing that why would you be using a label object in the first place.

    Now that I reason through it, this classifies as a WTF no matter which direction you look at it.

    on a slightly more serious note, given it's hard coded, can't all that just be done as a single string with _ ?

    I not know VB other than Victoria Bitter.
  • cameron 2013-08-05 23:46
    Memleak:
    Dim F As String
    Dim R As String
    Dim I As String
    Dim S As String
    Dim T As String

    comment.text = F & R & I & S & T


    F.I.R.S.T.
  • Matt Westwood 2013-08-06 01:26
    Michael Clarke:
    snoofle:
    nulla:
    London is not a vacation destination.
    Whenever I go on vacation, it rains. We went to London some time back. It rained. Ergo, London is a vacation destination!
    It rained in Manchester yesterday, and it made us all sad. But I think Matt Westwoo would be happy.

    We did have quite a cloudburst yesterday here in the somewhat more temperate south of England, worthy of some of the best that Florida can offer. Lovely and refreshing. Today dawns bright and sunny, and considerably cooler than it has been of late.
  • Jimbo 2013-08-06 01:52
    Matt Westwood:
    Michael Clarke:
    snoofle:
    nulla:
    London is not a vacation destination.
    Whenever I go on vacation, it rains. We went to London some time back. It rained. Ergo, London is a vacation destination!
    It rained in Manchester yesterday, and it made us all sad. But I think Matt Westwoo would be happy.

    We did have quite a cloudburst yesterday here in the somewhat more temperate south of England, worthy of some of the best that Florida can offer. Lovely and refreshing. Today dawns bright and sunny, and considerably cooler than it has been of late.
    At least he never mentioned the Ashes ;)
  • Wim 2013-08-06 02:09
    If God used APL we were living in Babylon
  • Andrew 2013-08-06 02:21
    Rob G:
    OK, I'll shut up and you've just lost a reader by being rude to other readers.

    If you can't take criticism, stop publishing.


    K... Buh Bye.
  • JustSomeGuy 2013-08-06 02:35
    Rnd(:
    QJo:
    ubersoldat:
    Man, imagine if God used VB to write our genetic code and everything was like this.

    Hmmm... it would be funny if someone had the time to write some "If God used programming language X" jokes.

    If God used Java we all be snails
    If God used C++ we all be gazelles with a heart problem
    If God used C we all be virus
    If God used PHP we all be Chimeras
    If God used Bash we all be droids
    If God used VB we wouldn't exist
    If God used Perl we would all be plants (my imagination has a limit)
    If God used Python we would all be British
    If God used Brainfuck we would all be Humans
    If God used JavaScript we would all be males (you know, because of single threading in JS)
    If God used C# we would all be slaves!!!

    Feel free to modify or extend, this work is CC BY-SA


    If God used BASIC we'd all be Disney cartoon characters.
    If God used FORTRAN we'd all be dinosaurs.
    If God used Ada we'd all be military tanks.
    If God used Ook we'd all be at Unseen University.


    If God used COBOL we'd all be?


    If God used COBOL, move verbose to what we'd be.
  • Matt Westwood 2013-08-06 04:21
    Jimbo:
    Matt Westwood:
    Michael Clarke:
    snoofle:
    nulla:
    London is not a vacation destination.
    Whenever I go on vacation, it rains. We went to London some time back. It rained. Ergo, London is a vacation destination!
    It rained in Manchester yesterday, and it made us all sad. But I think Matt Westwoo would be happy.

    We did have quite a cloudburst yesterday here in the somewhat more temperate south of England, worthy of some of the best that Florida can offer. Lovely and refreshing. Today dawns bright and sunny, and considerably cooler than it has been of late.
    At least he never mentioned the Ashes ;)

    What ashes?
  • eViLegion 2013-08-06 05:04
    The ones we have to keep trouncing Australia, in order to retain.
  • Smouch 2013-08-06 06:32
    Actually, there's a very good reason for coding this way.

    It makes the function easier to debug. Each element of the final concatenated string can be checked for errors much simpler than having one gigantic string to decipher. Since the overhead is negligible, it's actually a damned good idea.

  • Kuba 2013-08-06 08:31
    eViLegion:
    Yeah... I've always thought the American "vacation" is a weird term; why use a word which essentially means "making the home empty"?
    I mean, yeah, you do make your home empty, but that is entirely a side effect of "going somewhere else that's nicer, for a while".
    Because many, many americans' idea of spending their free time amounts to vacating their home and going to some absolutely despicable, "professionally managed" location, like a theme park or a popular beach etc. that everyone else goes to. They pretty much buy into marketing without thinking any.
  • anonymous 2013-08-06 12:12
    Smouch:
    Actually, there's a very good reason for coding this way.

    It makes the function easier to debug. Each element of the final concatenated string can be checked for errors much simpler than having one gigantic string to decipher. Since the overhead is negligible, it's actually a damned good idea.

    This is a joke, right?
  • asdf 2013-08-06 12:20
    QJo:
    moz:
    I'm still trying to work out whether the code is better or worse than the paragraphs above it.


    I notice there's been a lot of rudeness currently being expressed at the presentational style (by which I mean the surrounding text into which the WTF is customarily framed).

    I would opine that this is just a case of "them as can, does; them as can't, teach; them as can't teach, criticise."

    In short, if you think you can do better yourself, start your own website. If not, shut up.

    I love responses like this. So if you go see a shitty movie, you better not criticse and instead produce your own.
    You don't need to be a celeberty chef to know when foods taste like shit,
    you don't need to be a blogger to know what an article sucks.
  • chubertdev 2013-08-06 17:16
    MixMaster Steve:
    The Bytemaster:
    Not only does this code pattern itself stink, but hits just about every one of my .Net pet peeves that coders do.

    • Use of ArrayList in any code after .Net 2.0 (extremely inefficient – requires casting everything to Object, which incurs boxing/unboxing) Casting is just a minor headache and clrify intent. ArrayLists are only inefficient if used in place where they shouldn't
    • Meaningless Variable names other than iterators Obfuscated for security
    • String concatenation, especially inside of a loop – that is what a StringBuilder is for, unless you really like creating and allocating hundreds of objects. I have a Garbage Collector
    • Has to call a method (GetDemographics) just to get a count of the array. If that is an expensive method, you just did it twice. I don't see how its expense relates to the number of times it's called
    • Comparison to an empty string before checking for null/nothing – Do you want to crash if the string is not initialized? It works, it defaults to an empty string
    • Use of the And operator in an if statement (& in C/C#) instead of AndAlso (&& in C/C#). Short-circuit that call, you are in a loop! sorry, didn't know that one

    If there was a bunch of conditional statements on the lines I might think theprogrammer could have been trying to speed up their code and did not know about StringBuilder. Concatenating the smaller with the logic there and then concatenating them at the end would likely have been faster. Though, this is VB with the & operator instead of the + operator, so it may behave differently. Normally, + in VB and C# is compiled to use String.Concat() which, with this many arguments, will take the length of all of the strings and allocate memory once for the total rather than the creation and release of immutable objects. Without the conditional statements, though, it would have been better to just put the entire statement into one big concatenation statement , for speed. Though, if you are doing that why would you be using a label object in the first place.

    Now that I reason through it, this classifies as a WTF no matter which direction you look at it.

    on a slightly more serious note, given it's hard coded, can't all that just be done as a single string with _ ?

    I not know VB other than Victoria Bitter.


    Smouch:
    Actually, there's a very good reason for coding this way.

    It makes the function easier to debug. Each element of the final concatenated string can be checked for errors much simpler than having one gigantic string to decipher. Since the overhead is negligible, it's actually a damned good idea.



    Both of you, please never, ever use technology again.
  • Meteor 2013-08-06 18:03
    eViLegion:
    Brompot:
    nulla:
    London is not a vacation destination.


    Quite right. London is a holiday destination.


    Yeah... I've always thought the American "vacation" is a weird term; why use a word which essentially means "making the home empty"?
    I mean, yeah, you do make your home empty, but that is entirely a side effect of "going somewhere else that's nicer, for a while".

    Then again, I guess it makes no more sense than using a word for single day's religious festival.


    From etymonline.com:

    "freedom from obligations, leisure, release" (from some activity or occupation), from Old French vacation, from Latin vacationem (nominative vacatio) "leisure, a being free from duty," noun of state from past participle stem of vacare "be empty, free, or at leisure"

    So what you got right is that a word beginning with "vacat" suggests that something is empty. But it's not about your house being empty, it's about your timetable. ;)

    Vacation doesn't just refer to the going away part, it refers to the entire period of being free from work even if you stay at home.
  • well 2013-08-06 19:00
    for a webdeveloper this isn't even so much of a wtf :) nothing unusual?
  • foxyshadis 2013-08-06 19:12
    chubertdev:
    The Bytemaster:
    The default for reference types in VB.Net is Nothing, which is identical to NULL in C# an most .Net languages. In fact, one of the best ways to handle this comparison is using String.IsNullOrEmpty().


    It's never null, haha.

    http://stackoverflow.com/questions/3002978/vb-net-documentation-and-exception-question

    The Bytemaster:
    VB.Net has two operators for strings. The "+" operator causes the string joing to act like it would in C# and other .Net languages. The special "&" concatination operator in VB.Net works more like older versions of VB and I believe uses the Visual Basic library to handle the concatination instead of String.Concat. This allows you to concatinate different data types and they will be converted usinge their ToString() method and also means that you don't have to worry about strings being Nothing/NULL, they will be treated just like empty strings with the "&" operator.

    So you are right - in VB.Net concatinating 5 unitialized strings, using &, will give you an empty string. Using + will cause an error.


    Super-WTFery. Consistently inconsistent.

    Very Perlish in its insistence on having two ways to do it, one strict and one loose, with non-obvious differences between them.
  • The Bytemaster 2013-08-07 16:24
    [quote user="MixMaster Steve"]On a slightly more serious note, given it's hard coded, can't all that just be done as a single string with _ ?
    quote]

    Assuming you are trolling, but yes, it could be done with the line continuation "_". (VS2010 and later can do it implicitly if you end the line with an "&")

    Also, just for clarification (for those that don't know you are trolling):
    "Casting is just a minor headache and clrify intent. ArrayLists are only inefficient if used in place where they shouldn't" -- You better be really sure about your value and reference types. Value types get boxed and really run slower. Why one would not use List(Of Type) / List<Type> in .Net 2.0+ instead is beyond me. Easier to work with and generally performs better.

    "I have a Garbage Collector", sure, but you are also dealing with immutable objects that require copying the values to new memory over and over again (if it gets large enough, you then get the pleasure of dealing with LOH fragmentation as well)

    "I don't see how its expense relates to the number of times it's called" -- Seriously Troll? If it takes a lot of time to do soemthing, why do it multiple times needlessly

    "It works, it defaults to an empty string", uhhh, no. Strings default to Nothing/Empty in VB.Net

    I appologize if you are not a troll... there are just a lot of them on here.

    Captcha: nulla -- 1) a slang term for null 2) not the default value for a string 3) The default value for a string
  • anon 2013-08-07 17:12
    pff, everyone knows god writes only lisp.
  • Captain troll 2013-08-09 16:33
    If God used Whitespace we would all be invisible
    If God used MUMPS we would all be sick and living in hospitals
    If God used Lisp we would be made tail-recursively of smaller versions of ourselves
    If God used APL we would all be Egyptians
    If God used Forth we would all pilled up in stacks
  • Captain troll 2013-08-09 16:37
    If God used Assembly we would all be hyperactive
    If God used Fortran I we would be spaghetti beings
    If God used Binary there would be only 10 persons around
  • Captain troll 2013-08-09 16:42
    If God used Malbolge God would be Satan himself
    If God used C++ we would not have foots
    If God used Java frameworks we would be all giant onions
  • urza9814 2013-08-27 20:10
    eViLegion:
    Brompot:
    nulla:
    London is not a vacation destination.


    Quite right. London is a holiday destination.


    Yeah... I've always thought the American "vacation" is a weird term; why use a word which essentially means "making the home empty"?
    I mean, yeah, you do make your home empty, but that is entirely a side effect of "going somewhere else that's nicer, for a while".

    Then again, I guess it makes no more sense than using a word for single day's religious festival.


    In American usage you say that you are taking a vacation *from* something. You could say "I'll be taking a vacation from work" for example. When used in the more general form, it's not saying you are vacating your house (people frequently will say they are "going on vacation" even if they are just staying home) -- rather, you are vacating your *responsibilities*. Makes quite a bit more sense than overloading "holiday", particularly for those of us who may have to work during holidays.
  • urza9814 2013-08-27 20:11
    Anonypony:
    If God used Lua we'd all be hookworms.
    If God used Mumps we'd all be X(^DNA("OID"))
    If God used SQL we'd all be <?= mysql_fetch_array(mysql_query("SELECT `trait` from `traits` where `lang` = '" . $_GET['lang'] . "'") ?>



    Looks like somebody doesn't know the difference between SQL and PHP.....
  • Mark Robbins 2013-09-03 20:04
    Funny you bring it up, in some places 'e' is bad news. See if you can figure out why before you follow the link.

    What is e3 and how do I get it out of my life?


    kismet