a true programmer can write bad C in any language
@foone when you see some javascript zhat's like
```js
function f_cls(a, r, d1, d2) {
var x, y;
a.bf = r[d1].x;
x = c_n.res(d2, r);
y = r[d1--] = a.q++;
return x>y ? 3 : -1;
}
```
But can they write bad C in honest-to-gosh good C?
@foone i don't understand
I know programmers who use exceptions and they're all cowards
I think this coder may have been trying to do manual memory management in python
they do, like:
def get_url(url):
response = request.get(url)
document = json.loads(response)
response=None # <-- this line
return document
like, that almost makes sense in C, right? they're freeing the HTTP response. but this is python, we have a reference-counting garbage collector
@foone helping the garbage collector, because everyone needs a friend.
IIRC, it was a practice adopted in earlier days of python and javascript when the reference scope was sometimes not handled correctly. Probably not needed today, but it doesn't hurt. Hopefully these kinds of cases are properly handled in unit tests for each build target to ensure conformity.
@foone sooooooo, uh
sometimes it makes sense to do this.
I cannot imagine how that makes sense *here* though
@foone a true C programmer would've written
def get_url(url):
response = None
document = None
response = request.get(url)
document = json.loads(response)
response = None
return document
@foone Doesn't Python have del?
@foone I've had to do similar things in managed runtimes to band-aid other inefficient operations that I did not have time to redo.
@foone
I would never. You can take my result monad from my cold dead hands. And I'm a Java/Kotlin programmer.
@foone any true scotsman would know that this is a false positive.