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
-
Shit if it has to be this_is_my_variable_name_right_here, that's 100% better than v_name
-
@alexbrooklyn your type seems a bit odd. But idk, maybe it makes sense it your domain :)
-
ojrask2915yGerman notation for the win. IDGAF if the name is three words long and used in only three lines of code, just make it clear what I'm looking at.
-
potata14805y@halfflat Well, that's both side of extremes in this case.
I loved the theory where:
- for loop - must have single letter.
- variables should tell you what they store (ex. usersArray)
- you should go fuck yourself if you thing that list of users according to their last payment type should be called `list` instead of `usersByLastPaymentType`.
I've seen many cases where variables were so dumb that it actually made it hard to read. Seen cases where they were way too long for what they needed to be. Still made it hard to read.
So people should meet in-between :D -
Suggest using chinese naming. You can write your whole life story with few characters.
-
Be grateful you're not dealing with my code. I declare an array instead of 10 variables and use each element individually. Helps with job security, reduces cold storage usage, and increases compilation time and electricity usage
-
Everything should be made as simple as possible, but not simpler.
—Albert Einstein -
For real hell try to figure this out xD
@highlight
I = 0.5
a = "rmkehilowd"
b = a[4] + a[3]
c = a[6] * 2
d = a[7]
e = " " * 2
f = a[-2] + a[-3] + a[0]
g = a[-4] + a[-1]
O = [b, c, d, e, f , g].join()
x = random()
if x < I:
print(O)
else:
print(a[2] + a[-5] + a[-6] + a[-6])
print(a[1] + a[3]) -
Maybe t indicates type?
Not sure why but I've seen some people write
var xNameOfVar = value;
instead of
x nameOfVar = value; -
cprn16655y"tTime" is Hungarian notation for timestamp type variable named "Time", it's the most popular variable naming convention in the world. If its used in the base code you're going to modify, you should learn it first.
https://en.wikipedia.org/wiki/... -
Until the moment you return in JSON array of 10.000 elements and each element has 5 properties named like “totalAmountOfHoursUsed”. And then your JSON is around 50 MB and client’s browser dies
For the love of God use descriptive variable names. I dont care if it is 15 characters long instead of 5. Besides any halfway modern IDE does auto completion.
"tTime" is not helpful. Target time? Test time? Total time? Tea time? Turtle Timmy? No clue...
rant