473,396 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Quick syntax question

In a test function's return variables I see this:

public void foo(int _Bar1_, string _Bar2, string _Bar3_, short _bar4)
etc...

What do the underscores signify if anything? For what it's worth, the
variables w/ two underscores are both enum elements.

Thanks
Nov 20 '07 #1
3 951
On Nov 20, 4:41 pm, Blip <b...@krumpli.comwrote:
In a test function's return variables I see this:

public void foo(int _Bar1_, string _Bar2, string _Bar3_, short _bar4)
etc...

What do the underscores signify if anything? For what it's worth, the
variables w/ two underscores are both enum elements.
They signify that whoever created the method doesn't believe in making
method declarations easy to read/understand...

Using underscores for private instance variables is reasonably common,
but parameter names should really just be straight camel-cased.

Jon
Nov 20 '07 #2
On Nov 20, 11:41 am, Blip <b...@krumpli.comwrote:
In a test function's return variables I see this:

public void foo(int _Bar1_, string _Bar2, string _Bar3_, short _bar4)
etc...

What do the underscores signify if anything? For what it's worth, the
variables w/ two underscores are both enum elements.
The don't signify anything special. If they signify anything, you
would have to ask the original programmer what he/she meant by using
the underscores in the name.

FWIW, I used to like to use underscores to identify private variables
in a class that would be exposed by public properties. But with C#,
all you need to do is change the case.
Nov 20 '07 #3
Blip,

They don't really indicate anything. It used to be that underscores
were used as a convention for hidden/private members, but that convention
doesn't apply to .NET parameters (or at least, I haven't seen it applied to
them).

Where did you get this code?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Blip" <bl**@krumpli.comwrote in message
news:9a********************************@4ax.com...
In a test function's return variables I see this:

public void foo(int _Bar1_, string _Bar2, string _Bar3_, short _bar4)
etc...

What do the underscores signify if anything? For what it's worth, the
variables w/ two underscores are both enum elements.

Thanks

Nov 20 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Christopher Benson-Manica | last post by:
If you had an unsigned int that needed to be cast to a const myClass*, would you use const myClass* a=reinterpret_cast<const myClass*>(my_val); or const myClass* a=(const myClass*)myVal; ...
8
by: Menon | last post by:
Hi folks I am not at all an SQL server guy (more of an Oracle developer.) I wanted to know if you guys could tell me if SQL Server supports objects in the database. If so, could you kindly point...
14
by: PengYu.UT | last post by:
Hi, I have been using C++ a lot and I've almost forgot what syntax is support by C and what syntax is support by C++? My feeling is that C++ gives programmer much flexibility. And the code is...
8
by: Phil Latio | last post by:
What is the technical name or the name most commonly used for the below? United Kingdom >Wiltshire >Trowbridge Basically you have a table like: category_id, parent_category_id, category_name ...
2
by: vozzek | last post by:
Hi all, I have a really quick syntax problem I can't seem to hammer out... In my script, I am trying to set a variable based upon an entry from my SQL table. Here's two different lines of code...
4
by: learning_codes | last post by:
Hi, What is the difference between Visual Basic and Access XP VBA? Thanks
5
by: Robocop | last post by:
Is it possible to do something like this syntactically: year = '2008' month = '09' limit = '31' for i in range(1,limit): temp = Table.objects.filter(date = year'-'month'-'i) <----screwed...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.