• (cs) in reply to Mike R
    Mike R:
    Anonymous:

    AndAlso is the short circuiting AND
    OrElse is the short circuiting OR


    A WTF in AndAlso of itself OrElse its an elegant solution to the sins of VB past.

    When Visceral Baysuck has reached sufficient mass to have a periodic table of operators, it shall have achieved Perlesque coolness.

  • (cs) in reply to foxyshadis

    foxyshadis:

    Roy:
    It's not Java.  In Java, we would generally use !(string1.equals(string2)) to compare strings, rather than string1 != string2.


    Some nights I lie awake and wonder what Sun's engineers and designers were smoking when they thought that up. Does object-oriented paint thinner exist?

    It's actually quite consistent with the rest of the language and philosophy of the language.  I think it's better than the C-splat version where you have the opaqueness of overloading that depends on the type of the references.  I imagine that the Java way produces more confusion up-front but the C-splat version causes unexpected gotchas in seemingly simple code.  In other words, the C-splat way might seem more simple but it's actually more complicated as it has more syntax rules.

  • (cs) in reply to smitty_one_each

    When Visceral Baysuck has reached sufficient mass to have a periodic table of operators, it shall have achieved Perlesque coolness.

    Eventually, you'll be able to execute an empty script with Perl and it will do anything and everything.

  • (cs) in reply to smitty_one_each
    smitty_one_each:

    When Visceral Baysuck has reached sufficient mass to have a periodic table of operators, it shall have achieved Perlesque coolness.



    Your comment is sufficiently opaque for me not to understand.



  • (cs) in reply to EsotericMoniker
    EsotericMoniker:
    Rick:

    How could you leave out JavaScript?
    Also if it is Java, there is another WTF.


    I believe ECMAScript was meant to stand in for JavaScript since it's sort of the "official" version now.  I do find it rather annoying though to have two names for basically the same language.


    You both need to learn to use Google.

    That's like me saying "It's C99", and you responding, "How could you say its not GCC?", and then following up, "I think C99 is some sort of official name for Borland Turbo C".  (Well not quite, JavaScript actually does support basically all of the ECMA-262.pdf specification whereas Turbo C does not support the ISO/IEC 9899:1999 standard, but you get the idea).

    C'mon people.
  • (cs) in reply to kalaef
    Anonymous:
    VB.NET now supports short-circuiting operations as well, so even that isn't an excuse.

    In VB.NET

    AndAlso is the short circuiting AND
    OrElse is the short circuiting OR


    You're kidding, right??!  Special syntax for short-circuiting boolean operations???  Now I've seen everything.

        -dZ.

  • (cs) in reply to Justin Sippel
    Anonymous:
    He mentioned ECMAScript; JavaScript would be pretty much implied with that. Not to mention it's an incomplete list of possible languages this could could be written in. It doesn't even matter what language it's in, its stupidity transcends language.


    Amen to that.
  • (cs) in reply to Roy
    Anonymous:
    It's not Java.  In Java, we would generally use !(string1.equals(string2)) to compare strings, rather than string1 != string2.

    I some how managed to forget java doesn't have operator overloading, as its Too Confusing ™
  • (cs) in reply to foxyshadis
    foxyshadis:

    My bad, I thought it was Sun.

    I wonder how JScript, a mediocre name at best, has died out while ECMAScript, the ugliest language name that doesn't start with X I know of, has become so popular. There must be a lot of standard-whores. The rest of the world just sticks to javascript or javascript1.2. =p


    The answer: ECMA [ European Computer Manufacturers Association ], upon publishing the standard in collaboration with both Netscape® and Microsoft®, elected to name it after themselves as to avoid any trademark issues.

    Honestly I think the US Justice Department should have taken Microsoft® to town for using the name JScript which was clearly an attempt to snag the term JavaScript ™ from Netscape.
  • (cs) in reply to Maurits

    if ((typec!="20") && (typec!="13") && (typec!="5") && (typec!="4"))


    #!/usr/bin/perl

    #...<!snip>
    (SelectType("ALLOC") && return) if ($typec !~ /^(20|13|[45])$/io);

    #...
    <!snip>

    -dZ.

  • (cs) in reply to Maurits

    if ((typec!="20") && (typec!="13") && (typec!="5") && (typec!="4"))


    #!/usr/bin/perl

    #...<!snip!>

        (SelectType("ALLOC") && return) if ($typec !~ /^(20|13|[45])$/io);

    #...<!snip!>

        -dZ.

  • (cs) in reply to DZ-Jay

    sorry for the post*2, but the site script crashed on me the first time :(

        -dZ.

  • (cs) in reply to tiro
    tiro:
    Anonymous:
    VB.NET now supports short-circuiting operations as well, so even that isn't an excuse.

    In VB.NET

    AndAlso is the short circuiting AND
    OrElse is the short circuiting OR


    OrElse is offically my new favorite operator.


    I wonder if VB.Net allows open-ended threatening commands in its syntax, like to avoid exceptions at all costs.  Something like:

    If (theLordCommandsThee) Then
        sacrificeYourFirstBorn() OrElse
    End If

        -dZ.
  • (cs) in reply to EsotericMoniker
    EsotericMoniker:
    rogthefrog:

    EsotericMoniker:
    I immediatly saw that whoever was coding the thing didn't understand the difference between OR and AND

    How is that even possible? [:(]



    People get "promoted" out of customer service positions because "they know Excel macros".  Now they have an initiative here to move the tech support people into programmer positions which I suppose is a better plan, but they're having the current programmers teach these up and coming ones.  "The blind leading the blind" springs to mind.

    I must be incredibly fortunate to be working with people who are all excellent at what they do. How sad for the rest of y'all.

  • Ross Presser (unregistered) in reply to kalaef
    Anonymous:
    Miszou:

    Anonymous:
    VB.NET now supports short-circuiting operations as well, so even that isn't an excuse.

    In VB.NET

    AndAlso is the short circuiting AND
    OrElse is the short circuiting OR

    Hahaha! You can't be serious... can you?



    Absolutely serious

    MSDN article describing this
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcn7/html/vaconLogicalOperators.asp


    Even in VB6 or VBScript, short-circuiting was possible with another construct: SELECT CASE.

    Select Case True
    Case var1 = "This", var2 = "That", func3() = "The Other"
       ' do stuff ...
    End Select

    (Ross turns his head while all the fanatical non-VB users retch at the "abuse" of the case statement. Dammit, it works.  90% of what you call "WTF" I call "RTFM".)
  • (cs) in reply to rogthefrog
    rogthefrog:

    I must be incredibly fortunate to be working with people who are all excellent at what they do. How sad for the rest of y'all.



    I, too, work with people who are all excellent at what they do, though I don't consider myself fortunate.  The problem is that what these pepole do is mostly goof off, surf the web, chat in IM, or at best mediocre work -- but they all excell at this!

        -dZ.
  • Nortimer F. Codelikecrap (unregistered)
    #include <string.h><string.h>
    
    #define TWENTY   "20"
    #define THIRTEEN "13"
    #define FIVE "5"
    #define FOUR "4"
    
    #define ONE 1
    #define ZERO 0
    
    #define ALLOC "alloc"
    
    int check_for_value(char *s, char *value)
    {
       if (strcmp(s, value) == ZERO)
       {
            return ONE;
        }
        else
        {
           return ZERO;
        }
    }
    
    int check_for_not_twenty(char *v)
    {
        if (check_for_value(TWENTY, v))
        {
           return ZERO;
        }
        else
        {
           return ONE;
        }
    }
    
    int check_for_not_thirteen(char *v)
    {
        if (check_for_value(THIRTEEN, v))
        {
           return ZERO;
        }
        else
        {
           return ONE;
        }
    }
    int check_for_not_four(char *v)
    {
        if (check_for_value(FOUR, v))
        {
           return ZERO;
        }
        else
        {
           return ONE;
        }
    }
    int check_for_not_five(char *v)
    {
        if (check_for_value(FIVE, v))
        {
           return ZERO;
        }
        else
        {
           return ONE;
        }
    }
    
    char *get_alloc()
    {
        return ALLOC;
    }
    
    void check_select_type(char *v)
    {
       char *alloc_value;
    
       if (check_for_not_twenty(v))
        {
           if (check_for_not_thirteen(v))
           {
              if (check_for_not_four(v))
              {
                 if (check_for_not_five(v))
                 {
                    alloc_value = get_alloc();
                    SelectType(alloc_value);
                    return;
                 }
              }
           }
        }
    }
    </string.h>
  • Special (unregistered) in reply to lucio
    lucio:

    My comments on the WTF:
    It makes me wonder why none of today's languages have a construct like SQL has, that will let you do things like SELECT (...) WHERE @whatever NOT IN (1, 3, 5, 7, 9). Of course you can use an array or whatever else, but a language construct would be pretty cool. Maybe like:

    <FONT face="Courier New" color=#000000>if (typec !in ("20", "13", "5", "4")) {
       DoStuff();
    }</FONT>

    or something.

    Don't Forget Pascal

     

  • (cs) in reply to Nortimer F. Codelikecrap

    I like how ONE is an int but FOUR is a string :)

  • Binky (unregistered) in reply to Special

    > Don't Forget Pascal

    True, Pascal has an "in" operator, but it only works on sets which can only be groups of ordinal values. You can't have a set of strings. If typec was an integer, then you could do:

      if (typec in [4,5,13,20]) then ...;

    or if typec was a character, you could do

      if (typec in [#4,#5,#13,#20]) then ...;

    Of course neither of these use nearly enough resources. In Delphi what you could do is something like this for a start:

      sl := TStringList.Create;
      sl.CommaText := '4,5,13,20'; // split string into substrings
      nIndex := sl.IndexOf(typec); // look up typec
      if nIndex = -1 then ...; // typec not found in list

    Why just use boring old integers when you can bring all of this other excellent technology to bear on the problem?

  • (cs) in reply to christoofar
    christoofar:
    I love it even more for the magic numbers.   

    There aren't any comments explaing WHY, oh WHY
    typec can't be 4, 8, 18 whatever...

    Every good programmer knows that 4, 5, 13 and 20 are the four unluckiest integers.

  • (cs) in reply to tag
    tag:
    Looks like any one of:
    C++
    C#
    Java
    Pike
    D
    ECMAScript

    But is definitely not C

    Additionally, in any of these languages the expression could have been wonderfully optimized by performing a type conversion and making an integral comparison instead of a string comparison (which requires far more operations).  Wow, the WTF-posters are almost worse than the WTFs.


    Actually, there is no reason why it couldn't be C.  Who says typec couldn't be a pointer to characters?  Then the performing the type conversion would be a terrible waste of time....

    (Not that I think it is actually C.)
  • (cs) in reply to lucio

    Lucio - Pascal has sets, irritatingly limited to a one-byte range and slightly hampered by its stupid decisions on operator precedence, but in this case they'd work.  You'd do something like this:

    Temp := StrToIntDef(TypeC, -1); // or equivalent
    if (Temp < 0) or (Temp > 255) or not (Temp in [20,13,5,4]) then
      DoStuff;

    Note the error checking: if you're converting a string to an integer, presumably you could run into a case where the string isn't a valid number, so StrToIntDef will solve that for you.  Then, of course, you have to deal with the byte limit.

    A better solution from the programmer's POV is the PHPish

    if (!in_array($tempc, array(20,13,5,4))) {
      DoStuff();
    }

    ... which requires less fiddling.  Rasmus is much less anally retentive than Niklaus, obviously.

  • (cs) in reply to davewalthall
    davewalthall:

    Actually, there is no reason why it couldn't be C.  Who says typec couldn't be a pointer to characters?


    Yeeeeeeeeeees... that would raise the WTF to a hole 'nother level... perhaps the line above is

    char *typec = &"20";

    and perhaps the runtime stores constant strings in space-saving fashion a-la-Java...

    Perhaps...
  • (cs)

    Just for grins, COBOL would say

    if code not 4 and 5 and 13 and 20
       do something

    I always loved that syntax. It's a macro-like shortcut for

    if code not 4 and code not 5 and code not 13 and code not 20

  • Chris D. (unregistered) in reply to lucio

    In Smalltalk one could do:

    (#('20' '13' '5' '4') includes: typec)
        ifFalse: [self doStuff].


  • (cs) in reply to Stan James

    Stan James:
    Just for grins, COBOL would say

    if code not 4 and 5 and 13 and 20
       do something

    I always loved that syntax. It's a macro-like shortcut for

    if code not 4 and code not 5 and code not 13 and code not 20

    I think the problem with that when read as an English sentence it means something other than what it does.

  • (cs) in reply to dubwai
    dubwai:

    Stan James:
    if code not 4 and 5 and 13 and 20

    I think the problem with that when read as an English sentence it means something other than what it does.



    Yup - #define nor and
    if code not 4 nor 5 nor 13 nor 20
    (aah)
  • Matthew (unregistered) in reply to lucio
    lucio:

    Maurits:

    there's also a typo, Alex - you've got an extra ) after the 4

    Now that's efficiency [:D]

    My comments on the WTF:
    It makes me wonder why none of today's languages have a construct like SQL has, that will let you do things like SELECT (...) WHERE @whatever NOT IN (1, 3, 5, 7, 9). Of course you can use an array or whatever else, but a language construct would be pretty cool. Maybe like:

    <FONT face="Courier New" color=#000000>if (typec !in ("20", "13", "5", "4")) {
       DoStuff();
    }</FONT>

    or something.

     

    VB's Select Case does basically that.

  • Matthew (unregistered) in reply to EsotericMoniker

    EsotericMoniker:
    This is David Koontz the original poster of the code.  I agree that because of the lack of short circuting (which I was not aware of in VB) that the expanded block could possibly be faster, but all that extra code to save just a few small equality checks?  Anyway, I don't know what happened when the example got "anonymized" but originally all those AND's in the commented out line were OR's which somewhat changes the WTF.  When I found it I immediatly saw that whoever was coding the thing didn't understand the difference between OR and AND and therefore did it the second way to acheive the result they wanted instead of just changing a few keywords.

    Even if it was VB 6 (which it plainly isn't), that would be no excuse. VB 6 has Select Case which supports lazy evaluation - that would have been used instead of the style shown in this WTF.

  • (cs) in reply to rogthefrog
    rogthefrog:

    EsotericMoniker:
    I immediatly saw that whoever was coding the thing didn't understand the difference between OR and AND

    How is that even possible? [:(]


    Obviously it is possible, somehow and it keeps this site chock-full-o-laffs.  Perhaps the hiring is done by a non-technical manager or HR person without consulting a tech person (mistake!) or maybe a manager doesn't want to terminate someone who should be terminated (mistake!) or there may be a hiring freeze (mistake!).


  • Matthew (unregistered) in reply to DZ-Jay

    DZ-Jay:
    Anonymous:
    VB.NET now supports short-circuiting operations as well, so even that isn't an excuse.

    In VB.NET

    AndAlso is the short circuiting AND
    OrElse is the short circuiting OR


    You're kidding, right??!  Special syntax for short-circuiting boolean operations???  Now I've seen everything.

        -dZ.

     

    To stop you all embarassing yourself further, the fact is that And and Or in VB 6 are not boolean operators. Never have been, never will be. They are bitwise operators.

  • (cs) in reply to DZ-Jay

    DZ-Jay:
    Anonymous:
    VB.NET now supports short-circuiting operations as well, so even that isn't an excuse.

    In VB.NET

    AndAlso is the short circuiting AND
    OrElse is the short circuiting OR


    You're kidding, right??!  Special syntax for short-circuiting boolean operations???  Now I've seen everything.

        -dZ.

    The thing is, Microsoft originally wanted to make that change to VB.NET, so that the And/Or/Not became logical operators and short-circuited. But all the people maintaining legacy VB6 applications complained, so they changed it back:

    http://archive.devx.com/free/newsletters/vb/ednote040601.asp

    This can only mean that some VB6 programmers were actually relying on the non-short circuiting behavior of these operators to make their programs work. And there had to be a lot of them, for MS to feel the pressure and make this change to VB.NET. There must be a lot of scary, scary WTF code out there.

    The good news is, this site could keep going for decades.

     

  • (cs) in reply to A Wizard A True Star
    A Wizard A True Star:
    AndAlso is the short circuiting AND
    OrElse is the short circuiting OR
    Sweet, an OrElse operator. The comedic properties of this operator are nearly endless.
  • (cs) in reply to foxyshadis

    In keeping with the new VB.Net operators, I think C++ should add an OrElse operator.

    Except, its use would be a bit different:

    a = func(b) orelse;

    More like a threat.  It could, you know, ignore exceptoins.

    try {
        Class *c;
        c = 0x00;
        c->op() orelse;  // This wouldn't throw an exception, just silently fail.
    } catch(...) {
    }

  • Kemrin (unregistered) in reply to tag

    Now now, don't be misleading folks. No operator overloading, sigh... '+', when used for 1 + 1 returns the sum of the two ints, or 2. When used for "foo" + "bar" it returns the first string, elongated by the second string, or "foobar." That's most certainly an overloaded operator. At the risk of being nitpicky, I just thought I'd provide the lesson in word choice. Besides, who doesn't love having the easily accessed ability to compare either the references to two strings or the strings themselves? ;)

  • Kemrin (unregistered) in reply to Kemrin

    (java, of course)

  • BogusDude (unregistered) in reply to dubwai
    dubwai:

    loneprogrammer:
    Otac0n:
    WTF is wrong with an early return?

    Some people believe functions should have one and only one way into and out of them.  That way if you have foolishly written a monsterously long function, you won't have to read the whole thing to see if you have missed a return statement that prevents your changes from getting executed.

    Yeah, someone should invent some sort of "search" tool for source files or even make some sort of editor that makes control statements such as return stand-out somehow.  Like, maybe they could be a different color or something.

    The flip side to that argument is when you ae modifying some stupidly long method and you want to change what it returns under certain conditions.  Since the developer has some dumbass return variable, you can't be sure you've done it without walking though the entire method to verfiy that nothing else modifies that return variable.

    loneprogrammer:

    Forcing functions to be short and do only one thing is too much of a burden.  Best to just outlaw all types of branching, including if-then, loops, and switch-case statements with more than one possible case.

    Yeah, these kinds of rules are pretty worthless.  People should just keep things short and code it the most natural and understandable way.

    I'm not going to go into all the why's, but early returns are a Good Thing (tm) ! Return early, return often !!

  • (cs) in reply to triso
    triso:

    Perhaps the hiring is done by a non-technical manager or HR person without consulting a tech person (mistake!) or maybe a manager doesn't want to terminate someone who should be terminated (mistake!) or maybe a manager doesn't want to terminate someone who should be terminated (mistake!) or there may be a hiring freeze (mistake!).


    Ding Ding Ding, we have a winner!  The last one is not correct but hey, 2 out of 3 is pretty good.

  • Jimmy (unregistered) in reply to rogthefrog

    sure you didn't mean :
    <font face="Courier New">switch(typec)
    {
      case 20:
      case 13:
      case 5:
      case 4:
        break;
      default:
        SelectType("ALLOC");
      break;
    }</font>

  • (cs) in reply to Jimmy

    Maybe this site should have a section where people can have a go a bad code and make it worse.

  • (cs) in reply to Matthew
    Anonymous:
     

    To stop you all embarassing yourself further, the fact is that And and Or in VB 6 are not boolean operators. Never have been, never will be. They are bitwise operators.



    And to embarass you a bit, here's a little factlet:
    http://msdn.microsoft.com/library/en-us/script56/html/vsoprand.asp

    From that article, I extracted the following statements:

    "AND Operator - Performs a logical conjunction on two expressions."

    Is that's "logical", as in "boolean"?

    "The And operator also performs a bitwise comparison of identically positioned bits in two numeric expressions and sets the corresponding bit in result..."

    Wow, that's the first time I've ever seen the word "also" to mean "exclusively"!

    Here's the VB.6 reference, it says the same thing:
    http://msdn.microsoft.com/library/en-us/vbenlr98/html/vaoprand.asp

    BTW, I am not a VB coder (thank Gawd for that!), so I do not attempt to defend, promote, or condone the language -- I am merely a google user.

        dZ.

  • (cs) in reply to dhromed
    dhromed:
    Maybe this site should have a section where people can have a go a bad code and make it worse.


    I'd go for that!

        dZ.

  • darrenb (unregistered) in reply to DZ-Jay

    >> the fact is that And and Or in VB 6 are not boolean operators.
    >> Never have been, never will be. They are bitwise operators.
    > From that article, I extracted the following statements:
    > "AND Operator - Performs a logical conjunction on two expressions."
    > Is that's "logical", as in "boolean"?

    If you write some code in VB.NET using And, AndAlso, Or, OrElse, compile it to IL and then use Reflector (http://www.aisto.com/roeder/dotnet/) to view the IL as C# you find that
       And in VB.NET is & in C#
       Or in VB.NET is | in C#
       AndAlso in VB.NET is && in C#
       OrElse in VB.NET is || in C#

    Hence And/Or are bitwise and AndAlso/OrElse are boolean.

  • (cs) in reply to darrenb
    Anonymous:

    >> the fact is that And and Or in VB 6 are not boolean operators.
    >> Never have been, never will be. They are bitwise operators.
    > From that article, I extracted the following statements:
    > "AND Operator - Performs a logical conjunction on two expressions."
    > Is that's "logical", as in "boolean"?

    If you write some code in VB.NET using And, AndAlso, Or, OrElse, compile it to IL and then use Reflector (http://www.aisto.com/roeder/dotnet/) to view the IL as C# you find that
       And in VB.NET is & in C#
       Or in VB.NET is | in C#
       AndAlso in VB.NET is && in C#
       OrElse in VB.NET is || in C#

    Hence And/Or are bitwise and AndAlso/OrElse are boolean.

    Your logic is flawed.

  • (cs) in reply to DZ-Jay
    DZ-Jay:
    if ((typec!="20") && (typec!="13") && (typec!="5") && (typec!="4"))

    #!/usr/bin/perl

        (SelectType("ALLOC") && return) if ($typec !~ /^(20|13|[45])$/io))


    Meh.

    #!/usr/bin/perl
    use Quantum::Superpositions;

    SelectType("ALLOC"), return if $typec != any(20,13,5,4);

    see http://search.cpan.org/~lembark/Quantum-Superpositions-2.02/lib/Quantum/Superpositions.pm

  • (cs) in reply to joodie

    in java (afaik) doing: String a = "thisString"; creates a new object, and the variable 'a' is actually a pointer, you just never see the pointer. When you compare, using == or whatever, you are actually comparing the pointers So, doing: if (a=="thisString") { something(); }

    is doing: if (pointer)a is exactly equal to (pointer)[new String] then do something().

    now, afaik, something() will never happen, because the second pointer (the new String) cannot be the same as the pointer stored in 'a'

  • (cs) in reply to DZ-Jay

    "I wonder if VB.Net allows open-ended threatening commands in its syntax ..."

    It'd have to go a bit before it achieves the classic bluntness of Perl's idiomatic:

    DoIt() or die;

  • (cs) in reply to darrenb
    Anonymous:

    If you write some code in VB.NET using And, AndAlso, Or, OrElse, compile it to IL and then use Reflector (http://www.aisto.com/roeder/dotnet/) to view the IL as C# you find that
       And in VB.NET is & in C#
       Or in VB.NET is | in C#
       AndAlso in VB.NET is && in C#
       OrElse in VB.NET is || in C#

    Hence And/Or are bitwise and AndAlso/OrElse are boolean.



    Wrong!  The C# *interpretation* of And/Or from VB.Net might be a bitwise comparison -- but it says nothing about how it works in its original form.

    Besides, what Mathew said was that "And and Or in VB 6 are not boolean operators..." (emphasis mine).  I have no idea if Microsoft changed the behaviour in VB.Net to make the And/Or operators exclusively bitwise, but I seriously doubt it, as it would work against their goal of separating short-circuit from non-shortcircuit boolean operators, for backwards compatibility's sake -- which was their point to begin with.

    Unless, of course, you are suggesting that what MSDN documentation means by "logical operations" is actually "bitwise operations", and that "boolean" and "bitwise" are one and the same in VB 6's operational context -- which would make this whole argument moot, as the point of Mathew's pedantic post was that we were all fools to consider that VB 6's And/Or operators were boolean instead of bitwise.

        -dZ.

  • Spuddo (unregistered) in reply to Candle
    Candle:
    in java (afaik) doing: String a = "thisString"; creates a new object, and the variable 'a' is actually a pointer, you just never see the pointer. When you compare, using == or whatever, you are actually comparing the pointers So, doing: if (a=="thisString") { something(); } is doing: if (pointer)a is exactly equal to (pointer)[new String] then do something(). now, afaik, something() will never happen, because the second pointer (the new String) cannot be the same as the pointer stored in 'a'


    Actually I think in this case a == "thisString" is actually true because all occurences of a String literal become the same String object. if it was for example a string you got from the command line then it would be false.

    I really didn't get this for a good while. the problem was when I was learning java I was told there were no pointers. In fact pointers are fundamental in java and every non-primitive variable is really a pointer.

    As for doing the "in" operator in java you could do:
    if (Arrays.asList(new String []{"12", "34", "3"}).contains(test))
    {
               
    }

    Beautiful no? :P

Leave a comment on “Right In Front of You”

Log In or post as a guest

Replying to comment #:

« Return to Article