Results 1 to 3 of 3
  1. #1

    Member Since
    Mar 31, 2008
    East Coast, United States
    Macbook 2.1 Core 2 Duo w/ 1GB Ram
    Declaring variables in programming
    I am putting this out to those of you that do a lot of coding. I am in a Visual Basic course right now, against my will ;(, and my teacher is having us declare variables with Hungarian notation. I have been coding C and Bash shell scripts in Linux for a few years and have never done it, nor have I ever seen it in a book.
    For those that may not know what this is, it is declaring the variable type in the name; for example dblNumberOne or intTempOne. I was just curious, this teacher seems to be pretty good but his code sometimes makes no sense or he do things certain ways, just because that is the way you are supposed to do them, giving us no reason for it.
    -Rules and Models Destroy Genius and Art-

  2. #2

    xstep's Avatar
    Member Since
    Jun 25, 2005
    On the road
    2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
    It seems to have become popular within Microsoft and effectively exported from there. Being your instructor is teaching VB, it should be no surprise he is using it.

    It isn't right or wrong, but can be very helpful. I suggest you stay open to the idea. You might find the idea helpful in the future. It is a quick way recognize the type you are using and if it makes sense in the context you are about to place the variable in. Also, when it is expected that others with be working on the code, it may be a good convention to follow.

    Class should have opportunities for two way discussion, so I suggest you note those times where things don't make sense and either raise the question during class or discuss it later one on one. Be proactive.
    CameraTime - Time lapse photography for novice and advanced users.

    When asking questions, post the version of your software. You'll receive better answers.

    Please post your results to the thread as it is good feedback.

  3. #3

    Aptmunich's Avatar
    Member Since
    Mar 09, 2004
    Aluminium Macbook 2.4 Ghz 4GB RAM, SSD 24" Samsung Display, iPhone 4, iPad 2
    Hmm, I hadn't heard of that convention before, but when you think about it I suppose it could make a lot of sense...

    It would certainly help to avoid type mismatch errors

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Global Variables In iOS?
    By Loon3y in forum iOS Development
    Replies: 2
    Last Post: 12-02-2011, 04:55 PM
  2. AppleScript variables question
    By Babkockdood in forum OS X - Development and Darwin
    Replies: 1
    Last Post: 03-18-2010, 07:01 PM
  3. Why is it that instance variables with the same name are allowed ?
    By Bracer in forum OS X - Development and Darwin
    Replies: 2
    Last Post: 10-11-2009, 03:27 PM
  4. Setting Environment Variables
    By oquimdcr in forum OS X - Operating System
    Replies: 9
    Last Post: 09-09-2008, 01:51 AM
  5. setting nvram variables
    By jakeroberts in forum Apple Desktops
    Replies: 0
    Last Post: 04-26-2007, 10:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts