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
-
I'm annoyed. Fucking abbreviations.
The waste bin feels offended by the offering it it was printed and thrown away... -
hjk10157312y@cafecortado worst thing is that they put the clear form in the comment. So the extra code is bloody more confusing than the 2 liner.
#FIXME: come up with better variable names
fxph = f(x+h)
fxmh = f(x-h) -
its the extra variables isn't it ?
they could just do a f( x+h) and f(x-h) eh ? -
@AvatarOfKaine That... Plus the naming.
f(x) is a function call.
I dunno what they want to achieve by writing code with such unclear meaning, but it is a bad idea TM -
@IntrusionCM the way its written at first i thought they just skipped the +/- h
all over again.
say all over again for me.
say i am still here. -
@AvatarOfKaine Yeah... The way the code is written obfuscates it's meaning.
It's completely unclear by the way way oldval was introduced at all. -
hjk10157312y@12bitfloat yeah and storing/reverting it is the worst way to do this. I hope that it's not used in a parallel environment.
No side effects is reached by copying (ideally by passing as non ref argument) and using the copy for the remainder of the context.
When no changes to data can be made it's clear and guaranteed to have no side effects.
Saw this today in the exercise code of a deep learning lecture. These people are doing their PhDs in deep learning 😳
* the snippet has no side effects
rant