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. Other Discussions
  3. The Weird and The Wonderful
  4. Strong Typing

Strong Typing

Scheduled Pinned Locked Moved The Weird and The Wonderful
42 Posts 17 Posters 139 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 Chris Maunder

    ewwww! Declare the variables as close to their first use as possible. I have spoken.

    cheers, Chris Maunder

    CodeProject.com : C++ MVP

    X Offline
    X Offline
    XTAL256
    wrote on last edited by
    #41

    Well I started programming in Java and we were told to put all our declarations up the top (which i think is the Java coding standard), and i like it this way. Makes all your declarations easy to find. However, sometimes i need a variable at that scope which will only be used further down, so i put it there. It all comes down to the scope of you're variable and where it's used in that scope as to where it should go

    Customer in computer shop: "Can you copy the Internet onto this disk for me?"

    1 Reply Last reply
    0
    • D dighn

      But then you have to go back to where you were. Sure you could take note of the position but it would still be annoying.

      R Offline
      R Offline
      Russell Jones
      wrote on last edited by
      #42

      in the old vb6 days ctrl-f2 used to take you to a definition and ctrl-shift-f2 used to take you back to where you were before. I'm sure this must be implemented in .net but i've never found out how to do it. I used to use it all the time. Russ

      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