New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Declaring variables in programming


Post Reply New Thread Subscribe

 
Thread Tools
urlugal

 
Member Since: Mar 31, 2008
Location: East Coast, United States
Posts: 12
urlugal is on a distinguished road
Mac Specs: Macbook 2.1 Core 2 Duo w/ 1GB Ram

urlugal is offline
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.

Matty
-Rules and Models Destroy Genius and Art-
QUOTE Thanks
xstep

 
xstep's Avatar
 
Member Since: Jun 25, 2005
Location: On the road
Posts: 3,231
xstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to all
Mac Specs: 2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid

xstep is offline
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.
QUOTE Thanks
Aptmunich

 
Aptmunich's Avatar
 
Member Since: Mar 09, 2004
Location: Munich
Posts: 9,075
Aptmunich has a brilliant futureAptmunich has a brilliant futureAptmunich has a brilliant futureAptmunich has a brilliant futureAptmunich has a brilliant futureAptmunich has a brilliant futureAptmunich has a brilliant futureAptmunich has a brilliant futureAptmunich has a brilliant futureAptmunich has a brilliant futureAptmunich has a brilliant future
Mac Specs: Aluminium Macbook 2.4 Ghz 4GB RAM, SSD 24" Samsung Display, iPhone 4, iPad 2

Aptmunich is offline
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
QUOTE Thanks

Post Reply New Thread Subscribe


« Results in XCode | C++ Errors »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Java Programming at School pr0wn3r Web Design and Hosting 5 11-25-2007 10:35 PM
Programming language rated knightjp OS X - Development and Darwin 8 09-30-2007 09:37 AM
Not able to set environment variables using .profile file. Shambhavi OS X - Operating System 3 04-08-2006 04:15 AM
Robotic NQC Programming ApplejustWorks Schweb's Lounge 0 01-31-2005 06:28 AM
Programming on the Mac natey OS X - Development and Darwin 4 06-29-2004 06:05 AM

All times are GMT -4. The time now is 08:15 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?