• (cs) in reply to Oha Ooh
    Anonymous:

    ray:
    Not to be funny or anything but to settle this once and for all visable=false will still include the control on the page (as in a hidden asp textbox) whereas enabled=false will actually stop the control being included in the page.

    It's the other way round: enabled=false will still include the control on the page whereas visible=false will not render the control on the page any more.



    If we're going to be totally strict, controls that have .Visible = false will still be rendered to ViewState in case you want to re-visibleize them and preserve previous values. So, in a sense, they're still on the page. Kinda. OK, not really.
  • (cs) in reply to PaulaBean
    Anonymous:
    Brillant...


    Really, you are a genius.  Seriously.

        dZ.
  • (cs) in reply to Maurits
    Maurits:

    They tried in pre-release versions of VB.Net 1.0 -- VB developers rose up in unison and demanded they put it back to the way they were used to.


    WTF? They seriously balked at the idea of having real short-circuit evaluation? This was something I was dreaming of, even since I touched VB (I still feel dirty)

    That explains all I need to know about true VB Developers right there.


  • Crocodile (unregistered) in reply to ammoQ

    ammoQ:
    rikkus:
    Anonymous:

    Tell me VB.net doesn't have 'AndAlso' just to provide short circuiting. Why couldn't they change that behaviour when they were changing everything else in the transition to VB.net? Every other language short-circuits by default.

    This is worthy of a WTF all of its own.


    Many companies ported their VB6 code to VB.NET. Do you think it's more of a WTF to add a short-circuiting operator or to silently break existing code?



    Existing code had to be reworked anyway; I don't know vb.net but in C#, you need short-curcuiting all the day for cases like that:

    if (something != null && something.WTF) { ... }

    Since vb.net has similar semantics and works on the same class libs, I guess you need it in vb.net just as often.

    I usually speak french! The first time I saw in VB .NET:

    "If CondA AndAlso CondB Then ... ",

    with my understanding of english, I tought it means: "Test CondA condition AND ALSO test CondB condition"; this is not the definition of short-circuiting in my opinion. The operator should have been named:

    If CondA AndIfThePrecedingConditionIsTrueTestTheNextOne CondB Then ...

    They should have made And in VB .NET a short-circuiting operator, and change their migrating tools to translate old "And" in VB6 to something like "AndOld" (or it could be AndAlso) [8-|]

  • (cs) in reply to Crocodile
    Anonymous:

    They should have made And in VB .NET a short-circuiting operator, and change their migrating tools to translate old "And" in VB6 to something like "AndOld" (or it could be AndAlso) [8-|]



    That would have been a better option in my opinion. They should add a MaybeIf statement, too.
  • (cs) in reply to lenny
    Anonymous:
    Smash:
    I would take a guess and say this is someone who still thinks he works in asp. Needs a wake-up call. A slap in the head would do nicely.


    It would be a huge WTF in ASP also.  I vote for two slaps in the head, a chop to the kidneys,  and a swift knee to the groin area.

    Somebody needs to tell this guy that the CORRECT way of hiding text in an ASP.NET page is to put in in a
    and setting the div's display = 'none' in javascript.   Duh....


    The label control renders on the client as a SPAN tag... if you wanted to show and hide text on the client, a Label control is a often a better choice than embedding the text in a DIV control. 

    If you wanted to make the label dynamic on the client side, register a script in the Labels attributes. Using either the DIV or Label method requires that you make the item visible when the page renders, otherwise neither would show up in the client's page source.

    Its tough to say which way is more correct that the other.  It really comes down to the situation. 

  • Rain dog (unregistered)

    What gets me about things like this post is that people go to all sorts of pains to display or hide this information by using the same built in features

    It boggles my mind as to how this guy, while using the .Visible property did not think about taking advantage of this property while designing his incredible method for hiding controls.

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

    They should have made And in VB .NET a short-circuiting operator, and change their migrating tools to translate old "And" in VB6 to something like "AndOld" (or it could be AndAlso) [8-|]



    That would have been a better option in my opinion. They should add a MaybeIf statement, too.


    I was thinking of an AndMaybe

    If (something AndMaybe somethingelse) Then
  • (cs) in reply to Mike R

    that's not magic, that's... Disney!

    [quack]

  • (cs) in reply to dhromed
    dhromed:
    I was thinking of an AndMaybe


    All kinds of possibilities...

    AndWhileYoureAtIt
    AndDontForget
    AndNowThatYouMentionIt
    ...
  • (cs) in reply to Maurits

    Maurits:
    dhromed:
    I was thinking of an AndMaybe


    All kinds of possibilities...

    AndWhileYoureAtIt
    AndDontForget
    AndNowThatYouMentionIt
    ...

    <FONT face="Courier New" size=2>And2 : bigger, faster!</FONT>

  • (cs) in reply to DZ-Jay

    DZ-Jay:
    Anonymous:
    Brillant...


    Really, you are a genius.  Seriously.

        dZ.

    That would be "Really, you are a genus, serously". rght?

  • (cs) in reply to wtijsma

    mayhaps (thisObject notWithstanding anotherThing) {

    }
    inanycase {

    }

    It's a cautious programming language.

Leave a comment on “All Commented Out”

Log In or post as a guest

Replying to comment #:

« Return to Article