Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
5. var usrnm; (I have met these people).
Even I had to use this stuff, because people got mad at me for wasting my time writing long and meaningful variable names. -
6. var f;
Because actually typing out a proper (or at least even distantly related) short name is too much effort for some people. I've come across tons of code with single-letter names. -
Depends on the language, but overall nowadays I prefer the second variant over stuff like camelCase.
Seems more readable and works with abbreviations as well. -
Wabby10337y@rockford5281 objective-c got me used to writing mammoth length method names and fully expressed variable names.
-
Sourcerer537y@DefiniteGoose it's a stupid convention that reduces the readability of the Code.
Getters/Setters do have their use. But not as a stupid wrapper for a field.
public Singelton SingeltonObject{
get{
If(this._SingeltonObject == nullobject)
This._SingeltonObject = new Singelton();
return this._SingeltonObject ;
}
}
Not the best example but i hope it does the Trick -
@DefiniteGoose because you want to provide read-only access to the variable, but still be able to modify it within the class' methods?
But then, a simple
string Username { get; private set; }
Would do the trick as well... -
nukasev4847yAs long as there is an properly enforced common naming convention in the project and the names are descriptive, I do not really mind the differences between projects. Even though I actually prefer camelCase myself, maybe LIKE_THIS for static variables.
Even something like $tmp is not THAT bad when used properly.
But when you have long, nested loops with shorthanded variable names for the current elements and few other variables, YOU WILL BURN IN HELL. -
monr0e12457yVar isn't a thing outside of methods in C#.
string un;
int uid;
Or even
string handle;
Where you identify a user by their display name. Yep, I've had to do that before. -
monr0e12457y@nukasev I've always used camelcase for private variables, and initial camelcase for public ones, i.e.
string privStr;
public string PubStr; -
-xlf1217yvar obj;
obj.forEach((c,i,a)=>{
c.forEach((c2,i2,a2)=>{
for(p in c2){
c2.p.forEach((c3,i3,a3)=>{
for(p2 in c3){
...
}
});
}
});
}); -
There's only two, the one who still use var and the rest of us.
const userName
let userName -
List<user> u = new List<user>();
u.add( new user ( username = "user" ));
String username = u.username;
Theres only 2 kinds of people in this world:
1. var username;
2. var user_name;
Hint: one of them will burn in hell
rant