wyrd
Senior Contributor
I've been looking to perhaps change my style in programming just a tad. However, I can't remember which language an underscore at the beginning of a variable was considered bad (ie; _somevar). Was it C++, Java or .NET? I can't remember.
In any case, I've been thinking about using _somevar rather then say, somevar (which I usually use, heh). So, my code would look something like this..
I know back in the days (heh, wasn't that long ago I suppose), it was something like m_somevar, however being anal as I am, I hate the extra typing (yeah, I know, it's just one char for crying out loud), and not to mention I just hate the way the m_ looks, and in my opinion just a single _ sticks out more.
Anyway.. suggestions, thoughts, inputs? And if anyone knows which language the _ is considered bad in please tell me, it's going to bother me until I remember, heh.
In any case, I've been thinking about using _somevar rather then say, somevar (which I usually use, heh). So, my code would look something like this..
C#:
public class Hi {
private string _s;
private int _i;
public Hi(string s, int i) {
_s = s;
_i = i;
}
}
I know back in the days (heh, wasn't that long ago I suppose), it was something like m_somevar, however being anal as I am, I hate the extra typing (yeah, I know, it's just one char for crying out loud), and not to mention I just hate the way the m_ looks, and in my opinion just a single _ sticks out more.
Anyway.. suggestions, thoughts, inputs? And if anyone knows which language the _ is considered bad in please tell me, it's going to bother me until I remember, heh.