Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Javascript 'with' keyword

Javascript 'with' keyword

Scheduled Pinned Locked Moved The Lounge
c++javascriptarchitecturequestion
8 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chris Maunder
    wrote on last edited by
    #1

    I feel like I've just found a new door in my house that I never knew was there. And inside is a whole bunch of VB. It's weird. I just found out about the javascript with keyword. How did I miss it? Was I intentially blanking it out? Weird.

    cheers, Chris Maunder The Code Project Co-founder Microsoft C++ MVP

    L H S N 4 Replies Last reply
    0
    • C Chris Maunder

      I feel like I've just found a new door in my house that I never knew was there. And inside is a whole bunch of VB. It's weird. I just found out about the javascript with keyword. How did I miss it? Was I intentially blanking it out? Weird.

      cheers, Chris Maunder The Code Project Co-founder Microsoft C++ MVP

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      You can even nest those bad boys... http://www.devx.com/tips/Tip/5700[^]

      1 Reply Last reply
      0
      • C Chris Maunder

        I feel like I've just found a new door in my house that I never knew was there. And inside is a whole bunch of VB. It's weird. I just found out about the javascript with keyword. How did I miss it? Was I intentially blanking it out? Weird.

        cheers, Chris Maunder The Code Project Co-founder Microsoft C++ MVP

        H Offline
        H Offline
        Henry Minute
        wrote on last edited by
        #3

        I used to use the 'with statement' quite a lot when I did most of my stuff in Delphi, where they could be nested too. When I moved to C# I missed it at first, but then I had to re-visit some of my old Delphi stuff and realised how difficult it was to understand the deeply nested stuff. So whilst I'm sure that you do :-D , use lots of comments if you decide the nested route is the way to go.

        Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

        C 1 Reply Last reply
        0
        • H Henry Minute

          I used to use the 'with statement' quite a lot when I did most of my stuff in Delphi, where they could be nested too. When I moved to C# I missed it at first, but then I had to re-visit some of my old Delphi stuff and realised how difficult it was to understand the deeply nested stuff. So whilst I'm sure that you do :-D , use lots of comments if you decide the nested route is the way to go.

          Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

          C Offline
          C Offline
          Chris Maunder
          wrote on last edited by
          #4

          Pascal, Delphi, VB - I've used them in all these languages. But to see it in Javascript... It's like being a kid and walking in on your Mum and Dad when they were having some "quite time". Ewww!

          cheers, Chris Maunder The Code Project Co-founder Microsoft C++ MVP

          H 1 Reply Last reply
          0
          • C Chris Maunder

            Pascal, Delphi, VB - I've used them in all these languages. But to see it in Javascript... It's like being a kid and walking in on your Mum and Dad when they were having some "quite time". Ewww!

            cheers, Chris Maunder The Code Project Co-founder Microsoft C++ MVP

            H Offline
            H Offline
            Henry Minute
            wrote on last edited by
            #5

            Chris Maunder wrote:

            It's like being a kid and walking in on your Mum and Dad when they were having some "quite time".

            Didn't they know about butter? :-D

            Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

            1 Reply Last reply
            0
            • C Chris Maunder

              I feel like I've just found a new door in my house that I never knew was there. And inside is a whole bunch of VB. It's weird. I just found out about the javascript with keyword. How did I miss it? Was I intentially blanking it out? Weird.

              cheers, Chris Maunder The Code Project Co-founder Microsoft C++ MVP

              S Offline
              S Offline
              Shog9 0
              wrote on last edited by
              #6

              Aw. Just when they're getting ready to take it out... ;) (and now that you know it's there, read this...)

              1 Reply Last reply
              0
              • C Chris Maunder

                I feel like I've just found a new door in my house that I never knew was there. And inside is a whole bunch of VB. It's weird. I just found out about the javascript with keyword. How did I miss it? Was I intentially blanking it out? Weird.

                cheers, Chris Maunder The Code Project Co-founder Microsoft C++ MVP

                N Offline
                N Offline
                NetDave
                wrote on last edited by
                #7

                I've never understood why they didn't include with in C#. Considering how VBish C# seems, as an old C++ coder, I was surprised to find it missing. While there's plenty to bash in VB, the with keyword is pretty handy.

                QRZ? de WAØTTN

                N 1 Reply Last reply
                0
                • N NetDave

                  I've never understood why they didn't include with in C#. Considering how VBish C# seems, as an old C++ coder, I was surprised to find it missing. While there's plenty to bash in VB, the with keyword is pretty handy.

                  QRZ? de WAØTTN

                  N Offline
                  N Offline
                  Nathan Tuggy
                  wrote on last edited by
                  #8

                  Yeah... in point of fact, I rather like the VB implementation of With (not that I use it all that often, but it's handy to have around every now and then). The Javascript design for with, though, is horrible. It has all the proverbial ugliness of VB, and more so. I mean, seriously! Who thought being able to reference members as though they were global variables was cool, anyway?

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups